%{?nodejs_find_provides_and_requires} %global packagename mocha-sugar-free %global enable_tests 1 Name: nodejs-mocha-sugar-free Version: 1.3.1 Release: 1%{?dist} Summary: Write mocha test cases without using globals or `this` License: MIT URL: https://github.com/Joris-van-der-Wel/mocha-sugar-free 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(bluebird) BuildRequires: npm(xtend) %if 0%{?enable_tests} # nothing BuildRequires: npm(chalk) BuildRequires: npm(mocha) %endif %description Write mocha test cases without using globals or `this`. Browserify compatible. Mocha without the sugar. %prep %autosetup -n package %build # nothing to do %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.js lib/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %if 0%{?enable_tests} %{_bindir}/echo -e "\e[102m -=#=- Don't worry about failing tests... they're expected -=#=- \e[0m" %__nodejs test/run-tests.js %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %{!?_licensedir:%global license %doc} %doc *.md %license LICENSE %{nodejs_sitelib}/%{packagename} %changelog * Tue Aug 2 2016 Jared Smith - 1.3.1-1 - Initial packaging