%{?nodejs_find_provides_and_requires} %global packagename unique-slug %global enable_tests 1 Name: nodejs-unique-slug Version: 2.0.0 Release: 1%{?dist} Summary: Generate a unique character string suitable for use in files and URLs License: ISC URL: https://github.com/iarna/unique-slug.git Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz Source1: LICENSE-ISC.txt Patch0: nodejs-unique-slug_fix_tests.patch # the version of npm(tap) in Fedora is *very* old, so we have to patch the # syntax to fit the old version of tap. If tap gets updated, we can remove # this patch. BuildArch: noarch %if 0%{?fedora} >= 19 ExclusiveArch: %{nodejs_arches} noarch %else ExclusiveArch: %{ix86} x86_64 %{arm} noarch %endif BuildRequires: nodejs-packaging BuildRequires: npm(imurmurhash) %if 0%{?enable_tests} BuildRequires: npm(tap) %endif %description Generate a unique character string suitable for use in files and URLs. %prep %setup -q -n package cp -p %{SOURCE1} . %patch0 -p1 %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}/tap --coverage test %else %{_bindir}/echo "Tests disabled..." %endif %files %{!?_licensedir:%global license %doc} %doc *.md %license LICENSE-ISC.txt %{nodejs_sitelib}/%{packagename} %changelog * Fri Dec 18 2015 Jared Smith - 2.0.0-1 - Initial packaging