# Maintainer: PktSurf <smlinux@pktsurf.in>
app=logrotate
version=3.21.0
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"

prepbuilddir() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions

  ./autogen.sh
}

build() {
  ./configure \
    --prefix= \
    --with-acl

  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="
91467fd4e48849b48ff9760ad0e4df9290c3dc56e733e8020fb58ec299a53cd0153b1fdfa0ae174beb9ea61a21c808b9edec9ea1d69b62a9e9efa9bce35c7673  logrotate-3.21.0.tar.gz
"
