#!/bin/bash # # logwatch.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # logwatch.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="logwatch" PACKAGE_EXT="gz" VERSION=${VERSION:=7.7} BUILD=${BUILD:=1} ARCH=noarch if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi check_required SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" URL="http://downloads.sourceforge.net/project/logwatch/logwatch-${VERSION}/${SRC}" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION #for f in $CWD/patches/*.patch ; do # echo Patchfile: $f # cat $f | patch -p1 --verbose #done #exit install -m 0755 -d $PKG/var/cache/logwatch install -m 0755 -d $PKG/etc/logwatch/scripts install -m 0755 -d $PKG/etc/logwatch/scripts/services install -m 0755 -d $PKG/etc/logwatch/conf install -m 0755 -d $PKG/etc/logwatch/conf/logfiles install -m 0755 -d $PKG/etc/logwatch/conf/services install -m 0755 -d $PKG/usr/share/logwatch/default.conf/logfiles install -m 0755 -d $PKG/usr/share/logwatch/default.conf/services install -m 0755 -d $PKG/usr/share/logwatch/default.conf/html install -m 0755 -d $PKG/usr/share/logwatch/dist.conf/logfiles install -m 0755 -d $PKG/usr/share/logwatch/dist.conf/services install -m 0755 -d $PKG/usr/share/logwatch/scripts/logfiles install -m 0755 -d $PKG/usr/share/logwatch/scripts/services install -m 0755 -d $PKG/usr/share/logwatch/scripts/shared install -m 0755 -d $PKG/usr/share/logwatch/lib install -m 0755 scripts/logwatch.pl $PKG/usr/share/logwatch/scripts/logwatch.pl for i in scripts/logfiles/* ; do if [ $(ls $i | grep -v CVS | wc -l) -ne 0 ] ; then install -m 0755 -d $PKG/usr/share/logwatch/$i install -m 0644 $i/* $PKG/usr/share/logwatch/$i fi done install -m 0644 scripts/services/* $PKG/usr/share/logwatch/scripts/services install -m 0644 scripts/shared/* $PKG/usr/share/logwatch/scripts/shared install -m 0644 lib/* $PKG/usr/share/logwatch/lib install -m 0644 conf/*.conf $PKG/usr/share/logwatch/default.conf install -m 0644 conf/logfiles/* $PKG/usr/share/logwatch/default.conf/logfiles install -m 0644 conf/services/* $PKG/usr/share/logwatch/default.conf/services install -m 0644 conf/html/* $PKG/usr/share/logwatch/default.conf/html install -m 0755 -d $PKG/usr/man/man8 $PKG/usr/man/man5 $PKG/usr/man/man1 install -m 0644 logwatch.8 $PKG/usr/man/man8 install -m 0644 logwatch.conf.5 $PKG/usr/man/man5 install -m 0644 override.conf.5 $PKG/usr/man/man5 install -m 0644 ignore.conf.5 $PKG/usr/man/man5 install -m 0644 postfix-logwatch.1 $PKG/usr/man/man1 install -m 0755 -d $PKG/usr/sbin ln -s /usr/share/logwatch/scripts/logwatch.pl $PKG/usr/sbin/logwatch install -m 0755 -d $PKG/etc/cron.daily rm -f $PKG/etc/cron.daily/0logwatch install -m 0755 scheduler/logwatch.cron $PKG/etc/cron.daily/0logwatch #ln -s /usr/share/logwatch/scripts/logwatch.pl $PKG/etc/cron.daily/0logwatch echo "###### REGULAR EXPRESSIONS IN THIS FILE WILL BE TRIMMED FROM REPORT OUTPUT #####" > $PKG/etc/logwatch/conf/ignore.conf.new echo "# Local configuration options go here (defaults are in //usr/share/logwatch/logwatch.conf)" > $PKG/etc/logwatch/conf/logwatch.conf.new echo "# Configuration overrides for specific logfiles/services may be placed here." > $PKG/etc/logwatch/conf/override.conf.new mkdir -p $DOCS cp -a HOWTO-* LICENSE README $DOCS fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi