From 8522ecf489342e88a6113ee93c6f3a8a2cd99774 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Dec 06 2019 20:15:47 +0000 Subject: Rename nodejs-yarn binary package to yarnpkg (similar to other distros) - Use nodejs macros consistently throughout spec - Make the tests fail the build if the tests fail --- diff --git a/nodejs-yarn.spec b/nodejs-yarn.spec index f0e1c5a..1e63489 100644 --- a/nodejs-yarn.spec +++ b/nodejs-yarn.spec @@ -8,13 +8,13 @@ %global enable_tests 1 # don't require bundled modules -%global __requires_exclude_from ^%{_prefix}/lib/node_modules/yarn/.*$ +%global __requires_exclude_from ^%{nodejs_sitelib}/yarn/.*$ Name: nodejs-yarn Version: 1.13.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Fast, reliable, and secure dependency management. -Url: https://github.com/yarnpkg/yarn +URL: https://github.com/yarnpkg/yarn # we need tarball with node_modules Source0: %{npm_name}-v%{version}-bundled.tar.gz Source1: yarn-tarball.sh @@ -27,11 +27,21 @@ ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging BuildRequires: npm -Requires: nodejs %description Fast, reliable, and secure dependency management. +%package -n yarnpkg +Summary: Fast, reliable, and secure dependency manager for JavaScript +Requires: nodejs +# Package was renamed when Fedora 32 was rawhide +# Don't remove this before Fedora 34 +Obsoletes: %{name} < 1.13.0-4 +Provides: %{name} = %{version}-%{release} + +%description -n yarnpkg +Yarn is a fast, reliable, and secure dependency manager for JavaScript. + %prep %setup -q -n %{npm_name}-%{version} @@ -51,8 +61,8 @@ cp -pr package.json lib bin node_modules \ %{buildroot}%{nodejs_sitelib}/%{npm_name} mkdir -p %{buildroot}%{_bindir} -ln -sf ../lib/node_modules/yarn/bin/yarn.js %{buildroot}%{_bindir}/nodejs-yarn -ln -sf ../lib/node_modules/yarn/bin/yarn.js %{buildroot}%{_bindir}/yarnpkg +ln -sfr %{buildroot}%{nodejs_sitelib}/%{npm_name}/bin/yarn.js %{buildroot}%{_bindir}/yarnpkg +ln -sfr %{buildroot}%{nodejs_sitelib}/%{npm_name}/bin/yarn.js %{buildroot}%{_bindir}/%{fc_name} # Remove executable bits from bundled dependency tests find %{buildroot}%{nodejs_sitelib}/%{npm_name}/node_modules \ @@ -64,19 +74,24 @@ find %{buildroot}%{nodejs_sitelib}/%{npm_name}/node_modules \ %if 0%{?enable_tests} %check %nodejs_symlink_deps --check -if [[ $(%{buildroot}/%{_bindir}/nodejs-yarn --version) == %{version} ]] ; then echo PASS; else echo FAIL; fi -if [[ $(%{buildroot}/%{_bindir}/yarnpkg --version) == %{version} ]] ; then echo PASS; else echo FAIL; fi +if [[ $(%{buildroot}%{_bindir}/yarnpkg --version) == %{version} ]] ; then echo PASS; else echo FAIL && exit 1; fi +if [[ $(%{buildroot}%{_bindir}/%{fc_name} --version) == %{version} ]] ; then echo PASS; else echo FAIL && exit 1; fi %endif -%files -%{nodejs_sitelib}/yarn -%{_bindir}/nodejs-yarn -%{_bindir}/yarnpkg +%files -n yarnpkg %doc README.md README.Fedora.md %license LICENSE +%{_bindir}/yarnpkg +%{_bindir}/%{fc_name} +%{nodejs_sitelib}/%{npm_name} %changelog +* Thu Dec 05 2019 Neal Gompa - 1.13.0-4 +- Rename nodejs-yarn binary package to yarnpkg (similar to other distros) +- Use nodejs macros consistently throughout spec +- Make the tests fail the build if the tests fail + * Thu Jul 25 2019 Fedora Release Engineering - 1.13.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild