summarylogtreecommitdiffstats
path: root/maraschino.install
diff options
context:
space:
mode:
authorSlashbunny2013-12-29 17:20:55 -0500
committerSlashbunny2013-12-29 17:20:55 -0500
commitef87c4115d976e06289e8a4d0bf101552bba5030 (patch)
tree6ddb222361c9a32332faefb65a7263fb26a8d9cd /maraschino.install
parent696969b55cbdb6febc4efa447471729818aa0896 (diff)
downloadaur-ef87c4115d976e06289e8a4d0bf101552bba5030.tar.gz
Many modernizations and improvements
* Use proper linux directories for program/data * Remove old rc.d script * Run maraschino as an unprivileged user * Use new VCS PKGBUILD standards for managing git Thanks to user daichiasuka on the AUR
Diffstat (limited to 'maraschino.install')
-rw-r--r--maraschino.install26
1 files changed, 26 insertions, 0 deletions
diff --git a/maraschino.install b/maraschino.install
new file mode 100644
index 000000000000..f36f4e3beb60
--- /dev/null
+++ b/maraschino.install
@@ -0,0 +1,26 @@
+MC_USER="maraschino"
+MC_GROUP="maraschino"
+MC_DIR="/usr/lib/maraschino"
+MC_SETTINGS_DIR="/var/lib/maraschino"
+
+## arg 1: the new package version
+post_install() {
+ groupadd ${MC_GROUP} &> /dev/null
+ useradd -g ${MC_GROUP} -d ${MC_DIR} -s /bin/false ${MC_USER} &> /dev/null
+ chown -R ${MC_USER}:${MC_GROUP} ${MC_DIR}
+ chown -R ${MC_USER}:${MC_GROUP} ${MC_SETTINGS_DIR}
+}
+
+## arg 1: the new package version
+## arg 2: the old package version
+post_upgrade() {
+ chown -R ${MC_USER}:${MC_GROUP} ${MC_DIR}
+ chown -R ${MC_USER}:${MC_GROUP} ${MC_SETTINGS_DIR}
+}
+
+## arg 1: the old package version
+post_remove() {
+ userdel ${MC_USER} &> /dev/null
+ groupdel ${MC_GROUP} &> /dev/null || /bin/true
+}
+