%{?nodejs_find_provides_and_requires} %global packagename nyc %global enable_tests 0 # Tests disabled because the tests rely on an older npm(source-map-fixtures) # that has changed APIs since then Name: nodejs-nyc Version: 5.5.0 Release: 1%{?dist} Summary: A code coverage tool that works well with subprocesses License: ISC URL: https://github.com/bcoe/nyc.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 Source2: docs-%{version}.tar.bz2 Source10: dl-tests.sh ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch BuildRequires: nodejs-packaging BuildRequires: npm(append-transform) BuildRequires: npm(caching-transform) BuildRequires: npm(convert-source-map) BuildRequires: npm(find-cache-dir) BuildRequires: npm(micromatch) BuildRequires: npm(pkg-up) BuildRequires: npm(read-pkg) BuildRequires: npm(resolve-from) BuildRequires: npm(source-map-fixtures) BuildRequires: npm(unicode-length) %if 0%{?enable_tests} BuildRequires: npm(tap) BuildRequires: npm(any-path) %endif %description A code coverage tool that works well with subprocesses. %prep %setup -q -n package # setup the tests and docs %setup -q -T -D -a 1 -n package %setup -q -T -D -a 2 -n package # Remove bundled packages rm -rf node_modules/ sed -i '1s/env //' bin/nyc.js sed -i '1i #!/usr/bin/node' bin/wrap.js sed -i '1i #!/usr/bin/node' index.js %nodejs_fixdep append-transform '^0.4.0' %nodejs_fixdep micromatch '^2.3.0' %nodejs_fixdep read-pkg %nodejs_fixdep signal-exit %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.js lib/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}/bin install -p -D -m0755 bin/nyc.js %{buildroot}%{nodejs_sitelib}/%{packagename}/bin/nyc.js install -p -D -m0755 bin/wrap.js %{buildroot}%{nodejs_sitelib}/%{packagename}/bin/wrap.js mkdir -p %{buildroot}%{_bindir} ln -sf %{nodejs_sitelib}/%{packagename}/bin/nyc.js \ %{buildroot}%{_bindir}/nyc %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} %{_bindir}/tap --no-cov -b ./test/build/*.js %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %{!?_licensedir:%global license %doc} %doc *.md %license LICENSE.txt %{nodejs_sitelib}/%{packagename} %{_bindir}/nyc %changelog * Wed Feb 03 2016 Jared Smith - 5.5.0-1 - Update to upstream 5.5.0 release * Tue Oct 27 2015 Jared Smith - 3.2.2-1 - Initial packaging