app=logrotate
version=3.8.9
mversion="$(echo $version | sed 's@.@-@')"
build=1sml
homepage="https://github.com/logrotate/logrotate"
download="https://github.com/logrotate/logrotate/archive/refs/tags/r$mversion.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
"
