pkgname=ffingerd
pkgver=1.28
pkgrel=5
pkgdesc="secure finger daemon"
arch=('i686' 'x86_64' 'armv7h')
url="http://www.fefe.de/ffingerd/"
license=('GPL2')
depends=('glibc' 'xinetd')
backup=('etc/xinetd.d/ffinger')
source=(http://www.fefe.de/$pkgname/$pkgname-$pkgver.tar.bz2
        finger.xinetd)
md5sums=('fe207448745da07b4e393d8b8694658b'
         '2ca1a6b3f442a5c0c81fa03d265a203e')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"
  install -dm755 "$pkgdir/usr/bin" "$pkgdir/usr/share/man/man8"

  echo "ac_cv_header_sys_syslog_h=yes" >>config.cache
  echo "ac_cv_header_arpa_inet_h=yes" >>config.cache
  echo "ac_cv_header_sys_errno_h=yes" >>config.cache
}

build() {
  cd "$srcdir/$pkgname-$pkgver"
  ./configure --prefix=/usr

  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  make SBINDIR="$pkgdir/usr/bin" MANDIR="$pkgdir/usr/share/man" install
  install -D -m644 "$srcdir/finger.xinetd" "$pkgdir/etc/xinetd.d/ffinger"
}
