%{?nodejs_find_provides_and_requires} %global packagename fake %global enable_tests 1 Name: nodejs-fake Version: 0.2.2 Release: 1%{?dist} Summary: Test your JavaScript with focused programmer tests License: MIT URL: https://github.com/felixge/node-fake Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz Source1: https://raw.githubusercontent.com/felixge/node-fake/master/License # The test files are not included in the npm tarball. # Source2 is generated by running Source10, which pulls from the upstream # version control repository. Source2: tests-%{version}.tar.bz2 Source10: dl-tests.sh ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(far) %endif %description Test your JavaScript with focused programmer tests. Fake depedencies. %prep %autosetup -n package # license file cp -p %{SOURCE1} . # setup the tests %autosetup -T -D -a 2 -n package %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.js lib/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} %{__nodejs} test/run.js %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %doc *.md %license License %{nodejs_sitelib}/%{packagename} %changelog * Wed Oct 4 2017 Jared Smith - 0.2.2-1 - Initial packaging