%{?nodejs_find_provides_and_requires} %global packagename sequencify %global enable_tests 1 Name: nodejs-sequencify Version: 0.0.7 Release: 1%{?dist} Summary: A module for sequencing tasks and dependencies License: MIT URL: https://github.com/robrich/sequencify.git Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # Tests aren't part of the npm tarball, and there are no tags in the github repo # This git tag corresponds with version 0.0.7 Source1: https://raw.githubusercontent.com/robrich/sequencify/df3e382c496ff4b505d992c0e0320d46353594b0/test/index.js 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: mocha BuildRequires: npm(should) %endif %description A module for sequencing tasks and dependencies %prep %setup -q -n package # setup the tests mkdir test/ cp -p %{SOURCE1} test/ # fix the 'should' syntax for the tests sed -i -e 's/should.include/should.containEql/' test/index.js %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.js \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} %{_bindir}/mocha -R spec %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %{!?_licensedir:%global license %doc} %doc *.md %license LICENSE %{nodejs_sitelib}/%{packagename} %changelog * Wed Jan 20 2016 Jared Smith - 0.0.7-1 - Initial packaging