jobcore/audit/PKGBUILD

115 lines
3.3 KiB
Bash
Raw Normal View History

2022-03-20 13:19:37 +01:00
#!/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
2023-02-16 01:25:06 +01:00
_name=audit-userspace
2022-03-20 13:19:37 +01: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=01
2022-04-22 21:14:33 +02:00
pkgdesc="Userspace components of the audit framework w/o systemd"
2022-03-20 13:19:37 +01:00
url='https://people.redhat.com/sgrubb/audit'
2023-01-08 02:26:48 +01:00
makedepends=(glibc krb5 libcap-ng libldap swig linux-api-headers python)
2022-03-20 13:19:37 +01:00
options=(emptydirs)
2022-04-22 21:14:33 +02:00
#options=(emptydirs debug) # comment above options uncomment this to have debug packages produced
2023-01-08 02:26:48 +01:00
source=(#$url/$pkgname-$pkgver.tar.gz
2023-02-16 01:25:06 +01:00
# $pkgbase-userspace-$pkgver.tar.gz::https://github.com/linux-audit/audit-userspace/archive/refs/tags/v$pkgver.tar.gz
https://github.com/linux-audit/$_name/archive/v$pkgver/$_name-v$pkgver.tar.gz
2023-08-07 18:55:47 +02:00
$pkgbase-3.0.8-config_paths.patch)
# $pkgbase-3.0.9-flex_array_workaround.patch
# $pkgbase-3.0.9-undo_flex_array_workaround.patch)
2022-04-22 21:14:33 +02:00
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
}
prepare() {
2022-04-22 21:14:33 +02:00
# replace the use of /sbin with /usr/bin in configs
2023-02-16 01:25:06 +01:00
patch -Np1 -d $_name-$pkgver -i ../$pkgbase-3.0.8-config_paths.patch
2022-04-22 21:14:33 +02:00
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
2023-04-30 04:15:37 +02:00
--disable-systemd
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
2023-01-08 02:26:48 +01:00
make
2023-08-07 18:55:47 +02:00
2022-03-20 13:19:37 +01:00
}
package_audit() {
2022-04-22 21:14:33 +02:00
depends=(glibc krb5 libkrb5.so libgssapi_krb5.so libcap-ng libcap-ng.so)
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"
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() {
2022-04-22 21:14:33 +02:00
depends=(audit libaudit.so libauparse.so glibc python)
2022-03-20 13:19:37 +01:00
pkgdesc+=' (python bindings)'
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
}
2023-04-30 04:15:37 +02:00
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
2022-03-20 13:19:37 +01:00
2023-08-07 18:55:47 +02:00
license=(GPL-2.0-or-later LGPL-2.0-or-later)
2023-05-03 18:28:02 +02:00
2023-08-07 18:55:47 +02:00
sha256sums=(4516dbfd1bea0eea10a30f907e50f17087673a536ec6322a2a568dff4ebe50f4 # audit-userspace-v3.1.2.tar.gz
c3647e09d1a973595d8e43e373b8644dfb7131328c7fb3e229593af02c72ca42) # audit-3.0.8-config_paths.patch
2023-08-07 18:55:47 +02:00
## 7f06a1444a57596593e21d027a8651cc3f5d5b71e7a6d7675cfd12e70bf9b3d8 audit-3.1.2-01-x86_64.pkg.tar.lz
## 707e39f2b7aed158324865097a3ab1d8a6d8807277815ca5fc852810e1defcd3 python-audit-3.1.2-01-x86_64.pkg.tar.lz
2023-05-03 18:28:02 +02:00