# Template file for 'tftp-hpa'
pkgname=tftp-hpa
version=5.2
revision=6
build_style=gnu-configure
configure_args="--sbindir=/usr/bin --without-tcpwrappers"
hostmakedepends="automake"
makedepends="readline-devel"
short_desc="Official tftp client and server"
maintainer="Orphaned <orphan@voidlinux.org>"
license="BSD-3-Clause"
homepage="http://www.kernel.org"
distfiles="http://www.kernel.org/pub/software/network/tftp/${pkgname}/${pkgname}-${version}.tar.gz"
checksum=acc04dde662491e3092565ecf9bde504c47dbb1bb0408366009b138fe7754cab

make_dirs="/var/lib/tftp 0750 nobody nogroup"
alternatives="
 tftp:tftp:/usr/bin/${pkgname}
 tftp:tftp.1:/usr/share/man/man1/${pkgname}.1
 tftp:tftpd.8:/usr/share/man/man8/in.tftpd.8
 "

CFLAGS="-fcommon"

do_install() {
	make INSTALLROOT=${DESTDIR} install
	mv ${DESTDIR}/usr/bin/{tftp,${pkgname}}
	mv ${DESTDIR}/usr/share/man/man1/{tftp,${pkgname}}.1
	rm -f ${DESTDIR}/usr/share/man/man8/tftpd.8
	sed -n '/Copyright (c)/,/SUCH DAMAGE\./p' tftpd/tftpd.c >LICENSE
	vlicense LICENSE
	vsv tftpd-hpa
}
