diff options
author | Lukáš Jirkovský | 2015-06-21 18:41:33 +0200 |
---|---|---|
committer | Lukáš Jirkovský | 2015-06-21 18:43:28 +0200 |
commit | eade2237ff6b4577e8e358f50c0d96d577545ffd (patch) | |
tree | 5995aa3fcf76b0407dfcf8f9c78516de4a6721a8 /PKGBUILD | |
download | aur-eade2237ff6b4577e8e358f50c0d96d577545ffd.tar.gz |
initial import
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..cf9eed543f86 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,72 @@ +# Maintainer: Lukas Jirkovsky <l.jirkovsky@gmail.com> +pkgname=ossec-local +pkgver=2.8.2 +pkgrel=1 +pkgdesc="Open Source Host-based Intrusion Detection System" +arch=('i686' 'x86_64') +url="http://www.ossec.net/" +license=('GPL3') +depends=('openssl') +backup=('var/ossec/etc/ossec.conf') +install=ossec.install +options=('emptydirs') +source=(http://www.ossec.net/files/ossec-hids-$pkgver.tar.gz \ + ossec.service config) +md5sums=('3036d5babc96216135759338466e1f79' + '4a197f7f05b2a1d0da54e4fdef1718a5' + '510463fc82537b59a45fe55993e6d712') + +_instdir=/var/ossec + +_preparevars() { + export USER_NO_STOP=yes + export USER_LANGUAGE=en + export USER_INSTALL_TYPE=local + export USER_DIR=$_instdir + export USER_BINARYINSTALL=x +} + +build() { + cd "$srcdir/ossec-hids-$pkgver" + + _preparevars + . "$srcdir/config" # load configuration + + # fix placement of ossec-init.conf + sed -i "s|^OSSEC_INIT.*|OSSEC_INIT=\"$pkgdir/etc/ossec-init.conf\"|" src/init/shared.sh + # change the install location + sed -i "s|^DIR=.*|DIR=$pkgdir/$_instdir|" src/InstallServer.sh + + # change user names to existing users to make sure the installation works + # the users are later changed to id's for which appropriate users are created by the ossec.install + sed -i -e 's|^USER=.*|USER=nobody|' -e 's|^USER_MAIL=.*|USER_MAIL=mail|' \ + -e 's|^USER_REM=.*|USER_REM=daemon|' src/InstallServer.sh + # change group name to nobody, group is created by ossec.install + # this ensures install will work perfectly, the we will change the group later + sed -i 's|^GROUP=.*|GROUP=nobody|' src/InstallServer.sh + + cd src + make all + make build +} + +package() { + cd "$srcdir/ossec-hids-$pkgver" + + _preparevars + . "$srcdir/config" # load configuration + + mkdir -p $pkgdir/etc + + ./install.sh + + # install systemd service + install -Dm0644 "$srcdir"/ossec.service "$pkgdir"/usr/lib/systemd/system/ossec.service + + # change the users + find "$pkgdir" -user nobody -exec chown 524 '{}' ';' + find "$pkgdir" -user mail -exec chown 525 '{}' ';' + find "$pkgdir" -user daemon -exec chown 526 '{}' ';' + # change the groups + find "$pkgdir" -group nobody -exec chgrp 525 '{}' ';' +} |