# - add --delete-remote patches:
# - http://wget-bugs.ferrara.linux.it/issue9
# - or http://osdir.com/ml/web.wget.patches/2005-09/msg00006.html
+# - add http://article.gmane.org/gmane.comp.web.wget.patches/2333
+#
+# Conditional build:
+%bcond_without tests # check target
+%bcond_without metalink # build without metalink support
+%bcond_with gnutls # use GnuTLS (wget default) instead of OpenSSL
+
Summary: A utility for retrieving files using the HTTP or FTP protocols
Summary(es.UTF-8): Cliente en línea de comando para bajar archivos WWW/FTP con recursión opcional
Summary(fr.UTF-8): Un utilitaire pour recuperer des fichiers en utilisant les protocoles HTTP ou FTP
Summary(uk.UTF-8): Утиліта для отримання файлів по протоколам HTTP та FTP
Summary(zh_CN.UTF-8): [通讯]功能强大的下载程序,支持断点续传
Name: wget
-Version: 1.11.1
+Version: 1.20.1
Release: 2
-License: GPL v3+
+License: GPL v3+ with OpenSSL exception
Group: Networking/Utilities
-Source0: http://ftp.gnu.org/gnu/wget/%{name}-%{version}.tar.gz
-# Source0-md5: 9ce16ff30a236e474e3c19d988e1f119
+Source0: http://ftp.gnu.org/gnu/wget/%{name}-%{version}.tar.lz
+# Source0-md5: 183af2e886e42aa501d3e6f3992b3344
Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
# Source1-md5: d8b2b56ec7461606c22edbafaf8a418f
Patch0: %{name}-info.patch
-Patch1: %{name}-ac.patch
-Patch2: %{name}-pl.patch
-Patch3: %{name}-wgetrc_path.patch
-Patch4: %{name}-home_etc.patch
-Patch5: %{name}-noabort.patch
-URL: http://wget.sunsite.dk/
-BuildRequires: autoconf >= 2.59
-BuildRequires: automake
-BuildRequires: gettext-devel
-BuildRequires: libtool
-BuildRequires: openssl-devel >= 0.9.7m
-BuildRequires: texinfo
+Patch1: %{name}-wgetrc_path.patch
+Patch2: %{name}-home_etc.patch
+Patch3: %{name}-ssl-certs.patch
+Patch4: user.xdg.origin.url.patch
+URL: http://www.gnu.org/software/wget/
+BuildRequires: autoconf >= 2.63
+BuildRequires: automake >= 1:1.9
+BuildRequires: gettext-tools >= 0.19.8
+# >= 3.6.3 for TLSv1.3
+%{?with_gnutls:BuildRequires: gnutls-devel >= 3.0.16}
+%{?with_metalink:BuildRequires: gpgme-devel >= 0.4.2}
+BuildRequires: libidn2-devel
+%{?with_metalink:BuildRequires: libmetalink-devel}
+BuildRequires: libpsl-devel >= 0.16.0
+BuildRequires: libuuid-devel
+# >= 1.1.0 for TLSv1.3
+%{!?with_gnutls:BuildRequires: openssl-devel >= 1.0.1}
+BuildRequires: pcre2-8-devel
BuildRequires: perl-devel
+BuildRequires: pkgconfig
+BuildRequires: tar >= 1:1.22
+BuildRequires: texinfo
+BuildRequires: xz
+BuildRequires: zlib-devel
+%if %{with tests}
+BuildRequires: perl-HTTP-Daemon
+BuildRequires: perl-HTTP-Message
+BuildRequires: perl-IO-Socket-SSL
+BuildRequires: python3-modules >= 1:3.0
+%endif
Provides: webclient
+%{?with_gnutls:Requires: gnutls-libs >= 3.0.16}
+%{!?with_gnutls:Requires: openssl >= 1.0.1}
+Requires: libpsl >= 0.16.0
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _noautoreqfiles %{_bindir}/rmold
%patch2 -p1
%patch3 -p1
%patch4 -p1
-%patch5 -p1
-rm -f doc/wget.info doc/sample.wgetrc.munged_for_texi_inclusion
+
+%{__rm} doc/wget.info doc/sample.wgetrc.munged_for_texi_inclusion po/stamp-po
+
+# temp hack for 1.13.4
+test -e build-aux/bzr-version-gen || cat <<EOF > build-aux/bzr-version-gen
+#!/bin/sh
+echo -n %{version}
+EOF
+chmod +x build-aux/bzr-version-gen
%build
-%{__libtoolize}
%{__gettextize}
%{__aclocal} -I m4
%{__autoheader}
%{__autoconf}
+%{__automake}
%configure \
- --with-ssl
+ --enable-digest \
+ --enable-ipv6 \
+ --enable-iri \
+ --enable-largefile \
+ --enable-nls \
+ --enable-ntlm \
+ --enable-opie \
+ --enable-pcre \
+ --disable-silent-rules \
+ --with-libpsl \
+ %{__with_without metalink} \
+ --with-ssl%{!?with_gnutls:=openssl} \
+ --with-zlib \
+ %{nil}
%{__make}
tail -n 6 util/README >rmold.README
+# 1.13.4 tarball was buggy and produced empty version.
+grep %{version} src/version.c
+
+%{?with_tests:%{__make} check}
+
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_sysconfdir}
DESTDIR=$RPM_BUILD_ROOT \
GETTEXT_PACKAGE=wget
-install util/rmold.pl $RPM_BUILD_ROOT%{_bindir}/rmold
-install doc/sample.wgetrc $RPM_BUILD_ROOT%{_sysconfdir}/wgetrc
+install -p util/rmold.pl $RPM_BUILD_ROOT%{_bindir}/rmold
+cp -a doc/sample.wgetrc $RPM_BUILD_ROOT%{_sysconfdir}/wgetrc
bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
-rm -f $RPM_BUILD_ROOT%{_mandir}/README*
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/README*
+rm -f $RPM_BUILD_ROOT%{_infodir}/dir
%find_lang %{name}
%defattr(644,root,root,755)
%doc AUTHORS ChangeLog NEWS README MAILING-LIST rmold.README
%verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/%{name}rc
-%attr(755,root,root) %{_bindir}/*
-%{_mandir}/man1/*
-%lang(hu) %{_mandir}/hu/man1/*
-%lang(pl) %{_mandir}/pl/man1/*
-%{_infodir}/*.info*
+%attr(755,root,root) %{_bindir}/rmold
+%attr(755,root,root) %{_bindir}/wget
+%{_mandir}/man1/wget.1*
+%{_mandir}/hu/man1/wget.1*
+%{_mandir}/pl/man1/wget.1*
+%{_infodir}/wget.info*