%{?nodejs_find_provides_and_requires} %global packagename locate-path %global enable_tests 0 Name: nodejs-locate-path Version: 2.0.0 Release: 2 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} . sed -i 's/3.0.0/4.0.0/g' package.json %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 * Wed Dec 27 2023 Ge Wang - 2.0.0-2 - Adapt install require due to path-exists updated * Mon Aug 17 2020 wutao - 2.0.0-1 - Package init