55 lines
1.4 KiB
RPMSpec
55 lines
1.4 KiB
RPMSpec
%{?nodejs_find_provides_and_requires}
|
|
%global packagename locate-path
|
|
%global enable_tests 0
|
|
Name: nodejs-locate-path
|
|
Version: 2.0.0
|
|
Release: 1
|
|
Summary: Get the first path that exists on disk of multiple paths
|
|
License: MIT
|
|
URL: https://github.com/sindresorhus/locate-path
|
|
Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
|
|
#git clone $url
|
|
#cd $pkgdir
|
|
#git archive --prefix='fixture/' --format=tar ${gittag}:fixture/ \| bzip2 > "$pwd"/fixture-${tag}.tar.bz2
|
|
Source1: fixture-%{version}.tar.bz2
|
|
Source11: https://raw.githubusercontent.com/sindresorhus/locate-path/v%{version}/test.js
|
|
ExclusiveArch: %{nodejs_arches} noarch
|
|
BuildArch: noarch
|
|
BuildRequires: nodejs-packaging npm(p-locate) npm(path-exists)
|
|
%if 0%{?enable_tests}
|
|
BuildRequires: npm(ava)
|
|
%endif
|
|
%description
|
|
Get the first path that exists on disk of multiple paths
|
|
|
|
%prep
|
|
%autosetup -n package
|
|
%autosetup -T -D -a 1 -n package
|
|
cp -p %{SOURCE11} .
|
|
|
|
%build
|
|
|
|
%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}
|
|
%{_bindir}/ava
|
|
%else
|
|
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
|
|
%endif
|
|
|
|
%files
|
|
%doc readme.md
|
|
%license license
|
|
%{nodejs_sitelib}/%{packagename}
|
|
|
|
%changelog
|
|
* Mon Aug 17 2020 wutao <wutao61@huawei.com> - 2.0.0-1
|
|
- Package init
|