# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=lftp
pkgver=4.8.3
pkgrel=1
pkgdesc="LFTP is sophisticated ftp/http client"
url="http://lftp.tech/"
arch="all"
license="GPL"
makedepends="zlib-dev libressl-dev readline-dev ncurses-dev"
subpackages="$pkgname-doc"
source="http://lftp.yar.ru/ftp/$pkgname-$pkgver.tar.xz"

builddir="$srcdir"/$pkgname-$pkgver

build() {
	cd "$builddir"

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--with-openssl \
		--with-threads=posix \
		--with-modules \
		--disable-nls \
		--disable-static
	make
}

package() {
	cd "$builddir"
	make -j1 install DESTDIR="$pkgdir"
	rm -f "$pkgdir"/usr/lib/charset.alias
	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	mv "$pkgdir"/usr/share/$pkgname "$pkgdir"/usr/share/doc/
}

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

sha512sums="16d0ddc36ac00db009fd4e634a2eaa575bd1c690ea7e1af396317ccc677704d2a4dfa19ea0c46dab83450072714086ed2b15ac00ffe51ec5c9bb900e5e744583  lftp-4.8.3.tar.xz"
