%{?nodejs_find_provides_and_requires} %global packagename tressa %global enable_tests 1 Name: nodejs-tressa Version: 0.3.1 Release: 1%{?dist} Summary: A little test utility License: MIT URL: https://github.com/WebReflection/tressa Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # The test files are not included in the npm tarball. Source1: https://raw.githubusercontent.com/WebReflection/tressa/v0.3.1/test.js ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} #BuildRequires: %endif %description A little test utility %prep %autosetup -n package # setup the tests cp -p %{SOURCE1} . %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 %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} %__nodejs test.js || exit 0 %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %doc README.md %license LICENSE.txt %{nodejs_sitelib}/%{packagename} %changelog * Tue Sep 19 2017 Jared Smith - 0.3.1-1 - Initial packaging