# Template file for 'iputils'
pkgname=iputils
version=20151218
revision=3
patch_args="-Np1"
wrksrc="${pkgname}-s${version}"
makedepends="libressl-devel libcap-devel"
depends="libcap-progs"
short_desc="IP Configuration Utilities (and ping)"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="GPL-2, BSD"
homepage="http://www.skbuff.net/iputils"
distfiles="http://www.skbuff.net/iputils/${pkgname}-s${version}.tar.bz2"
checksum=549f58d71951e52b46595829134d4e330642f522f50026917fadc349a54825a1

alternatives="
 ping:ping:/usr/bin/${pkgname}-ping
 ping:ping.8:/usr/share/man/man8/${pkgname}-ping.8
 ping6:ping6:/usr/bin/${pkgname}-ping6
 ping6:ping6.8:/usr/share/man/man8/${pkgname}-ping6.8"

do_build() {
	make CC="$CC" LD="$LD" CCOPTOPT="$CFLAGS" LDFLAGS="$LDFLAGS" \
		USE_GNUTLS=no USE_GCRYPT=no ${makejobs} \
		arping clockdiff ping ping6 rdisc tracepath tracepath6
}

do_install() {
	for f in ping ping6; do
		vbin ${f} ${pkgname}-${f}
	done
	for f in clockdiff arping rdisc tracepath tracepath6; do
		vbin ${f}
	done
	for f in clockdiff arping ping rdisc tracepath; do
		vman doc/${f}.8
	done
	mv ${DESTDIR}/usr/share/man/man8/{ping,${pkgname}-ping}.8
	ln -s ${pkgname}-ping.8 ${DESTDIR}/usr/share/man/man8/${pkgname}-ping6.8
	ln -s tracepath.8 ${DESTDIR}/usr/share/man/man8/tracepath6.8
}
