jobcore/audit/PKGBUILD

128 lines
4.9 KiB
Text
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-02-16 01:25:06 +01:00
pkgver=3.1
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'
2022-04-22 21:14:33 +02:00
arch=(x86_64)
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-01-08 02:26:48 +01: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-01-08 02:26:48 +01:00
# fix broken userspace build due to swig: https://listman.redhat.com/archives/linux-audit/2022-February/018843.html
2023-02-16 01:25:06 +01:00
cp -v /usr/include/linux/audit.h $_name-$pkgver/lib/
patch -Np1 -d $_name-$pkgver -i ../$pkgbase-3.0.9-flex_array_workaround.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
--enable-gssapi-krb5=yes
--enable-systemd=no
2022-03-20 13:19:37 +01:00
--with-libcap-ng=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
2022-04-22 21:14:33 +02:00
[ -n "$SOURCE_DATE_EPOCH" ] && touch -h -d @$SOURCE_DATE_EPOCH bindings/swig/python/audit.py
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
# undo fix for broken swig, so that other programs may use the header file correctly
patch -Np0 -d "$pkgdir" -i "$srcdir/$pkgbase-3.0.9-undo_flex_array_workaround.patch"
rm -v "$pkgdir/usr/include/libaudit.h.orig"
2022-03-20 13:19:37 +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
}
2022-09-03 00:50:45 +02:00
#---- license gpg-key sha256sums ----
2022-03-20 13:19:37 +01:00
2022-04-22 21:14:33 +02:00
license=(GPL LGPL2.1)
2022-03-20 13:19:37 +01:00
2023-02-16 01:25:06 +01:00
sha512sums=('c21be7da557a2f0f2576645db23626785955190599e1b417252424eaefa7284da8e2e915cf2599f28078ee507d83497eb6cbbdb1b1459a0fabd62e235b34e7b9'
2023-01-08 02:26:48 +01:00
'bc699123f810abcf9300728bf61d7fcfcc83677b75fbeb713fb24cc11b2f9edf687661aab70766acde7c3c41c6a62f8e0a54cdfb49d1c7ce2246b67fbe3feec5'
'442bffac895abbd0abe455c36ebc03ed5a9faee16b57347ef1f37c0d9c33777e204da917be3bbe11c56173c2ec96eed60646ac7214da47f828eef5fa104c1ebb'
'92ba0f9b3d3721bf64b56e2f3e2ac4e54b2b6acd9d5646a5ee97eea244cb165e19a56c362de16834925ae063c79e6505687749f1dd67dd0f2997919aea7cb2ef')
2023-02-16 01:25:06 +01:00
b2sums=('62c92a933c6eefeb3dfe1ec2950de624b7bdfe6f990528314108ad07d4d5a58fb53e0e5edc2f411b1f0a0140bfe96742a7ffadc72c06d1f3f34cb3cbea4e5f4d'
2023-01-08 02:26:48 +01:00
'50be1b4f76ace20d8d14b4c57a9bb69daa3da35fd654aca8730bc287682fe38f1c1917b37469fb087daf9f309ffc15cca15f54166ece0a055f540c2604778fc6'
'2241c3dd29c803493ac8e85afd6031749a46b583514829b8761c24ae12061999b7c95107ec2948dd7edb239f805ca088b7b24229abb5445a4767702539779b0f'
'd89110c32da33c2ca9292391ead930352e4c8935aa86111640130d9e3fbc0ebe27b069a83812530dfbbf28f4ddd33545658c8061d87bfac9a9d3a6a5ff0be4b8')
2023-02-16 01:25:06 +01:00
sha256sums=(98d75a6269b80288a442e24c9fbdd6e6845ef4b7c8bc9141725f11a91cef5797 # audit-userspace-v3.1.tar.gz
2023-01-08 02:26:48 +01:00
c3647e09d1a973595d8e43e373b8644dfb7131328c7fb3e229593af02c72ca42 # audit-3.0.8-config_paths.patch
118c01ae411904b7a7730379ebf7a7506a044182a73d9bcf0620e25e853b698a # audit-3.0.9-flex_array_workaround.patch
f4f4a06fa6070970611f49573180501f588de215cc6c26bfb8804ed9e7621e8f) # audit-3.0.9-undo_flex_array_workaround.patch