# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=ncftp
pkgver=3.2.6
pkgrel=1
pkgdesc="A set of free application programs implementing FTP"
url="http://www.ncftp.com/"
arch="all"
license="custom"
makedepends="ncurses-dev"
source="http://dev.alpinelinux.org/archive/ncftp/ncftp-$pkgver-src.tar.xz"
subpackages="$pkgname-doc $pkgname-bookmarks"

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

build () {
	cd "$builddir" || return 1

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		|| return 1

	cd "$builddir"/libncftp
	make shared || return 1
	cd "$builddir" || return 1
	make || return 1
}

package() {
	cd "$builddir"/libncftp
	make PREFIX="${pkgdir}"/usr soinstall || return 1
	cd "$builddir" || return 1
	make DESTDIR="$pkgdir" install || return 1
	install -D doc/LICENSE.txt \
		"$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE || return 1
}

bookmarks () {
	mkdir -p "$subpkgdir"/usr/bin || return 1
	mv "$pkgdir"/usr/bin/ncftpbookmarks \
		"$subpkgdir"/usr/bin/ || return 1
}

sha512sums="8e6091ce2ea1eb463edea322d1b5dde813475fd22096d67f0bfd2f5101ae09747ff25d38816d0b9b1077e6a5a256078361691f816aa2eefa38638aa523b4b382  ncftp-3.2.6-src.tar.xz"