%{?nodejs_find_provides_and_requires} %global packagename bit-mask %global enable_tests 1 Name: nodejs-bit-mask Version: 1.0.2 Release: 1%{?dist} Summary: A utility for manipulating bit masks License: MIT URL: https://github.com/khrome/bit-mask.git Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # license file requested at https://github.com/khrome/bit-mask/pull/3 Source1: LICENSE-MIT BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging BuildRequires: npm(array-events) %if 0%{?enable_tests} BuildRequires: mocha BuildRequires: npm(request) BuildRequires: npm(should) %endif %description A utility for manipulating bit masks %prep %autosetup -n package cp -p %{SOURCE1} . %nodejs_fixdep array-events '^1.0.0' %build # nothing to do %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.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 %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %doc *.md %license LICENSE-MIT %{nodejs_sitelib}/%{packagename} %changelog * Mon Apr 23 2018 Jared K. Smith - 1.0.2-1 - Initial packaging