# Prerequisites:
# libc's iconv or libiconv
# flex >= 2.5.35
# gettext >= 0.18.2
# doxygen (for creating the docs)
# pandoc (for the man page)
# pkg-config >= 0.28 recommended
# gnutls 3.3, 3.5, or 3.6 or WolfSSL
# gnutls' libgnutls-dane (optional; for DANE support)
# libpsl >= 0.5.0
# libhsts (optional; for HSTS preload lists)
# libnghttp2 >= 1.3.0 (optional; for HTTP/2 support)
# gpgme >= 0.4.2
# zlib >= 1.2.3
# Brotli >= 1.0.0 (optional; for HTTP brotli decompression)
# XZ Utils' liblzma >= 5.1.1alpha (optional; for lzma decompression)
# libidn2 >= 0.14 (libidn >= 1.25 if you don't have libidn2)
# libpcre | libpcre2 (optional, for filtering by PCRE|PCRE2 regex)
# libmicrohttpd >= 0.9.51 (optional, for the test suite)
# Python (recommended)
# rsync
# tar
# texinfo makeinfo
# libbz2 >= 1.0.6 (optional; for HTTP bzip2 decompression)
# liblz (optional)
# Zstandard's libzstd >= 1.3.0 (optional, if you want HTTP zstd decompression)
# lzip (optional, for distribution tarballs)
# liblz (optional, for HTTP lzip decompression)
# lcov (optional, for coverage reports)
# Get the source
cd
test -f installed/wget2-2.1.0.tar.lz &&
mv -f installed/wget2-2.1.0.tar.lz .
test ! -f wget2-2.1.0.tar.lz &&
wget https://ftpmirror.gnu.org/wget/wget2-2.1.0.tar.lz
# Extract the source
# (tar xzf will probably figure it out even though it's not gzip...)
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "wget2-*" -exec rm -r {} \;
tar --lzip -xvf ~/wget2-2.1.0.tar.lz
cd wget2-2.1.0
test $UID = 0 && chown -R root:root .
# If you want HTTP bzip2 decompression, add --with-bzip2
# If you want HTTP lzma (xz) decompression, add --with-lzma
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --mandir=/usr/man
# Build it
make
# Check the build
make check
# Become root to install it
su
# Install it
make install
ldconfig
# Become your non-root user again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/wget2-*.tar.*
mv wget2-2.1.0.tar.lz installed/
# If you ever want to uninstall wget2, this should do it:
cd
su
test -d src/wget2-* && ( cd src/wget2-* ; make uninstall )
( cd /usr/bin ; rm -f wget2 wget2_noinstall )
( cd /usr/include ; rm -f wget.h wgetver.h )
( cd /usr/lib
rm -f libwget.* pkgconfig/libwget.pc )
test -d /usr/lib64 &&
( cd /usr/lib64
rm -f libwget.* pkgconfig/libwget.pc )
( cd /usr/man/man3 ; rm -f libwget-*.3 )
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "wget2-*" -exec rm -r {} \;
rm -f ~/installed/wget2-*.tar.*