diff options
author | Philipp A | 2017-09-22 11:08:34 +0200 |
---|---|---|
committer | Philipp A | 2017-09-22 11:08:34 +0200 |
commit | 291eafb79f677e3a7a652b66840a60396a572ee6 (patch) | |
tree | c9124a450b54ee88ff7fc610138b2efac5616aac /PKGBUILD | |
download | aur-desktop-privileges-nogroups.tar.gz |
initial commit
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..cdebf71b5805 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,27 @@ +# Maintainer: Philipp A. <flying-sheep@web.de> + +pkgname=desktop-privileges-nogroups +pkgver=1.0 +pkgrel=1 +pkgdesc="A collection of polkit rules to manage automounting of removable media, suspend and hibernate actions and CPU frequency settings." +arch=(any) +url="https://gist.github.com/3886114" +license=(GPL) +depends=(polkit udisks2 upower) +source=("$pkgname::git+$url.git") +sha256sums=(SKIP) + +package() { + install -dm755 "$pkgdir/etc/polkit-1/" + install -dm750 "$pkgdir/etc/polkit-1/rules.d/" + + for rules in "$srcdir/$pkgname/"*.js; do + local path="$(head -n1 "$rules" | sed -E 's|/\* Copy this to ([^ ]+) \*/|\1|')" + if [[ "$path" != /etc* ]]; then + path="/etc/polkit-1/rules.d/$(basename "$rules" .js).rules" + fi + install -Dm644 "$rules" "$pkgdir/$path" + sed -Ei 's|subject\.user ===? "\w+"|subject.isInGroup("wheel")|' "$pkgdir/$path" + done +} + |