%{?nodejs_find_provides_and_requires} %global packagename tap-parser %global enable_tests 1 Name: nodejs-tap-parser Version: 1.2.2 Release: 3%{?dist} Summary: Parse the test anything protocol License: MIT URL: https://github.com/substack/tap-parser.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 Source10: dl-tests.sh ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(events-to-array) BuildRequires: npm(glob) BuildRequires: npm(js-yaml) BuildRequires: npm(tap) BuildRequires: npm(tape) %endif %description Parse the test anything protocol. %prep %setup -q -n package # setup the tests %setup -q -T -D -a 1 -n package %nodejs_fixdep -r inherits # reported upstream at https://github.com/tapjs/tap-parser/pull/26 %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.js \ %{buildroot}%{nodejs_sitelib}/%{packagename} mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}/bin/ cp -pr package.json bin/*.js \ %{buildroot}%{nodejs_sitelib}/%{packagename}/bin/ mkdir -p %{buildroot}%{_bindir} ln -sf %{nodejs_sitelib}/%{packagename}/bin/cmd.js \ %{buildroot}%{_bindir}/tap-parser %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} %{_bindir}/tap test/*.js %endif %files %{!?_licensedir:%global license %doc} %doc *.markdown %license LICENSE %{nodejs_sitelib}/%{packagename} %{_bindir}/tap-parser %changelog * Mon Jan 18 2016 Jared Smith - 1.2.2-3 - Update minor issues for package review * Fri Jan 15 2016 Jared Smith - 1.2.2-2 - Add support for tap-parser binary * Mon Oct 19 2015 Jared Smith - 1.2.2-1 - Initial packaging