Verified Commit 1c732729 authored by Dhruvin Gandhi's avatar Dhruvin Gandhi
Browse files

testing/hledger-web: add apparmor subpackage

parent b0cded37
......@@ -2,17 +2,18 @@
# Maintainer: Dhruvin Gandhi <contact@dhruvin.dev>
pkgname=hledger-web
pkgver=1.26.1
pkgrel=1
pkgrel=2
pkgdesc="Web interface for the hledger accounting system"
url="https://hledger.org/hledger-web.html"
arch="x86_64" # limited by ghc
license="GPL-3.0-only"
makedepends="ghc cabal libffi-dev ncurses-dev zlib-dev"
subpackages="$pkgname-doc $pkgname-openrc"
subpackages="$pkgname-doc $pkgname-openrc $pkgname-apparmor:apparmor:noarch"
source="https://hackage.haskell.org/package/hledger-web-$pkgver/hledger-web-$pkgver.tar.gz
cabal.project.freeze
hledger-web.initd"
install="$pkgname.pre-install"
hledger-web.initd
hledger-web.apparmor"
install="$pkgname.pre-install $pkgname-apparmor.post-install"
export CABAL_DIR="$srcdir"/cabal
......@@ -39,8 +40,15 @@ package() {
install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
}
apparmor() {
pkgdesc="AppArmor profile of $pkgname"
install_if="$pkgname=$pkgver-r$pkgrel apparmor-profiles"
install -Dm600 "$srcdir"/$pkgname.apparmor "$subpkgdir"/etc/apparmor.d/usr.bin.hledger-web
}
sha512sums="
d0b41e4b5ba4db047a4bc8ef23b59a737e5beee34e3c523e755dc5dcbe9183586cc1539ea101d51de82dbaea1f99967cf84fcf2037d72eddf6f2d2e25c9e96d8 hledger-web-1.26.1.tar.gz
89f29780a43f2258f5bc59b86b7f393ae0c75f635d71ffc668b9f5e6e189ce20f6fd56a48d5814f2cf040e12d3051400f3c9c23256f21f46671f86e0fcc3369b cabal.project.freeze
4fd0898b29736c1d7f5b41b1ccca8734f38999e5ba88656e092724a7ce4ed346b4f86d627c99be77934eaa7cd86e33ce20a33a60650f1ad8a527c57387179365 hledger-web.initd
9397b119bf04cfef6501f1d635faf7e8349ebb9cfc757c1d6173af6029a6a09ddbddab1cf1808f0a9e9a132acbad8eaad546e2e9f95241230e3650a3b2840006 hledger-web.apparmor
"
#!/bin/sh
rc-service -is apparmor reload
# Last Modified: Wed Jul 27 20:19:35 2022
abi <abi/3.0>,
include <tunables/global>
profile hledger-web /usr/bin/hledger-web {
include <abstractions/base>
network inet stream,
/@{PROC}/@{pid}/task/@{tid}/comm w,
/etc/zoneinfo/** r,
/usr/bin/hledger-web mr,
/usr/share/terminfo/** r,
owner /var/lib/hledger/** rw,
# Site-specific additions and overrides. See local/README for details.
include if exists <local/usr.bin.hledger-web>
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment