%{?nodejs_find_provides_and_requires} %global packagename uuid %global enable_tests 1 Name: nodejs-uuid Version: 3.1.0 Release: 2%{?dist} Summary: Rigorous implementation of RFC4122 (v1 and v4) UUIDs License: MIT URL: https://github.com/shtylman/node-uuid Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # Source1 is generated by running Source10, which pulls from the upstream # version control repository. Source1: tests-%{version}.tar.bz2 Source10: dl-tests.sh # Remove the parse/unparse tests, because parse/unparse were removed from # the 3.0.0 release, but the tests weren't fixed Patch0: nodejs-uuid_fix-tests.patch ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: mocha %endif Requires: nodejs %description Rigorous implementation of RFC4122 (v1 and v4) UUIDs. %prep %setup -q -n package # setup the tests %autosetup -T -D -a 1 -n package -p 1 %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.js lib/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} /usr/bin/mocha -R spec test/test.js %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %{!?_licensedir:%global license %doc} %doc README.md HISTORY.md %license LICENSE.md %{nodejs_sitelib}/%{packagename} %changelog * Fri Sep 22 2017 Jared Smith - 3.1.0-2 - Add patch to fix tests * Fri Sep 22 2017 Jared Smith - 3.1.0-1 - Update to upstream 3.1.0 release * Sat May 06 2017 Jared Smith - 3.0.1-1 - Update to upstream 3.0.1 release * Thu Oct 29 2015 Jared Smith - 2.0.1-1 - Initial packaging