# Contributor: Sergei Lukin <sergej.lukin@gmail.com>
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=wget
pkgver=1.19.4
pkgrel=1
pkgdesc="A network utility to retrieve files from the Web"
url="https://www.gnu.org/software/wget/wget.html"
arch="all"
license="GPL-3.0-or-later"
depends=""
makedepends="libressl-dev perl"
checkdepends="perl-http-daemon"
subpackages="$pkgname-doc"
install=""
source="ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz "
builddir="$srcdir/$pkgname-$pkgver"

# secfixes:
#   1.19.1-r1:
#   - CVE-2017-6508
#   1.19.2-r0:
#   - CVE-2017-13090

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--with-ssl=openssl \
		--disable-nls
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install

	rm -rf "$pkgdir"/usr/lib
}

sha512sums="e84b0c40235b160ade69e18f2f139c782eb2387edc97a847c11dbb906c0273daf6d0ef5afe20360ba965c7da8b5e109f5a45e39ea93d20ec945575203235943a  wget-1.19.4.tar.gz"
