%{?nodejs_find_provides_and_requires} %global packagename jju %global enable_tests 0 # tests disabled because the test suite is broken Name: nodejs-jju Version: 1.2.1 Release: 1%{?dist} Summary: A set of utilities to work with JSON / JSON5 documents License: WTFPL URL: https://github.com/rlidwka/jju Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # The test files are not included in the npm tarball. # Source1-4 are generated by running Source10, which pulls from the upstream # version control repository. Source1: tests-%{version}.tar.bz2 Source2: examples-%{version}.tar.bz2 Source3: docs-%{version}.tar.bz2 Source10: dl-tests.sh # The license isn't included in the tarball. The package.json lists the # license as the WTFPL and links to the following file. I've requested # that the author include a LICENSE file at # https://github.com/rlidwka/jju/issues/16 Source4: http://www.wtfpl.net/txt/copying/#/index.html ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: mocha %endif Requires: nodejs %description A set of utilities to work with JSON / JSON5 documents %prep %setup -q -n package # setup the tests %setup -q -T -D -a 1 -n package %setup -q -T -D -a 2 -n package %setup -q -T -D -a 3 -n package # copy the license cp -p %{SOURCE4} LICENSE %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json package.yaml *.js lib/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %if 0%{?enable_tests} %check %nodejs_symlink_deps --check NODE_ENV=test /usr/bin/mocha -R spec test/*.js %endif %files %{!?_licensedir:%global license %doc} %doc *.md docs/ examples/ %license LICENSE %{nodejs_sitelib}/%{packagename} %changelog * Mon Oct 26 2015 Jared Smith - 1.2.1-1 - Initial packaging