# Description: Basic networking utilities
# URL: https://github.com/iputils/iputils
# Maintainer: CRUX System Team, core-ports at crux dot nu
# Depends on: libcap meson ninja openssl

name=iputils
version=20240117
release=1
source=(https://github.com/iputils/iputils/archive/$version/$name-$version.tar.gz)

build() {
	meson setup build $name-$version \
		--prefix=/usr \
		--buildtype=plain \
		--wrap-mode nodownload \
		-D b_lto=true \
		-D b_pie=true \
		-D BUILD_MANS=false \
		-D SKIP_TESTS=true

	meson compile -C build -j ${JOBS:-1}

	install -d $PKG/{{sbin,bin},usr/{bin,sbin}}
	install build/ping/ping $PKG/bin/
	install build/arping $PKG/sbin/
	install build/{tracepath,clockdiff} $PKG/usr/sbin/

	chmod u+s $PKG/bin/ping
}
