diff options
Diffstat (limited to 'base/logrotate/logrotate.build')
-rwxr-xr-x | base/logrotate/logrotate.build | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/base/logrotate/logrotate.build b/base/logrotate/logrotate.build new file mode 100755 index 0000000..b2c9440 --- /dev/null +++ b/base/logrotate/logrotate.build @@ -0,0 +1,70 @@ +#!/bin/bash +# +# Maintainer: Deposite Pirate <ofni.sknuplatem@etaripd> + +source /usr/src/ports/Build/build.sh + +NAME=logrotate +VERSION=3.8.3 +BUILD=3 + +# Description + +cat > ${PKG}/install/slack-desc <<EOF +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + +$(padd)|-----handy-ruler------------------------------------------------------| +${NAME}: logrotate (system log rotation tool) +${NAME}: +${NAME}: The logrotate utility is designed to simplify the administration +${NAME}: of log files on a system which generates a lot of log files. +${NAME}: Logrotate allows for the automatic rotation compression, removal +${NAME}: and mailing of log files. Logrotate can be set to handle a log +${NAME}: file daily, weekly, monthly or when the log file gets to a certain +${NAME}: size. Normally, logrotate runs as a daily cron job. +${NAME}: +${NAME}: +${NAME}: +EOF + +cat >> ${PKG}/install/doinst.sh <<EOF +#!/bin/sh + +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then + # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/logrotate.conf.new +EOF + +# Sources + +SRCNAME[0]=${NAME} +SRCVERS[0]=${VERSION} +SRCPACK[0]=http://fedorahosted.org/releases/l/o/logrotate/${SRCNAME[0]}-${SRCVERS[0]}.tar.gz +SRCCOPY[0]="GPL2" + +build0() +{ +make ${JOBS} RPM_OPT_FLAGS="${FLAGS}" +make install PREFIX="${PKG}" MANDIR="${SYS_DIR[man]}" +changelog CHANGES +install.dir ${PKG}${SYS_DIR[etc]}/{logrotate.d,cron.daily} +install.dir ${PKG}${SYS_DIR[var]}/lib/logrotate +install.cfg logrotate.conf ${PKG}${SYS_DIR[etc]}/logrotate.conf.new +install.bin logrotate.cron ${PKG}${SYS_DIR[etc]}/cron.daily/logrotate +} |