%{?nodejs_find_provides_and_requires} %global packagename json-diff %global enable_tests 1 # tests disabled due to missing npm(cli-color) module, which itself has # a metric ton of missing dependencies Name: nodejs-json-diff Version: 0.3.1 Release: 1%{?dist} Summary: JSON diff License: MIT URL: https://github.com/andreyvit/json-diff Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # The test files are not included in the npm tarball. # Source1,2 is generated by running Source10, which pulls from the upstream # version control repository. Source1: tests-%{version}.tar.bz2 Source2: example-%{version}.tar.bz2 Source10: dl-tests.sh Source3: https://raw.githubusercontent.com/andreyvit/json-diff/master/LICENSE-MIT # license file wasn't there when this release was tagged, so grab from master until # the next release is tagged 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: coffee-script BuildRequires: mocha BuildRequires: npm(cli-color) BuildRequires: npm(difflib) BuildRequires: npm(should) %endif %description JSON diff %prep %setup -q -n package # setup the tests and examples %setup -q -T -D -a 1 -n package %setup -q -T -D -a 2 -n package # copy the license file cp -p %{SOURCE3} . %nodejs_fixdep cli-color '^1.1.0' %nodejs_fixdep dreamopt '^0.8.0' %nodejs_fixdep should %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json lib/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} %{_bindir}/coffee -c -b test/ %{_bindir}/mocha --require should -R spec %endif %files %{!?_licensedir:%global license %doc} %doc *.md %license LICENSE-MIT %{nodejs_sitelib}/%{packagename} %changelog * Fri Nov 6 2015 Jared Smith - 0.3.1-1 - Initial packaging