APP=logrotate
VERSION=3.8.9
BUILD=1sml
HOMEPAGE='https://github.com/logrotate/logrotate'
DOWNLOAD='https://github.com/logrotate/logrotate/archive/refs/tags/r3-8-9.tar.gz'
DESC="system log rotation tool, normally run as a daily cron job"
REQUIRES="popt"

build() {
  mkandenterbuilddir
  rm -rf $APP-$VERSION

  tar xf $SRCDIR/$APP-$VERSION.tar.?z*
  cd $APP-$VERSION
  fixbuilddirpermissions

  make clean
  make

  install -Dm 755 $APP $PKG/bin/$APP
  install -Dm 644 $APP.8 $PKG/share/man/man8/$APP.8

  mkdir -p $PKG/etc/logrotate.d $PKG/var/spool/cron/crontabs
  cp $SRCDIR/logrotate.conf.new $PKG/etc/
  install -Dm 600 $SRCDIR/$APP.cron $PKG/var/spool/cron/crontabs/root

  cp COPYING $PKGDOCS/

  mkfinalpkg
}

SHA512SUMS="
1bda961042f02a84b38fcd3aef4928daf04cc4cff15b649d0335a15f79e64d18d62fd5f8bb0186830008b9515904c6999b50d22a3646cc85ea45aa0cd4632f5e  logrotate-3.8.9.tar.lz
"
