54 lines
1.4 KiB
RPMSpec
54 lines
1.4 KiB
RPMSpec
%global enable_tests 0
|
|
%global module_name require-uncached
|
|
Name: nodejs-%{module_name}
|
|
Version: 3.3.0
|
|
Release: 1
|
|
Summary: Require a module bypassing the cache
|
|
License: MIT
|
|
URL: https://github.com/sindresorhus/require-uncached
|
|
Source0: https://github.com/sindresorhus/import-fresh/archive/v%{version}/%{name}-%{version}.tar.gz
|
|
BuildArch: noarch
|
|
ExclusiveArch: %{nodejs_arches} noarch
|
|
BuildRequires: nodejs-packaging npm(caller-path) npm(resolve-from)
|
|
%if 0%{?enable_tests}
|
|
BuildRequires: npm(ava)
|
|
%endif
|
|
|
|
Patch0: adapted-caller-path.patch
|
|
|
|
%description
|
|
Useful for testing purposes when you need to freshly require a module.
|
|
|
|
%prep
|
|
%autosetup -n import-fresh-%{version} -p1
|
|
rm -rf node_modules
|
|
%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
|
|
%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
|
|
* Tue Oct 31 2023 xu_ping <707078654@qq.com> - 3.3.0-1
|
|
- Upgrade version to 3.3.0
|
|
|
|
* Fri Aug 14 2020 wangyue <wangyue92@huawei.com> - 1.0.3-1
|
|
- Package init
|