diff --git a/PKGBUILD b/PKGBUILD index 322a47a..f0464e2 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Eric Torres pkgname=packaging-scripts -pkgver=1.1 +pkgver=1.1.1 pkgrel=1 pkgdesc="A set of helper scripts for handling Arch Linux packages" arch=('any') @@ -10,6 +10,7 @@ depends=('pacman' 'python') makedepends=('git' 'python-setuptools') optdepends=('fzf: for the fqo script' 'mlocate: for the fqo script') +backup=(etc/apparmor.d/usr.bin.{addpkg,delpkg}) source=("git+file:///home/etorres/Projects/packaging-scripts") sha256sums=('SKIP') sha512sums=('SKIP') @@ -27,6 +28,11 @@ package() { # install README install -Dm644 README.rst "${pkgdir}/usr/share/doc/${pkgname}/README.rst" + # install AppArmor profiles + for profile in misc/apparmor/*; do + install -Dm644 "${profile}" "${pkgdir}/etc/apparmor.d/${profile##*/}" + done + # install zsh completions install -d "${pkgdir}/usr/share/zsh/site-functions" for completion in packaging_scripts/zsh-completions/*; do diff --git a/misc/apparmor/usr.bin.addpkg b/misc/apparmor/usr.bin.addpkg new file mode 100644 index 0000000..bab3c93 --- /dev/null +++ b/misc/apparmor/usr.bin.addpkg @@ -0,0 +1,17 @@ +#include + +/usr/bin/addpkg { + #include + #include + #include + + /usr/bin/repo-add Ux, + + /etc/pacman.conf r, + /etc/pacman.d/ r, + /etc/pacman.d/** r, + /home/*/{Packages,Projects} r, + /home/*/{Packages,Projects}/** rw, + /var/cache/pacman/ r, + /var/cache/pacman/** rw, +} diff --git a/misc/apparmor/usr.bin.delpkg b/misc/apparmor/usr.bin.delpkg new file mode 100644 index 0000000..e588213 --- /dev/null +++ b/misc/apparmor/usr.bin.delpkg @@ -0,0 +1,17 @@ +#include + +/usr/bin/delpkg { + #include + #include + #include + + /usr/bin/repo-remove Ux, + + /etc/pacman.conf r, + /etc/pacman.d/ r, + /etc/pacman.d/** r, + /home/*/{Packages,Projects} r, + /home/*/{Packages,Projects}/** rw, + /var/cache/pacman/ r, + /var/cache/pacman/** rw, +} diff --git a/setup.py b/setup.py index e592370..1381194 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.rst", "r") as fh: setuptools.setup( name="packaging_scripts", - version="1.1", + version="1.1.1", author="Eric Russel Torres", author_email="erictorres4@protonmail.com", description="A set of helpers for automating borg interaction",