%{?nodejs_find_provides_and_requires} %global packagename node-pre-gyp %global enable_tests 1 Name: node-pre-gyp Version: 0.6.38 Release: 1%{?dist} Summary: Node.js native addon binary install tool License: BSD URL: https://github.com/mapbox/node-pre-gyp 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 BuildRequires: npm(mkdirp) BuildRequires: npm(nopt) BuildRequires: npm(npmlog) BuildRequires: npm(rc) BuildRequires: npm(request) BuildRequires: npm(hawk) BuildRequires: npm(rimraf) BuildRequires: npm(semver) BuildRequires: npm(tar) BuildRequires: npm(tar-pack) %if 0%{?enable_tests} BuildRequires: npm(tape) %endif %description Node.js native addon binary install tool %prep %autosetup -n package # setup the tests %autosetup -T -D -a 1 -n package # fix script interpreter sed -i '1s/env //' bin/%{packagename} %nodejs_fixdep hawk %nodejs_fixdep nopt %nodejs_fixdep npmlog %nodejs_fixdep request %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json lib/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}/bin install -p -D -m0755 bin/%{packagename} \ %{buildroot}%{nodejs_sitelib}/%{packagename}/bin/%{packagename} mkdir -p %{buildroot}%{_bindir} ln -sf %{nodejs_sitelib}/%{packagename}/bin/%{packagename} \ %{buildroot}%{_bindir}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} %{_bindir}/tape test/*test.js %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %doc *.md %license LICENSE %{nodejs_sitelib}/%{packagename} %{_bindir}/%{packagename} %changelog * Fri Sep 29 2017 Jared Smith - 0.6.38-1 - Initial packaging