%{?nodejs_find_provides_and_requires} %global packagename jsonlint %global enable_tests 1 Name: nodejs-jsonlint Version: 1.6.3 Release: 1%{?dist} Summary: Validate JSON License: MIT URL: https://github.com/zaach/jsonlint.git Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz BuildArch: noarch %if 0%{?fedora} >= 19 ExclusiveArch: %{nodejs_arches} noarch %else ExclusiveArch: %{ix86} x86_64 %{arm} noarch %endif BuildRequires: nodejs-packaging BuildRequires: npm(JSV) BuildRequires: npm(nomnom) %if 0%{?enable_tests} BuildRequires: npm(jison) BuildRequires: npm(test) BuildRequires: npm(uglify-js) %endif %description Validate JSON %prep %setup -q -n package sed '0,/^## MIT License/d' README.md > LICENSE.md %nodejs_fixdep nomnom '^1.8.0' sed 's/env //' lib/formatter.js chmod +x lib/formatter.js %build %nodejs_symlink_deps --build make build rm -rf ./node_modules/ %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} make test %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %{!?_licensedir:%global license %doc} %doc *.md %license LICENSE.md %{nodejs_sitelib}/%{packagename} %changelog * Tue Apr 17 2018 Jared K. Smith - 1.6.3-1 - Update to upstream 1.6.3 release * Wed Feb 24 2016 Jared Smith - 1.6.2-1 - Initial packaging