NAME="libdaemon"
DESC="Lightweight C library that eases the writing of UNIX daemons"
VERSION="0.14"
FILES=("https://0pointer.de/lennart/projects/libdaemon/libdaemon-$VERSION.tar.gz")
HASHES=("509dc27107c21bcd9fbf2f95f5669563")
DEPENDS=()

PACKAGE() {
  tar xf $NAME-$VERSION.tar.gz
  cd $NAME-$VERSION

  ./configure --prefix=/usr --disable-static
  make && make -C doc doxygen
  make DESTDIR="$ROOTDIR" docdir=/usr/share/doc/libdaemon-$VERSION install
  install -v -m755 -d "$ROOTDIR/usr/share/doc/libdaemon-$VERSION/reference/html"
  install -v -m644 doc/reference/html/* "$ROOTDIR/usr/share/doc/libdaemon-$VERSION/reference/html"

  mkdir -pv "$ROOTDIR/usr/share/man/man3"
  install -v -m644 doc/reference/man/man3/* "$ROOTDIR/usr/share/man/man3"

  cd .. && rm -r $NAME-$VERSION
}
