# $Id$ PNAME="logrotate" PVER="3.12.3" PBUILD="r1" PCAT="app-admin" DESCRIPTION="Rotates, compresses, removes and mails system log files." HOMEPAGE="https://github.com/logrotate/logrotate/" DEPEND=">= virtual/glibc >= dev-libs/popt-1.16" SDEPEND=">= virtual/sed >= dev-libs/popt-dev-1.16" SRCFILE="${PNAME}-${PVER}.tar.gz" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" ALX_PKG_KEEP="etc usr/sbin/logrotate" sminclude mtools alx-split SRC_URI=( https://github.com/logrotate/${PNAME}/releases/download/${PVER}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/logrotate.conf-3.7.1 mirror://${PNAME}/logrotate.cron-3.7.1 mirror://${PNAME}/${PNAME}-3.7.7-weekly.patch ) UP2DATE="updatecmd https://github.com/logrotate/logrotate/releases | highesttarball xz" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} mpatch ${PNAME}-3.7.7-weekly.patch || die # fix a small glitch in the man pages sed -i "s:logrotate/status:logrotate.status:" logrotate.8 || die } src_compile() { cd ${SRCDIR} mmake RPM_OPT_FLAGS="${CFLAGS}" || die } alx_generic_src_install() { cd ${SRCDIR} # needed directories minstalldir /usr/sbin || die # bins minstallexec logrotate /usr/sbin || die # conf minstalletc logrotate.conf-3.7.1 logrotate.conf || die # cron minstallcron daily logrotate.cron-3.7.1 logrotate || die # man minstallman logrotate.8 || die # mark it undeletable mkeepdir /etc/logrotate.d || die # doc minstalldocs CHANGES COPYING README* examples/* || die } postinstall() { # needed directory if [ ! -d ${MROOT}/etc/logrotate.d ] then install -d ${MROOT}/etc/logrotate.d fi # mark it undeletable touch ${MROOT}/etc/logrotate.d/.keep }