1 # Maintainer: Lukas Jirkovsky <l.jirkovsky@gmail.com>
5 pkgdesc="Open Source Host-based Intrusion Detection System"
7 url="http://www.ossec.net/"
10 backup=('var/ossec/etc/ossec.conf')
13 source=(http://www.ossec.net/files/ossec-hids-$pkgver.tar.gz \
15 md5sums=('f4140ecf25724b8e6bdcaceaf735138a'
16 'c5d59932a40c8782867627f29f99ace4'
17 '16b67bc144fd38d94c5709d42a67fc7d')
22 cd "$srcdir/ossec-hids-$pkgver"
24 export USER_NO_STOP=yes
25 export USER_LANGUAGE=en
26 export USER_INSTALL_TYPE=server
27 export USER_DIR=$_instdir
29 . "$srcdir/config" # load configuration
31 # fix placement of ossec-init.conf
33 sed -i "s|^OSSEC_INIT.*|OSSEC_INIT=\"$pkgdir/etc/ossec-init.conf\"|" src/init/shared.sh
34 # change the install location
35 sed -i "s|^DIR=.*|DIR=$pkgdir/$_instdir|" src/InstallServer.sh
37 # change user names to existing users to make sure the installation works
38 # the users are later changed to id's for which appropriate users are created by the ossec.install
39 sed -i -e 's|^USER=.*|USER=nobody|' -e 's|^USER_MAIL=.*|USER_MAIL=mail|' \
40 -e 's|^USER_REM=.*|USER_REM=daemon|' src/InstallServer.sh
41 # change group name to nobody, group is created by ossec.install
42 # this ensures install will work perfectly, the we will change the group later
43 sed -i 's|^GROUP=.*|GROUP=nobody|' src/InstallServer.sh
47 # install rc initscript
48 install -D -m755 "$srcdir"/ossec.rc "$pkgdir"/etc/rc.d/ossec
51 find "$pkgdir" -user nobody -exec chown 524 '{}' ';'
52 find "$pkgdir" -user mail -exec chown 525 '{}' ';'
53 find "$pkgdir" -user daemon -exec chown 526 '{}' ';'
55 find "$pkgdir" -group nobody -exec chgrp 525 '{}' ';'