# SliTaz package receipt. PACKAGE="logrotate" VERSION="3.19.0" CATEGORY="system-tools" SHORT_DESC="Automatic rotation, compression, and removal of log files." MAINTAINER="pascal.bellard@slitaz.org" LICENSE="GPL2" WEB_SITE="https://github.com/logrotate/logrotate/" TARBALL="$PACKAGE-$VERSION.tar.gz" WGET_URL="${WEB_SITE}releases/download/$VERSION/$TARBALL" DEPENDS="popt" BUILD_DEPENDS="automake popt-dev" CONFIG_FILES="/etc/logrotate.conf" current_version() { wget -O - ${WGET_URL%/down*} 2>/dev/null | \ sed '/archive.*tar/!d;s|.*/\(.*\).tar.*|\1|;q' } # Rules to configure and make the package. compile_rules() { autoreconf -fiv && ./configure \ --prefix=/usr \ --mandir=/usr/share/man \ $CONFIGURE_ARGS && make && make install PREFIX=$DESTDIR } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/etc echo -e "#Logrotate configuration file\n\ninclude /etc/logrotate.d" \ > $fs/etc/logrotate.conf cook_copy_folders sbin } post_install() { if [ -f "$1/var/spool/cron/crontabs/root" ] then echo "Creating crontab entry..." echo -e "#Run log rotation\n25 6 * * * /usr/sbin/logrotate /etc/logrotate.conf " \ >> "$1/var/spool/cron/crontabs/root" fi } post_remove() { if [ -f "$1/var/spool/cron/crontabs/root" ] then echo "Removing crontab entry..." sed -i s!.*logrotate.*!! "$1/var/spool/cron/crontabs/root" fi }