28a8515
%if (0%{?fedora} && 0%{?fedora} < 40) || (0%{?rhel} && 0%{?rhel} < 10)
2b3430b
%bcond as_wget 0
28a8515
%else
28a8515
%bcond as_wget 1
28a8515
%endif
2b3430b
d5e55c2
%global somajor 2
c67783b
c67783b
Name:           wget2
d5e55c2
Version:        2.1.0
adc3f11
Release:        8%{?dist}
c67783b
Summary:        An advanced file and recursive website downloader
c67783b
c67783b
# Documentation is GFDL
077c4a2
License:        GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
c67783b
URL:            https://gitlab.com/gnuwget/wget2
c67783b
Source0:        https://ftp.gnu.org/gnu/wget/%{name}-%{version}.tar.gz
559867b
Source1:        https://ftp.gnu.org/gnu/wget/%{name}-%{version}.tar.gz.sig
559867b
# key 08302DB6A2670428
559867b
Source2:        tim.ruehsen-keyring.asc
c67783b
1c3ff29
# Backports from upstream
1c3ff29
## Fix behavior for downloading to stdin (rhbz#2257700, gl#gnuwget/wget2#651)
1c3ff29
Patch0001:      0001-src-log.c-log_init-Redirect-INFO-logs-to-stderr-with.patch
adc3f11
## Fix normalization of path part of URL (rhbz#2271362)
adc3f11
Patch0002:      0002-normalize-path-in-url.patch
1c3ff29
c67783b
# Buildsystem build requirements
c67783b
BuildRequires:  autoconf
c67783b
BuildRequires:  automake
c67783b
BuildRequires:  libtool
c67783b
BuildRequires:  flex-devel >= 2.5.35
c67783b
BuildRequires:  gettext >= 0.18.2
c67783b
BuildRequires:  gcc
c67783b
BuildRequires:  make
c67783b
c67783b
# Documentation build requirements
c67783b
BuildRequires:  doxygen
2b3430b
BuildRequires:  git-core
1222d2b
%if ! 0%{?rhel}
c67783b
BuildRequires:  pandoc
1222d2b
%endif
c67783b
c67783b
# Wget2 build requirements
c67783b
BuildRequires:  bzip2-devel
c67783b
BuildRequires:  python3
c67783b
BuildRequires:  rsync
c67783b
BuildRequires:  tar
c67783b
BuildRequires:  texinfo
c67783b
BuildRequires:  pkgconfig(gnutls)
c67783b
BuildRequires:  pkgconfig(gpgme)
c67783b
BuildRequires:  pkgconfig(libbrotlidec)
c67783b
## Not available yet
c67783b
#BuildRequires:  pkgconfig(libhsts)
c67783b
BuildRequires:  pkgconfig(libidn2) >= 0.14.0
c67783b
## Not available yet
c67783b
#BuildRequires:  pkgconfig(liblz)
c67783b
BuildRequires:  pkgconfig(liblzma)
c67783b
BuildRequires:  pkgconfig(libmicrohttpd)
c67783b
BuildRequires:  pkgconfig(libnghttp2)
c67783b
BuildRequires:  pkgconfig(libpcre2-8)
c67783b
BuildRequires:  pkgconfig(libpsl)
c67783b
BuildRequires:  pkgconfig(libzstd)
c67783b
BuildRequires:  pkgconfig(zlib)
c67783b
ee2f9d7
%if ! 0%{?rhel}
c67783b
# Test suite
c67783b
BuildRequires:  lcov
c67783b
BuildRequires:  lzip
ee2f9d7
%endif
c67783b
559867b
# For gpg signature verification
559867b
BuildRequires:  gnupg2
559867b
2b3430b
Provides:       webclient
c67783b
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
c67783b
c67783b
%description
c67783b
GNU Wget2 is the successor of GNU Wget, a file and recursive website
c67783b
downloader.
c67783b
c67783b
Designed and written from scratch it wraps around libwget, that provides the
c67783b
basic functions needed by a web client.
c67783b
c67783b
Wget2 works multi-threaded and uses many features to allow fast operation.
c67783b
In many cases Wget2 downloads much faster than Wget1.x due to HTTP2, HTTP
c67783b
compression, parallel connections and use of If-Modified-Since HTTP header.
c67783b
c67783b
%package libs
c67783b
Summary:        Runtime libraries for GNU Wget2
c67783b
# There's some gnulib in there :)
c67783b
Provides:       bundled(gnulib)
c67783b
c67783b
%description libs
c67783b
This package contains the libraries for applications to use
c67783b
Wget2 functionality.
c67783b
c67783b
%package devel
c67783b
Summary:        Libraries and header files needed for using wget2 libraries
c67783b
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
c67783b
c67783b
%description devel
c67783b
Development libraries and headers needed for building applications to
c67783b
use functionality from GNU Wget2.
c67783b
2b3430b
%if %{with as_wget}
2b3430b
%package wget
2b3430b
Summary:        %{name} shim to provide wget
35d0ba5
Requires:       wget2%{?_isa} = %{version}-%{release}
35d0ba5
# Replace wget
2b3430b
Conflicts:      wget < 2
2b3430b
Obsoletes:      wget < 2
2b3430b
Provides:       wget = %{version}-%{release}
2b3430b
Provides:       wget%{?_isa} = %{version}-%{release}
2b3430b
# From original wget package
2b3430b
Provides:       webclient
2b3430b
2b3430b
%description wget
2b3430b
This package provides the shim links for %{name} to be automatically
2b3430b
used in place of wget. This ensures that %{name} is used as
2b3430b
the system provider of wget.
2b3430b
%endif
2b3430b
c67783b
%prep
559867b
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
c67783b
%autosetup -p1
c67783b
c67783b
c67783b
%build
c67783b
%configure --disable-static
ee2f9d7
%if ! 0%{?rhel}
ee2f9d7
# Remove RPATH, rely on default -Wl,--enable-new-dtags in Fedora.
c67783b
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
c67783b
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
ee2f9d7
%endif
c67783b
%make_build
c67783b
c67783b
c67783b
%install
c67783b
%make_install
c67783b
%find_lang %{name}
c67783b
1222d2b
%if 0%{?rhel}
1222d2b
# tarball includes a pre-built manpage
1222d2b
install -D -m0644 -t %{buildroot}%{_mandir}/man1/ docs/man/man1/wget2.1
1222d2b
%endif
1222d2b
c67783b
# Purge all libtool archives
c67783b
find %{buildroot} -type f -name "*.la" -delete -print
c67783b
d5e55c2
# Delete useless noinstall binary
d5e55c2
rm -v %{buildroot}%{_bindir}/%{name}_noinstall
d5e55c2
2b3430b
%if %{with as_wget}
2b3430b
ln -sr %{buildroot}%{_bindir}/%{name} %{buildroot}%{_bindir}/wget
2b3430b
# Link wget(1) to wget2(1)
2b3430b
echo ".so man1/%{name}.1" > %{buildroot}%{_mandir}/man1/wget.1
2b3430b
%endif
c67783b
c67783b
%check
c67783b
%make_build check
c67783b
c67783b
c67783b
%files -f %{name}.lang
c67783b
%license COPYING*
c67783b
%doc README.md
c67783b
%{_bindir}/%{name}
d5e55c2
%{_mandir}/man1/%{name}.1*
c67783b
c67783b
%files libs
c67783b
%license COPYING*
c67783b
%{_libdir}/libwget*.so.%{somajor}{,.*}
c67783b
c67783b
%files devel
c67783b
%{_includedir}/wget.h
c67783b
%{_includedir}/wgetver.h
c67783b
%{_libdir}/libwget*.so
c67783b
%{_libdir}/pkgconfig/libwget.pc
d5e55c2
%{_mandir}/man3/libwget*.3*
c67783b
2b3430b
%if %{with as_wget}
2b3430b
%files wget
2b3430b
%{_bindir}/wget
2b3430b
%{_mandir}/man1/wget.1*
2b3430b
%endif
2b3430b
2b3430b
c67783b
%changelog
adc3f11
* Tue Apr 02 2024 Michal Ruprich <mruprich@redhat.com> - 2.1.0-8
adc3f11
- Resolves: #2271362 - wget2 blacklists files intended for download
adc3f11
39fd106
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-7
39fd106
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
39fd106
1c3ff29
* Sun Jan 14 2024 Neal Gompa <ngompa@fedoraproject.org> - 2.1.0-6
1c3ff29
- Backport fix for wget to stdin
1c3ff29
  Resolves: rhbz#2257700
