%{?nodejs_find_provides_and_requires} %global packagename zzz %global enable_tests 1 Name: nodejs-zzz Version: 0.3.0 Release: 1%{?dist} Summary: Lightweight REST service container License: MIT URL: https://github.com/avayanis/Zzz Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # No license file. Requested at https://github.com/avayanis/Zzz/issues/6 Source1: LICENSE-MIT.txt Patch0: nodejs-zzz_should_syntax_fixes.patch 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: mocha BuildRequires: npm(should) %endif %description Lightweight REST service container %prep %autosetup -n package -p1 cp -p %{SOURCE1} . %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} NODE_ENV=test %{_bindir}/mocha -R spec %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %{!?_licensedir:%global license %doc} %doc *.md %license LICENSE-MIT.txt %{nodejs_sitelib}/%{packagename} %changelog * Mon Jul 11 2016 Jared Smith - 0.3.0-1 - Initial packaging