%{?nodejs_find_provides_and_requires} %global packagename nodeunit %global enable_tests 1 Name: nodejs-nodeunit Version: 0.9.1 Release: 3%{?dist} Summary: Easy unit testing for node.js and the browser License: MIT URL: http://github.com/caolan/nodeunit.git Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # the 'should' module no longer has an 'include' function, so this patch # replaces that with 'containEql' instead Patch0: nodejs-nodeunit-fix-test-should-include.patch ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(should) BuildRequires: npm(tap) %endif %description Easy unit testing for node.js and the browser %prep %setup -q -n package %patch0 -p1 %nodejs_fixdep tap %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.js deps/ img/ lib/ share/ deps/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}/bin install -p -D -m0755 bin/nodeunit %{buildroot}%{nodejs_sitelib}/%{packagename}/bin/nodeunit install -p -D -m0644 bin/nodeunit.json %{buildroot}%{nodejs_sitelib}/%{packagename}/bin/nodeunit.json mkdir -p %{buildroot}%{_bindir} ln -sf %{nodejs_sitelib}/%{packagename}/bin/nodeunit \ %{buildroot}%{_bindir}/nodeunit %nodejs_symlink_deps %if 0%{?enable_tests} %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %__nodejs ./bin/nodeunit %endif %files %{!?_licensedir:%global license %doc} %doc *.md doc/ examples/ %license LICENSE %{nodejs_sitelib}/%{packagename} %{_bindir}/nodeunit %changelog * Tue Oct 27 2015 Jared Smith - 0.9.1-3 - Add dependency on npm(should) * Mon Oct 19 2015 Jared Smith - 0.9.1-2 - Initial packaging