%{?nodejs_find_provides_and_requires} %global enable_tests 1 Name: nodejs-esutils Version: 2.0.2 Release: 1 Summary: Utility box for ECMAScript language tools License: BSD URL: https://github.com/Constellation/esutils Source0: http://registry.npmjs.org/esutils/-/esutils-%{version}.tgz # The test files are not included in the npm tarball. # Source1 is generated by running Source10, which pulls from the upstream # version control repository. Source1: tests-%{version}.tar.bz2 Source10: dl-tests.sh BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(chai) npm(coffee-script) npm(mocha) %endif %description %{summary}. %prep %setup -q -n package %setup -q -T -D -a 1 -n package %build %install mkdir -p %{buildroot}%{nodejs_sitelib}/esutils cp -pr package.json lib/ \ %{buildroot}%{nodejs_sitelib}/esutils %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} %{_bindir}/mocha --compilers coffee:coffee-script/register -R spec %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %{!?_licensedir:%global license %doc} %doc README.md %license LICENSE.BSD %{nodejs_sitelib}/esutils %changelog * Fri Aug 21 2020 leiju - 2.0.2-1 - Package init