2020-08-28 16:04:22 +08:00
|
|
|
%global enable_tests 0
|
|
|
|
|
%global module_name caller-path
|
|
|
|
|
Name: nodejs-%{module_name}
|
2023-10-30 16:47:23 +08:00
|
|
|
Version: 4.0.0
|
2020-08-28 16:04:22 +08:00
|
|
|
Release: 1
|
|
|
|
|
Summary: Get the path of the caller module
|
|
|
|
|
License: MIT
|
|
|
|
|
URL: https://github.com/sindresorhus/caller-path
|
2023-10-30 16:47:23 +08:00
|
|
|
Source0: https://github.com/sindresorhus/caller-path/archive/v%{version}/%{name}-%{version}.tar.gz
|
2020-08-28 16:04:22 +08:00
|
|
|
BuildArch: noarch
|
|
|
|
|
ExclusiveArch: %{nodejs_arches} noarch
|
|
|
|
|
BuildRequires: nodejs-packaging
|
|
|
|
|
%if 0%{?enable_tests}
|
|
|
|
|
BuildRequires: npm(fixture) npm(mocha)
|
|
|
|
|
%endif
|
|
|
|
|
%description
|
|
|
|
|
Get the path of the caller module. You can't use module.parent as modules are
|
|
|
|
|
cached and it will return the first caller module, not necessarily the current
|
|
|
|
|
one.
|
|
|
|
|
|
|
|
|
|
%prep
|
2020-09-07 17:48:35 +08:00
|
|
|
%autosetup -n caller-path-%{version}
|
2020-08-28 16:04:22 +08:00
|
|
|
rm -rf node_modules
|
2020-09-08 11:31:17 +08:00
|
|
|
cp -p %{SOURCE0} .
|
2020-08-28 16:04:22 +08:00
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
mkdir -p %{buildroot}%{nodejs_sitelib}/%{module_name}
|
|
|
|
|
cp -pr package.json *.js %{buildroot}%{nodejs_sitelib}/%{module_name}
|
|
|
|
|
%nodejs_symlink_deps
|
|
|
|
|
%if 0%{?enable_tests}
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
%nodejs_symlink_deps --check
|
|
|
|
|
%{__nodejs} -e 'require("./")'
|
|
|
|
|
mocha
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%doc readme.md
|
|
|
|
|
%license license
|
|
|
|
|
%{nodejs_sitelib}/%{module_name}
|
|
|
|
|
|
|
|
|
|
%changelog
|
2023-10-30 16:47:23 +08:00
|
|
|
* Mon Oct 30 2023 xu_ping <707078654@qq.com> - 4.0.0-1
|
|
|
|
|
- Upgrade version to 4.0.0
|
|
|
|
|
|
2020-08-28 16:04:22 +08:00
|
|
|
* Mon Aug 17 2020 Shaoqiang Kang <kangshaoqiang1@huawei.com> - 2.0.0-1
|
|
|
|
|
- Package init
|