updated on Thu Jan 19 00:16:31 UTC 2012
[aur-mirror.git] / logcheck / PKGBUILD
blob370783a5cfc7a2bbab12bc7fc516f8c5ca143800
1 # Contributor: Andreas Wagner <Andreas dot Wagner at em dot uni-frankfurt dot de>
3 pkgname=logcheck
4 pkgver=1.3.14
5 pkgrel=3
6 pkgdesc="looks for anomalies in the system logfiles"
7 license=('GPL')
8 arch=('i686' 'x86_64')
9 url="http://packages.qa.debian.org/l/logcheck.html"
10 depends=('cron' 'shadow' 'grep' 'logger' 'perl>=5.8.0' 'lockfile-progs' 'run-parts' 'mime-construct>=1.11-2')
11 install="$pkgname.install"
12 backup=(etc/logcheck/logcheck.conf etc/logcheck/logcheck.logfiles etc/cron.hourly/logcheck)
13 source=(http://ftp.debian.org/debian/pool/main/l/$pkgname/${pkgname}_${pkgver}.tar.gz
14         http://logcheck.org/docs/logcheck.8
15         local-ignorefiles.tar.gz
16         local-violationsfiles.tar.gz)
18 build() {
19     cd $srcdir/$pkgname-$pkgver
21     make install DESTDIR=$pkgdir
23     # man
24     install -d -m 755 $pkgdir/usr/share/man/man{1,8}
25     install -m 644 docs/logtail.8                       $pkgdir/usr/share/man/man8
26     install -m 644 docs/logtail2.8                      $pkgdir/usr/share/man/man8
27     install -m 644 docs/logcheck-test.1                 $pkgdir/usr/share/man/man1
28     install -m 644 $startdir/logcheck.8                 $pkgdir/usr/share/man/man8
30     # doc
31     install -d -m 755 $pkgdir/usr/share/doc/logcheck/tools
32     install -m 644 AUTHORS      $pkgdir/usr/share/doc/logcheck
33     install -m 644 CHANGES      $pkgdir/usr/share/doc/logcheck
34     install -m 644 CREDITS      $pkgdir/usr/share/doc/logcheck
35     install -m 644 INSTALL      $pkgdir/usr/share/doc/logcheck
36     install -m 644 TODO         $pkgdir/usr/share/doc/logcheck
37     cp -r docs/*                $pkgdir/usr/share/doc/logcheck
38     cp -r debian/*              $pkgdir/usr/share/doc/logcheck
39 #    install -m 644 docs/README*        $pkgdir/usr/share/doc/logcheck
40 #    install -m 755 docs/tools/log-summary-ssh $pkgdir/usr/share/doc/logcheck/tools
41 #    install -m 644 debian/*    $pkgdir/usr/share/doc/logcheck
42     chmod 755 $pkgdir/usr/share/doc/logcheck/rules
44     # mail header
45     install -m 644 debian/header.txt $pkgdir/etc/logcheck
47     # logfiles entries
48     sed -i -e 's/\/var\/log\/syslog$/\/var\/log\/syslog.log/' $pkgdir/etc/logcheck/logcheck.logfiles
49     echo "/var/log/messages.log" >> $pkgdir/etc/logcheck/logcheck.logfiles
50     echo "/var/log/kernel.log" >> $pkgdir/etc/logcheck/logcheck.logfiles
51     echo "/var/log/mail.log" >> $pkgdir/etc/logcheck/logcheck.logfiles
52     echo "/var/log/user.log" >> $pkgdir/etc/logcheck/logcheck.logfiles
54     # template ignore files
55     mkdir -p $pkgdir/usr/share/logcheck/templates/{ignore.d.server,violations.ignore.d}
56     install -m 644 $srcdir/local-ignorefiles/* $pkgdir/usr/share/logcheck/templates/ignore.d.server
57     install -m 644 $srcdir/local-violationsfiles/* $pkgdir/usr/share/logcheck/templates/violations.ignore.d
59     # cron entry
60     install -m 755 -d $pkgdir/etc/cron.hourly
61     cronfile="$pkgdir/etc/cron.hourly/logcheck"
62     echo "#!/bin/bash" > $cronfile
63     echo 'if [ -x /usr/sbin/logcheck ]; then nice -n 10 su -s /bin/bash -c "/usr/sbin/logcheck" logcheck; fi' >> $cronfile
64     chmod 755 $cronfile
67 md5sums=('cbd32dbdcb877f267636205f33ede790'
68          'a9d8c93ecc12d61b0e87bf07ed951ac8'
69          '961c156fd565c8cf0ed6695f0f3bb8d7'
70          'd68e1ccda168908bf7cdbf017f221917')