url="https://www.kernel.org/pub/linux/utils/net/iproute2/"
description="Programs for basic and advanced network routing."

packager="spiky <spiky@nutyx.org>"
contributors="Pierre,<Tnut@Nutyxdot,Tnut"

makedepends=(libcap bison flex)

name=iproute2
version=6.1.0

PKGMK_GROUPS=(devel man doc)

source=($url/iproute2-$version.tar.xz)

build()
{
cd iproute2-$version
sed -i /ARPD/d Makefile
sed -i 's/arpd.8//' man/man8/Makefile

# disable building one module that requires iptables
sed -i 's/m_ipt.o//' tc/Makefile

make MANDIR=/usr/share/man INFODIR=/usr/share/info \
	SBINDIR=/bin DESTDIR=$PKG
make MANDIR=/usr/share/man SBINDIR=/bin \
	INFODIR=/usr/share/info DESTDIR=$PKG \
     DOCDIR=/usr/share/doc/iproute2-$version install
}
devel()
{
cd $PKG
bsdtar -cf \
$PKGMK_PACKAGE_DIR/${name}.devel${PKGMK_BUILDVER}any.$PKGMK_PACKAGE_EXT \
usr/lib

rm -r usr/lib
}
