# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=inetutils-syslogd
_pkgname=inetutils
pkgver=2.5
pkgrel=0
pkgdesc="A small syslogd for logging to multiple files"
url="https://www.gnu.org/software/inetutils/"
arch="all"
license="GPL-3.0-or-later"
makedepends="readline-dev ncurses-dev"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://ftp.gnu.org/gnu/inetutils/$_pkgname-$pkgver.tar.xz
	$pkgname.initd
	$pkgname.confd
	syslog.conf
	$pkgname.logrotate
	$pkgname.setup
	"

builddir="$srcdir"/$_pkgname-$pkgver

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--libexec=/usr/sbin \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--without-wrap --without-pam \
		--disable-ftp --disable-ftpd \
		--disable-telnet --disable-telnetd \
		--disable-talk --disable-talkd \
		--disable-rlogin --disable-rlogind \
		--disable-rsh --disable-rshd \
		--disable-rexec --disable-rexecd \
		--disable-rcp --disable-hostname \
		--disable-tftp --disable-tftpd \
		--disable-ping --disable-ping6 \
		--disable-logger --enable-syslogd \
		--disable-inetd --disable-whois --disable-dnsdomainname \
		--disable-uucpd --disable-ifconfig --disable-traceroute
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	#install init script & config defaults
	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
	install -m644 -D "$srcdir"/syslog.conf \
		"$pkgdir"/etc/syslog.conf
	install -m644 -D "$srcdir"/inetutils-syslogd.logrotate \
		"$pkgdir"/etc/logrotate.d/inetutils-syslogd
	install -m755 -D "$srcdir"/inetutils-syslogd.setup \
		"$pkgdir"/sbin/setup-inetutils-syslogd
	mkdir -p "$pkgdir/usr/share/apk-tools/$pkgname"
}

sha512sums="
dc11ad6eeb5ea2c85edddbfc77630b5b09e4e1ac643629edf13b0ac0828c13cdb0885275153c072ae13a798427c96bc461037822ad646f7210369192c35bb04c  inetutils-2.5.tar.xz
75d5681d08a391956e0f0510eadb20c3ba74de4026f76ea0a54c3e34bb53655ff6cbe3087c0953343fdef3b05864a4dc7d9d12ed26836f8986859868f0076c79  inetutils-syslogd.initd
82968692b4fe79706aacaeb1021b343288dc4f1d86925481796dac1f743a8269976ce86bf446cd0c16d246b918e5822e312660b201407eb7031a17cb398c9513  inetutils-syslogd.confd
d9c61aee1a3f2c7cf7b06dfda08599c08f1f618ba092e60adff11e9cbe5be847544780eaa9e4bb54a70c5e5bc243fed3d6ff8111878f073b41629db4245b135c  syslog.conf
ffe2b1fd6b9d4dc9e378f0c857be318ec86e48aee17ede865656bdf9a5da3d2f3a8ffe788cd62794132839577ab6ce1ce7fe3a964bc21e0f8b698827a9ee5817  inetutils-syslogd.logrotate
a3c54be2c2154adec3b5d8cf68e43f274eb42ac2e02f3ea39235a11f333d1cc88ea2d0af93daf5095c8de7dfbbc147c53d97bbfce3944f50858ee97907270bf7  inetutils-syslogd.setup
"
