%{?nodejs_find_provides_and_requires} %global packagename add-stream %global enable_tests 1 Name: nodejs-add-stream Version: 1.0.0 Release: 1%{?dist} Summary: Append the contents of one stream onto another License: MIT URL: https://github.com/wilsonjackson/add-stream Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # License text is in README.md on master branch Source1: https://raw.githubusercontent.com/wilsonjackson/add-stream/master/README.md BuildArch: noarch ExclusiveArch: %{ix86} x86_64 %{arm} noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: mocha BuildRequires: npm(event-stream) %endif %description Append the contents of one stream onto another. %prep %autosetup -n package cp -p %{SOURCE1} temp.md sed -n '/## License/,$p' temp.md > LICENSE.md rm temp.md %build # nothing to do %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json index.js \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} NODE_ENV=test %{_bindir}/mocha -R spec -u exports %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %{!?_licensedir:%global license %doc} %doc README.md %license LICENSE.md %{nodejs_sitelib}/%{packagename} %changelog * Wed Feb 21 2018 Jared Smith - 1.0.0-1 - Initial packaging