%{?nodejs_find_provides_and_requires}

%global packagename yarn

Name:		nodejs-yarn
Version:	1.22.11
Release:	1
Summary:	Fast, reliable, and secure dependency management for yarn packages.
License:	BSD-2-Clause
URL:		https://github.com/yarnpkg/yarn
Source0:	https://registry.npmjs.org/yarn/-/yarn-1.22.11.tgz

BuildArch:	noarch

BuildRequires:	nodejs-packaging

%description
Fast, reliable, and secure dependency management for yarn packages.

%define debug_package %{nil}

%prep
%autosetup -n yarn-v%{version}
# setup the tests

%build
# nothing to do!

%install
if [ -f license ]; then
 mv license LICENSE
fi
if [ -f License ]; then
 mv License LICENSE
fi
if [ -d bin ]; then
	mkdir -p %{buildroot}%{_bindir}
	cp -ar bin/* %{buildroot}%{_bindir}
fi
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
cp -ra * %{buildroot}%{nodejs_sitelib}/%{packagename}
ln -sfr %{buildroot}%{nodejs_sitelib}/%{packagename}/bin/yarn.js %{buildroot}%{_bindir}/yarnpkg
ln -sfr %{buildroot}%{nodejs_sitelib}/%{packagename}/bin/yarn.js %{buildroot}%{_bindir}/yarn
pushd %{buildroot}
touch filelist.lst
find . -type f -printf "/%h/%f\n" >> filelist.lst
popd
cp %{buildroot}/filelist.lst .

%check
%nodejs_symlink_deps --check

%files  -f filelist.lst
%{_bindir}/yarnpkg
%{_bindir}/yarn

%changelog
* Thu Sep 09 2021 Nodejs_Bot <Nodejs_Bot@openeuler.org>
- Package Spec generated
