%{?nodejs_find_provides_and_requires} %global packagename imurmurhash %global enable_tests 1 Name: nodejs-imurmurhash Version: 0.1.4 Release: 1%{?dist} Summary: An incremental implementation of MurmurHash3 License: MIT URL: https://github.com/jensyt/imurmurhash-js Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz Source1: https://raw.githubusercontent.com/jensyt/imurmurhash-js/master/LICENSE 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: uglify-js %endif %description An incremental implementation of MurmurHash3 %prep %setup -q -n package # setup the LICENSE file cp -p %{SOURCE1} . # remove pre-compressed script rm imurmurhash.min.js %build # nothing to do! %{_bindir}/uglifyjs imurmurhash.js -o imurmurhash.min.js --comments %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.js \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %if 0%{?enable_tests} %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' echo "This modules contains no test suite..." %endif %files %{!?_licensedir:%global license %doc} %doc *.md %license LICENSE %{nodejs_sitelib}/%{packagename} %changelog * Wed Dec 16 2015 Jared Smith - 0.1.4-1 - Initial packaging