%{?nodejs_find_provides_and_requires} %global packagename svgmin # tests disabled because they haven't been tagged in upstream github %global enable_tests 0 Name: nodejs-svgmin Version: 0.1.0 Release: 2%{?dist} Summary: Minify SVG files License: MIT URL: https://github.com/kevva/svgmin Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # Get the license and readme files from upstream repo Source11: https://raw.githubusercontent.com/kevva/svgmin/master/LICENSE.md Source12: https://raw.githubusercontent.com/kevva/svgmin/master/README.md # The index.js file in the npm archive is zero-length, so grab from github # instead (master branch, since the releases aren't tagged on github) Source13: https://raw.githubusercontent.com/kevva/svgmin/master/index.js ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch BuildRequires: nodejs-packaging BuildRequires: npm(ware) BuildRequires: npm(xml2js) %if 0%{?enable_tests} # nothing %endif Requires: nodejs %description Minify SVG files %prep %setup -q -n package # copy the license and readme cp -r %{SOURCE11} . cp -r %{SOURCE12} . # copy the real index.js cp -r %{SOURCE13} . %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.js \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %if 0%{?enable_tests} node test/test.js %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %{!?_licensedir:%global license %doc} %doc README.md %license LICENSE.md %{nodejs_sitelib}/%{packagename} %changelog * Mon Aug 08 2016 Jared Smith - 0.1.0-2 - Fix zero-length index.js file * Sun Oct 25 2015 Jared Smith - 0.1.0-1 - Initial packaging