jobcore/audit/PKGBUILD-arch

138 lines
3.4 KiB
Text
Raw Normal View History

2022-03-20 13:19:37 +01:00
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2022-04-22 21:14:33 +02:00
# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Christian Rebischke <Chris.Rebischke@archlinux.org>
2022-03-20 13:19:37 +01:00
# Contributor: Daniel Micay <danielmicay@gmail.com>
# Contributor: <kang@insecure.ws>
# Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# Contributor: Connor Behan <connor.behan@gmail.com>
# Contributor: henning mueller <henning@orgizm.net>
pkgbase=audit
2023-02-16 01:25:06 +01:00
_name=audit-userspace
2023-05-03 18:28:02 +02:00
pkgname=(
audit
python-audit
)
2023-08-07 18:55:47 +02:00
pkgver=3.1.2
2023-05-03 18:28:02 +02:00
pkgrel=1
2022-03-20 13:19:37 +01:00
pkgdesc='Userspace components of the audit framework'
url='https://people.redhat.com/sgrubb/audit'
2022-04-22 21:14:33 +02:00
arch=(x86_64)
2023-05-03 18:28:02 +02:00
license=(
2023-08-07 18:55:47 +02:00
GPL-2.0-or-later
LGPL-2.0-or-later
2023-05-03 18:28:02 +02:00
)
makedepends=(
glibc
krb5
libcap-ng
libldap
linux-api-headers
python
swig
)
options=(emptydirs)
2022-04-22 21:14:33 +02:00
source=(
2023-02-16 01:25:06 +01:00
https://github.com/linux-audit/$_name/archive/v$pkgver/$_name-v$pkgver.tar.gz
2022-04-22 21:14:33 +02:00
$pkgbase-3.0.8-config_paths.patch
)
2023-08-07 18:55:47 +02:00
sha512sums=('d5b05686aedd6eaaced000778580bd3e96e38c020534038d6b1ee6de96dd7687c2f3a52a2ae75be8b93c173b286a56dbc92231906c68fda79b113dfcaad6da84'
'bc699123f810abcf9300728bf61d7fcfcc83677b75fbeb713fb24cc11b2f9edf687661aab70766acde7c3c41c6a62f8e0a54cdfb49d1c7ce2246b67fbe3feec5')
b2sums=('85dd8b399f608dcf51ee2fbe6c99b35802f373e033d9d27e464aa4d98c4c0b4d190b932a2f19a047f18904261bb5e9ec7947be31effad80707b458481808ffcd'
'50be1b4f76ace20d8d14b4c57a9bb69daa3da35fd654aca8730bc287682fe38f1c1917b37469fb087daf9f309ffc15cca15f54166ece0a055f540c2604778fc6')
2023-01-08 02:26:48 +01:00
_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
}
2022-03-20 13:19:37 +01:00
prepare() {
2022-04-22 21:14:33 +02:00
# replace the use of /sbin with /usr/bin in configs
2023-01-08 02:26:48 +01:00
patch -Np1 -d $pkgbase-userspace-$pkgver -i ../$pkgbase-3.0.8-config_paths.patch
2023-02-16 01:25:06 +01:00
cd $_name-$pkgver
2023-01-08 02:26:48 +01:00
autoreconf -fiv
2022-03-20 13:19:37 +01:00
}
build() {
2023-01-08 02:26:48 +01:00
local configure_options=(
--prefix=/usr
--sbindir=/usr/bin
--sysconfdir=/etc
--libexecdir=/usr/lib/audit
2023-08-07 18:55:47 +02:00
--enable-zos-remote
2023-01-08 02:26:48 +01:00
--enable-gssapi-krb5=yes
--enable-systemd=yes
2023-02-16 01:25:06 +01:00
--with-io_uring=yes
2022-03-20 13:19:37 +01:00
--with-libcap-ng=yes
2023-08-07 18:55:47 +02:00
--with-python=no
--with-python3=yes
2023-01-08 02:26:48 +01:00
)
2023-02-16 01:25:06 +01:00
cd $_name-$pkgver
2023-01-08 02:26:48 +01:00
./configure "${configure_options[@]}"
2022-04-22 21:14:33 +02:00
# prevent excessive overlinking due to libtool
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
2022-03-20 13:19:37 +01:00
make
}
package_audit() {
2023-02-16 01:25:06 +01:00
depends=(
glibc
krb5 libkrb5.so libgssapi_krb5.so
libcap-ng libcap-ng.so
)
2023-05-03 18:28:02 +02:00
optdepends=(
'libldap: for audispd-zos-remote'
'sh: for augenrules'
)
provides=(
libaudit.so
libauparse.so
)
2022-03-20 13:19:37 +01:00
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
)
2023-02-16 01:25:06 +01:00
make DESTDIR="$pkgdir" install -C $_name-$pkgver
2023-01-08 02:26:48 +01:00
2022-04-22 21:14:33 +02:00
# add log dir
install -vdm 700 "$pkgdir/var/log/$pkgname/"
# add rules.d dir to satisfy augenrules
install -vdm 755 "$pkgdir/etc/audit/rules.d/"
2022-03-20 13:19:37 +01:00
2022-04-22 21:14:33 +02:00
# remove legacy files
rm -frv "$pkgdir/usr/lib/audit"
2022-03-20 13:19:37 +01:00
2023-01-08 02:26:48 +01:00
(
cd "$pkgdir"
_pick python-audit usr/lib/python*
)
2022-03-20 13:19:37 +01:00
}
package_python-audit() {
2023-05-03 18:28:02 +02:00
pkgdesc+=' - Python bindings'
depends=(
audit libaudit.so libauparse.so
glibc
python
)
2022-04-22 21:14:33 +02:00
2023-01-08 02:26:48 +01:00
mv -v $pkgname/* "$pkgdir"
2022-03-20 13:19:37 +01:00
}
# vim: ts=2 sw=2 et: