diff --git a/PKGBUILD b/PKGBUILD index 5bac1483..fe4c6a2c 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -3,19 +3,23 @@ # Warning: for development only, use https://aur.archlinux.org/packages/apparmor.d-git for production use. -pkgname=apparmor.d -pkgver=0.001 +pkgbase=apparmor.d +pkgname=( + apparmor.d apparmor.d.base + apparmor.d.other +) +pkgver=0.0001 pkgrel=1 -pkgdesc="Full set of apparmor profiles" -arch=("x86_64") -url="https://github.com/roddhjav/$pkgname" +pkgdesc="Full set of apparmor profiles (base)" +arch=("any") +url="https://github.com/roddhjav/apparmor.d" license=('GPL2') depends=('apparmor') makedepends=('go' 'git' 'rsync') -conflicts=("$pkgname-git") +conflicts=("$pkgbase-git" "$pkgbase") pkgver() { - cd "$srcdir/$pkgname" + cd "$srcdir/$pkgbase" echo "0.$(git rev-list --count HEAD)" } @@ -24,16 +28,33 @@ prepare() { } build() { - cd "$srcdir/$pkgname" + cd "$srcdir/$pkgbase" export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" export CGO_LDFLAGS="${LDFLAGS}" export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" - make DISTRIBUTION=arch + make BUILD=.buid.all DISTRIBUTION=arch + make packages DISTRIBUTION=arch } -package() { - cd "$srcdir/$pkgname" - make install DESTDIR="$pkgdir" +package_apparmor.d() { + pkgdesc="Full set of apparmor profiles" + arch=("$CARCH") + conflicts=("${pkgname[@]:1}") + cd "$srcdir/$pkgbase" + make install BUILD=.buid.all DESTDIR="$pkgdir" +} + +package_apparmor.d.base() { + arch=("$CARCH") + cd "$srcdir/$pkgbase" + make install-base DESTDIR="$pkgdir" +} + +package_apparmor.d.other() { + pkgdesc="Full set of apparmor profiles (other)" + depends=(apparmor.d.base) + cd "$srcdir/$pkgbase" + make profiles-other DESTDIR="$pkgdir" }