1c3ff29
73672e4
* Thu Jan 04 2024 Yaakov Selkowitz <yselkowi@redhat.com> - 2.1.0-5
73672e4
- Drop unused autogen build dependency
73672e4
1222d2b
* Thu Dec 21 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 2.1.0-4
1222d2b
- Avoid pandoc dependency on RHEL
1222d2b
- Fix tests on RHEL
1222d2b
28a8515
* Sat Dec 16 2023 Neal Gompa <ngompa@fedoraproject.org> - 2.1.0-3
28a8515
- Enable wget2-wget for F40+ / RHEL10+
28a8515
559867b
* Fri Sep 01 2023 Mikel Olasagasti Uranga <mikel@olasagasti.info> - 2.1.0-2
559867b
- Add gpg signature check
559867b
d5e55c2
* Fri Sep 01 2023 Neal Gompa <ngompa@fedoraproject.org> - 2.1.0-1
d5e55c2
- New upstream version
2b3430b
- Add conditional for using wget2 as wget
d5e55c2
a28dc76
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-6
a28dc76
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
a28dc76
077c4a2
* Tue Mar 21 2023 Michal Ruprich <mruprich@redhat.com> - 2.0.0-5
077c4a2
- SPDX migration
077c4a2
200d4ae
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-4
200d4ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
200d4ae
92ea17b
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-3
92ea17b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
92ea17b
e3b07e2
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-2
e3b07e2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
e3b07e2
c67783b
* Sun Sep 26 2021 Neal Gompa <ngompa@fedoraproject.org> - 2.0.0-1
c67783b
- Rebase to 2.0.0 final
c67783b
- Split out libraries into libs subpackage
c67783b
- Delete unwanted static subpackage
c67783b
c67783b
* Wed Apr  1 2020 Anna Khaitovich <akhaitov@redhat.com> - 1.99.2-1
c67783b
- Initial package
c67783b