# Description: Server that converts RPC program numbers into universal addresses
# URL: https://sourceforge.net/projects/rpcbind/
# Maintainer: Juergen Daubert, jue at crux dot nu
# Depends on: libtirpc

name=rpcbind
version=1.2.6
release=2
source=(https://downloads.sourceforge.net/project/$name/$name/$version/$name-$version.tar.bz2 \
	rpcbind)

build() {
	cd $name-$version

	# use sunrpc instead of rpcbind as service-name
	sed '/servname\[\]/s/rpcbind/sunrpc/' -i src/rpcbind.c
	sed 's|/var/run|/run/rpcbind|' -i src/rpcbind.c

	./configure \
		--prefix=/usr \
		--sbindir=/sbin \
		--with-statedir=/run/rpcbind \
		--disable-libwrap \
		--without-systemdsystemunitdir

	make
	make DESTDIR=$PKG install

	install -D -m 755 $SRC/rpcbind $PKG/etc/rc.d/rpcbind
}
