DESCRIPTION="powerful replacement for inetd" 
HOMEPAGE="http://www.xinetd.org/" 
SRC_URI="http://www.xinetd.org/xinetd-2.3.14.tar.gz"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
CHECKSUM_MD5="567382d7972613090215c6c54f9b82d9"
BUILD()
{
	cd xinetd-2.3.14

	# if we don't have rpc/rpc.h then why does it still try to use it??
	# let's change the #ifndef NO_RPC to #ifdef HAVE_RPC_RPC
	sed -i 's/ndef NO_RPC/def HAVE_RPC_RPC/g' xinetd/*.c

	# workaround while (SIGBUS == SIGSEGV) on HAIKU
	sed -i 's/case SIGBUS:/\n/g' xinetd/signals.c
	
	# save rlim_t
	sed -i 's/XINETD_CHECK_TYPE(rlim_t/dnl XINETD_CHECK_TYPE(rlim_t/' configure.in

	libtoolize --force --copy --install
	aclocal
	autoconf
	mkdir -p ${DESTDIR}/`finddir B_COMMON_BIN_DIRECTORY`
	mkdir -p ${DESTDIR}/`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man/man5
	mkdir -p ${DESTDIR}/`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man/man8
	./configure --prefix=`finddir B_COMMON_DIRECTORY` \
		--sbindir=`finddir B_COMMON_BIN_DIRECTORY` \
		--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
	make
}

INSTALL()
{
	cd xinetd-2.3.14
	mkdir -p ${DESTDIR}/`finddir B_COMMON_BIN_DIRECTORY`
	mkdir -p ${DESTDIR}/`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man/man5
	mkdir -p ${DESTDIR}/`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man/man8
	make install DESTDIR=${DESTDIR}
}

LICENSE="Xinetd"
COPYRIGHT="1992 by Panagiotis Tsirigotis
	1998-2001 by Rob Braun"
