%{?nodejs_find_provides_and_requires} %global packagename require-main-filename # tests disabled, as they require a newer version of npm(tap), and this package # is a dependency of a newer npm(tap) %global enable_tests 0 Name: nodejs-require-main-filename Version: 1.0.1 Release: 1%{?dist} Summary: Shim for require.main.filename() that works in as many environments as possible License: ISC URL: https://github.com/yargs/require-main-filename.git Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(chai) BuildRequires: npm(tap) %endif %description Shim for require.main.filename() that works in as many environments as possible %prep %autosetup -n package %build # nothing to do %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json index.js \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} NODE_ENV=test %{_bindir}/tap test.js %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %doc *.md %license LICENSE.txt %{nodejs_sitelib}/%{packagename} %changelog * Thu Apr 26 2018 Jared K. Smith - 1.0.1-1 - Initial packaging