%global enable_tests 0 %global module_name require-uncached Name: nodejs-%{module_name} Version: 1.0.3 Release: 1 Summary: Require a module bypassing the cache License: MIT URL: https://github.com/sindresorhus/require-uncached Source0: http://registry.npmjs.org/require-uncached/-/require-uncached-%{version}.tgz Source1: https://raw.githubusercontent.com/sindresorhus/import-fresh/v%{version}/license Source2: https://raw.githubusercontent.com/sindresorhus/import-fresh/v%{version}/test.js BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging npm(caller-path) npm(resolve-from) %if 0%{?enable_tests} BuildRequires: npm(ava) %endif %description Useful for testing purposes when you need to freshly require a module. %prep %autosetup -n package rm -rf node_modules cp -p %{SOURCE1} %{SOURCE2} . %nodejs_fixdep caller-path %nodejs_fixdep resolve-from %build %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{module_name} cp -pr package.json *.js %{buildroot}%{nodejs_sitelib}/%{module_name} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} node test.js %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %doc readme.md %license license %{nodejs_sitelib}/%{module_name} %changelog * Fri Aug 14 2020 wangyue - 1.0.3-1 - Package init