From 9e199d3dba627496e179d8c33f1ffdef8dd07a15 Mon Sep 17 00:00:00 2001 From: David P Date: Tue, 26 Feb 2019 23:46:51 -0300 Subject: upgpkg: pcr/samhain 4.3.2-1 Signed-off-by: David P --- pcr/samhain/PKGBUILD | 103 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 71 insertions(+), 32 deletions(-) (limited to 'pcr/samhain/PKGBUILD') diff --git a/pcr/samhain/PKGBUILD b/pcr/samhain/PKGBUILD index 4dfdc1ee7..849c6afa3 100644 --- a/pcr/samhain/PKGBUILD +++ b/pcr/samhain/PKGBUILD @@ -1,44 +1,83 @@ -# Maintainer: Luke R. GPG: rsa4096/3EAE8697 +# Contributor: Luke R. +# Maintainer: David P. -pkgname=samhain -pkgver=4.2.0 +pkgbase=samhain +pkgname=(samhain-client samhain-server) +pkgver=4.3.2 pkgrel=1 -pkgdesc="file integrity / intrusion detection system" -arch=(i686 x86_64) -url="http://www.la-samhna.de/" -license=('GPL') -makedepends=('gcc' 'openssl' 'procps-ng') -source=("http://www.la-samhna.de/samhain/${pkgname}-current.tar.gz" -'PKGBUILD.sig' -'PKGBUILD') +arch=(armv7h i686 x86_64) +url='http://www.la-samhna.de/' +license=(GPL) +makedepends=(openssl procps-ng) +source=("https://www.la-samhna.de/archive/${pkgbase}_signed-$pkgver.tar.gz" + samhain.service + yule.service) options=(!emptydirs) -validpgpkeys=('CB6E213A349B8DF9E96B622AC3F4FFCF3EAE8697' # PKGBUILD Maintainer's key -'EF6CEF54701A0AFDB86AF4C31AAD26C80F571F6C') # Rainer Wichmann -sha512sums=('bacb82f87d7e6c7bad49f99454279e19c6d1cfa2e353de4f2346cee78f9761173aed5fc26dd956f1c88928d28d25e98c07bc8f74f2984bddae64f96ad1e6b4b2' - 'SKIP' +validpgpkeys=('EF6CEF54701A0AFDB86AF4C31AAD26C80F571F6C') # Rainer Wichmann +sha512sums=('aaa4c9e384715fffaa55d3d5838bf137f199bd7a8da2f2005e165ead03f82c401de74806c4a2687eaa217927d50c5400417805ac37dfd36c4b0ad959c3bf2d1e' + '736b6077c680afd2cbb25065207e671dd63d329ce9c1b8d11aa02e835550bdcbf72be6cba8fe67079c3823c805d8fdaf17e5238371c679b5ff8c7dbee56bdc9d' + 'd005c19efd164ea86e06860aae0bac18432636c3b9763c4e5584e1a4c17610d5092984c5e946450beaa515d683b5b0e9364d28c55d28fcab28c928d7bcf71031' + 'a6b25f878f0adb1dbdb0c19feea7e325d400bbb2834604a675ce3e47204089dd92dbb51c23889883b28e028fa7f1d8c0e0c7559c27497dd9a56f365d6155e9a2' 'SKIP') -pkgver() { -tar -ztvf samhain-current.tar.gz | head -n1 | awk '{print $6}' | sed "s/samhain-//" | sed "s/.tar.gz//" # get latest version number -} +# Hack to allow having samhain-$pkgver.tar.gz in source=(), +# since it is inside samhain_signed-$pkgver.tar.gz +[ -e ${pkgbase}_signed-$pkgver.tar.gz ] || curl -fLC - --retry 3 --retry-delay 3 -O ${source[0]} +[[ -e samhain-$pkgver.tar.gz{,.asc} ]] || tar -zxf ${pkgbase}_signed-$pkgver.tar.gz && +source+=("samhain-$pkgver.tar.gz"{,.asc}) build() { - gpg --verify PKGBUILD.sig PKGBUILD - echo "Note: If the GPG verification fails, import the PKGBUILD maintainer's GPG key. See: https://wiki.parabola.nu/GnuPG#Import_key" - gpg --verify samhain-${pkgver}.tar.gz.asc samhain-${pkgver}.tar.gz - echo "Note: If the GPG verification fails, import the Samhain GPG key: http://www.la-samhna.de/samhain/s_rkey.html" - tar -zxvf "${srcdir}/${pkgname}-current.tar.gz" -C "${srcdir}"/. - cd "${srcdir}" - tar -zxvf ${pkgname}-${pkgver}.tar.gz - cd "${pkgname}-${pkgver}" - ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-trusted=0 --sbindir=/usr/bin - # see samhain documentation, lots of other options available. e.g. use --enable-network=server to run in server mode. + cp -r "$pkgbase-$pkgver" "$pkgbase-server-$pkgver" + + cd "$pkgbase-$pkgver" + ./configure --prefix=/usr \ + --localstatedir=/var \ + --sysconfdir=/etc \ + --with-trusted=0 \ + --sbindir=/usr/bin + + cd "../$pkgbase-server-$pkgver" + ./configure --prefix=/usr \ + --localstatedir=/var \ + --sysconfdir=/etc \ + --sbindir=/usr/bin \ + --enable-network=server } -package() { - cd "${pkgname}-${pkgver}" - make || return 1 - make DESTDIR="$pkgdir/" install +package_samhain-client() { + pkgdesc='File integrity/intrusion detection system' + install=samhain.install + provides=($pkgbase) + replaces=(${provides[@]}) + conflicts=(${provides[@]}) + + cd "$pkgbase-$pkgver" + + make DESTDIR="$pkgdir" install + chmod 755 $pkgdir/usr/bin/samhain chmod 644 $pkgdir/etc/samhainrc + install -m755 -d "$pkgdir/usr/lib/systemd/system" + install -m644 "$srcdir/samhain.service" "$pkgdir/usr/lib/systemd/system/samhain.service" + + rmdir $pkgdir/run + rmdir $pkgdir/var/log +} + +package_samhain-server() { + pkgdesc='Server of file integrity/intrusion detection system' + + cd "$pkgbase-server-$pkgver" + + make DESTDIR="$pkgdir/" install + + for f in yule{,admin.pl,_setpwd,ctl}; do + chmod 755 $pkgdir/usr/bin/$f + done + chmod 644 $pkgdir/etc/yulerc + install -m755 -d "$pkgdir/usr/lib/systemd/system" + install -m644 "$srcdir/yule.service" "$pkgdir/usr/lib/systemd/system/yule.service" + + rmdir $pkgdir/run + rm -r $pkgdir/var/log } -- cgit v1.2.3