%{?nodejs_find_provides_and_requires} %global packagename tap %global enable_tests 1 Name: nodejs-tap Version: 5.1.1 Release: 2%{?dist} Summary: A Test-Anything-Protocol library License: ISC URL: https://github.com/tapjs/node-tap.git Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # The test files are not included in the npm tarball. # Source1 is generated by running Source10, which pulls from the upstream # version control repository. Source1: tests-%{version}.tar.bz2 # Example files as well Source2: examples-%{version}.tar.bz2 Source10: dl-tests.sh Patch0: nodejs-tap_no-nyc-coveralls.patch # Patch out the tests that need to have npm(nyc) and npm(coveralls) installed, # since they are not yet packaged in Fedora BuildArch: noarch %if 0%{?fedora} >= 19 ExclusiveArch: %{nodejs_arches} noarch %else ExclusiveArch: %{ix86} x86_64 %{arm} noarch %endif BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(bluebird) BuildRequires: npm(deeper) BuildRequires: npm(isexe) BuildRequires: npm(stack-utils) BuildRequires: npm(tap-mocha-reporter) BuildRequires: npm(tap-parser) BuildRequires: npm(which) %endif %description A Test-Anything-Protocol library %prep %setup -q -n package # setup the tests %setup -q -T -D -a 1 -n package # setup the examples %setup -q -T -D -a 2 -n package %patch0 -p2 # Remove the coverage tests and tests that don't work in Fedora rm test/coverage-checks.js rm test/coverage-export.js %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json lib/ bin/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} mkdir -p %{buildroot}%{_bindir} ln -sf %{nodejs_sitelib}/%{packagename}/bin/run.js \ %{buildroot}%{_bindir}/tap %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} %{__nodejs} bin/run.js test/*.* %else %{_bindir}/echo "Tests disabled..." %endif %files %{!?_licensedir:%global license %doc} %doc *.md example/ %license LICENSE %{nodejs_sitelib}/%{packagename} %{_bindir}/tap %changelog * Tue Jan 19 2016 Jared Smith - 5.1.1-2 - Add missing build dependency on npm(deeper) * Mon Jan 18 2016 Jared Smith - 5.1.1-1 - Update to upstream 5.1.1 release - Fix patch to eliminate tests that depend on unpackaged dependencies * Fri Jan 15 2016 Jared Smith - 5.0.1-1 - Update to upstream 5.0.1 release