%{?nodejs_find_provides_and_requires} %global packagename repeat-element %global enable_tests 1 Name: nodejs-repeat-element Version: 1.1.2 Release: 1%{?dist} Summary: Create an array by repeating the given value n times License: MIT URL: https://github.com/jonschlinkert/repeat-element.git Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # The test files are not included in the npm tarball. # The 1.1.2 release is not tagged in github, so pull from master Source1: https://raw.githubusercontent.com/jonschlinkert/repeat-element/master/test.js # The tests also need the 'benchmark' directory, which can be obtained by # running the following command from a git checkout: # # git archive --prefix='benchmark/' --format=tar master:benchmark/ | bzip2 > benchmark-master.tar.bz2 Source2: benchmark-master.tar.bz2 BuildArch: noarch %if 0%{?fedora} >= 19 ExclusiveArch: %{nodejs_arches} noarch %else ExclusiveArch: %{ix86} x86_64 %{arm} noarch %endif BuildRequires: nodejs-packaging BuildRequires: npm(chalk) BuildRequires: npm(glob) BuildRequires: npm(minimist) %if 0%{?enable_tests} BuildRequires: mocha %endif %description Create an array by repeating the given value n times. %prep %setup -q -n package # setup the tests cp -p %{SOURCE1} . %setup -q -T -D -a 2 -n package %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json index.js \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} %{_bindir}/mocha %else %{_bindir}/echo "Tests disabled..." %endif %files %{!?_licensedir:%global license %doc} %doc *.md %license LICENSE %{nodejs_sitelib}/%{packagename} %changelog * Mon Feb 8 2016 Jared Smith - 1.1.2-1 - Initial packaging