%{?nodejs_find_provides_and_requires} %global packagename watershed %global enable_tests 1 Name: nodejs-watershed Version: 0.3.4 Release: 1%{?dist} Summary: A simple websockets (RFC6455) client and server License: MIT URL: https://github.com/joyent/node-watershed 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 # One test file is missing in the 0.3.4 release Source11: https://raw.githubusercontent.com/joyent/node-watershed/master/test/basic.js ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(tape) %endif %description A simple websockets (RFC6455) client and server. %prep %autosetup -n package # setup the tests %autosetup -T -D -a 1 -n package cp %{SOURCE11} test/basic.js %nodejs_fixdep readable-stream # dtrace-provider doesn't work on Linux, and isn't really needed %nodejs_fixdep -r dtrace-provider %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json lib/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} %{_bindir}/tape test/basic.js %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %doc README.md %license LICENSE %{nodejs_sitelib}/%{packagename} %changelog * Sun Sep 24 2017 Jared Smith - 0.3.4-1 - Initial packaging