jobcore/audit/PKGBUILD

126 lines
3.7 KiB
Bash

#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgbase=audit
_name=audit-userspace
pkgname=('audit' 'python-audit')
pkgver=4.0.1
pkgrel=03
pkgdesc="Userspace components of the audit framework w/o systemd"
url='https://people.redhat.com/sgrubb/audit'
makedepends=(apparmor glibc krb5 libcap-ng libldap linux-api-headers python swig)
options=(emptydirs)
#options=(emptydirs debug) # comment above options uncomment this to have debug packages produced
source=( https://github.com/linux-audit/$_name/archive/v$pkgver/$_name-v$pkgver.tar.gz
$pkgbase.tmpfiles)
# $pkgbase-4.0-executable_paths.patch) # systemd patch ... irrelevant
_pick() {
local p="$1" f d; shift
for f; do
d="$srcdir/$p/${f#$pkgdir/}"
mkdir -p "$(dirname "$d")"
mv "$f" "$d"
rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
done
}
prepare() {
# use /usr and /bin merge compatible paths in configs and systemd services
# patch -Np1 -d $pkgbase-userspace-$pkgver -i ../$pkgbase-4.0-executable_paths.patch
cd $_name-$pkgver
autoreconf -fiv
}
build() {
local configure_options=(
--prefix=/usr
--sbindir=/usr/bin
--sysconfdir=/etc
--runstatedir=/run
--enable-gssapi-krb5=yes
--enable-systemd=no
--enable-zos-remote
--libexecdir=/usr/lib/audit
--with-apparmor=yes
--with-io_uring=yes
--with-libcap-ng=yes
--with-python3=yes
)
cd $_name-$pkgver
./configure "${configure_options[@]}"
# prevent excessive overlinking due to libtool
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
}
package_audit() {
depends=(glibc krb5 libkrb5.so libgssapi_krb5.so libcap-ng libcap-ng.so)
optdepends=('libldap: for audispd-zos-remote'
'sh: for augenrules')
provides=(libaudit.so libauparse.so)
backup=(
etc/libaudit.conf
etc/audit/audit-stop.rules
etc/audit/auditd.conf
etc/audit/audisp-remote.conf
etc/audit/zos-remote.conf
etc/audit/plugins.d/af_unix.conf
etc/audit/plugins.d/au-remote.conf
etc/audit/plugins.d/audispd-zos-remote.conf
etc/audit/plugins.d/syslog.conf
)
make DESTDIR="$pkgdir" install -C $_name-$pkgver
# add rules.d dir to satisfy augenrules
install -vdm 755 "$pkgdir/etc/audit/rules.d/"
# add config dir for audisp
install -vdm 755 "$pkgdir/etc/audisp"
# add factory files
install -vdm 755 "$pkgdir/usr/share/factory/"
cp -av "$pkgdir/etc" "$pkgdir/usr/share/factory/"
# add tmpfiles.d integration for factory files and file permissions
install -vDm 644 $pkgbase.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/$pkgbase.conf"
# remove legacy files
rm -frv "$pkgdir/usr/lib/audit"
# remove systemd crap that is still pushed by upstream even when you configure disable system
rm -frv $pkgdir/usr/lib/systemd
(
cd "$pkgdir"
_pick python-audit usr/lib/python*
)
}
package_python-audit() {
pkgdesc+=' (python bindings)'
depends=(audit libaudit.so libauparse.so glibc python)
mv -v $pkgname/* "$pkgdir"
}
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
license=(GPL-2.0-or-later LGPL-2.0-or-later)
sha256sums=(f964610dc0c1e68075d5ae4b14d6280d1164b6eca3a4a13721d1a711681403d9 # audit-userspace-v4.0.1.tar.gz
0ed3ff18f966f57e62d181705cad44ec0873a50d151dad46ca18a82edaa5589c) # audit.tmpfiles
## 4c1bc01da10a5f4f9b5d8964f89235107bf00077f5814c51286349a0a7dd1782 python-audit-4.0.1-03-x86_64.pkg.tar.lz
## 0bd124f21ead27fb36645bf8f6ab8692aeb319bc3c043125bd854e5f8b30fa3d audit-4.0.1-03-x86_64.pkg.tar.lz