From 2b3430b51332f93efb8de5e096955db35a4d3e9c Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 1 Sep 2023 09:20:58 -0400 Subject: [PATCH] Add conditional for using wget2 as wget --- wget2.spec | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/wget2.spec b/wget2.spec index a92331b..d2c057c 100644 --- a/wget2.spec +++ b/wget2.spec @@ -1,3 +1,5 @@ +%bcond as_wget 0 + %global somajor 2 Name: wget2 @@ -22,6 +24,7 @@ BuildRequires: make # Documentation build requirements BuildRequires: doxygen +BuildRequires: git-core BuildRequires: pandoc # Wget2 build requirements @@ -50,6 +53,7 @@ BuildRequires: pkgconfig(zlib) BuildRequires: lcov BuildRequires: lzip +Provides: webclient Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description @@ -80,6 +84,22 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} Development libraries and headers needed for building applications to use functionality from GNU Wget2. +%if %{with as_wget} +%package wget +Summary: %{name} shim to provide wget +Conflicts: wget < 2 +Obsoletes: wget < 2 +Provides: wget = %{version}-%{release} +Provides: wget%{?_isa} = %{version}-%{release} +# From original wget package +Provides: webclient + +%description wget +This package provides the shim links for %{name} to be automatically +used in place of wget. This ensures that %{name} is used as +the system provider of wget. +%endif + %prep %autosetup -p1 @@ -102,6 +122,11 @@ find %{buildroot} -type f -name "*.la" -delete -print # Delete useless noinstall binary rm -v %{buildroot}%{_bindir}/%{name}_noinstall +%if %{with as_wget} +ln -sr %{buildroot}%{_bindir}/%{name} %{buildroot}%{_bindir}/wget +# Link wget(1) to wget2(1) +echo ".so man1/%{name}.1" > %{buildroot}%{_mandir}/man1/wget.1 +%endif %check %make_build check @@ -124,9 +149,17 @@ rm -v %{buildroot}%{_bindir}/%{name}_noinstall %{_libdir}/pkgconfig/libwget.pc %{_mandir}/man3/libwget*.3* +%if %{with as_wget} +%files wget +%{_bindir}/wget +%{_mandir}/man1/wget.1* +%endif + + %changelog * Fri Sep 01 2023 Neal Gompa - 2.1.0-1 - New upstream version +- Add conditional for using wget2 as wget * Sat Jul 22 2023 Fedora Release Engineering - 2.0.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild