add wget 1.19.2
[dragora.git] / recipes / networking / wget / recipe
blobc1a4db7397186bd5b5b2ec0024ceb8b0ce8f4afc
1 # Build recipe for wget.
3 # Copyright (C) 2017 Matias A. Fonzo, selk@dragora.org.
5 # This recipe is free software: you have unlimited permission
6 # to copy, distribute and modify it.
8 program=wget
9 version=1.19.2
10 release=1
12 tarname=${program}-${version}.tar.gz
14 # Remote source(s)
15 fetch=ftp://ftp.gnu.org/gnu/wget/$tarname
17 description="
18 The non-interactive network downloader.
20 GNU Wget is a free software package for retrieving files using HTTP,
21 HTTPS, FTP and FTPS the most widely-used Internet protocols.  It is a
22 non-interactive commandline tool, so it may easily be called from
23 scripts, cron jobs, terminals without X-Windows support, etc.
26 homepage=http://www.gnu.org/software/wget
27 license=GPLv3+
29 # Source documentation
30 docs="AUTHORS COPYING ChangeLog NEWS README"
31 docsdir="${docdir}/${program}-${version}"
33 build()
35     set -e
37     unpack "${tardir}/$tarname"
39     cd "$srcdir"
41     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
42      $configure_args \
43      --libdir=/usr/lib${libSuffix} \
44      --infodir=$infodir \
45      --mandir=$mandir \
46      --enable-metalink \
47      --enable-threads=posix \
48      --with-ssl=openssl \
49      --build="$(cc -dumpmachine)"
51     make -j${jobs} V=1
52     make -j${jobs} DESTDIR="$destdir" install
54     # To handle config file on post-installation
55     touch "${destdir}/etc/.graft-config"
57     # Remove generated charset.alias
58     rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
59     rmdir "${destdir}/usr/lib${libSuffix}" || true
61     # Compress info documents deleting index file for the package
62     if test -d "${destdir}/$infodir"
63     then
64         rm -f "${destdir}/${infodir}/dir"
65         lzip -9 "${destdir}/${infodir}"/*
66     fi
68     # Compress and link man pages (if needed)
69     if test -d "${destdir}/$mandir"
70     then
71         (
72             cd "${destdir}/$mandir"
73             find . -type f -exec lzip -9 '{}' +
74             find . -type l | while read -r file
75             do
76                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
77                 rm -- "$file"
78             done
79         )
80     fi
82     # Copy documentation
83     mkdir -p "${destdir}${docsdir}"
84     cp -p $docs "${destdir}${docsdir}"