summaryrefslogtreecommitdiff
path: root/staging/mpd/mpd.install
diff options
context:
space:
mode:
authorNicolas Reynolds <fauno@kiwwwi.com.ar>2011-11-02 10:47:02 -0300
committerNicolas Reynolds <fauno@kiwwwi.com.ar>2011-11-02 10:47:02 -0300
commit40e1222c1402c0d2aded73b95802f8197d0691a6 (patch)
treee1bf1a01ae7443e4a9f460200dad9580565b27c7 /staging/mpd/mpd.install
parent3e3dd870121c91097220248a601578b92d332f2b (diff)
parent37a1064b8105764414f279ced442e6ba2f63bea1 (diff)
Merge branch 'master' of ssh://vparabola/home/parabola/abslibre-pre-mips64el
Conflicts: community/camlp5/PKGBUILD community/dzen2/PKGBUILD extra/boost/PKGBUILD extra/libxmi/PKGBUILD extra/mesa/PKGBUILD multilib/lib32-mesa/PKGBUILD
Diffstat (limited to 'staging/mpd/mpd.install')
-rw-r--r--staging/mpd/mpd.install18
1 files changed, 18 insertions, 0 deletions
diff --git a/staging/mpd/mpd.install b/staging/mpd/mpd.install
new file mode 100644
index 000000000..885505a07
--- /dev/null
+++ b/staging/mpd/mpd.install
@@ -0,0 +1,18 @@
+post_install() {
+ post_upgrade
+ echo "==> Create a configuration file /etc/mpd.conf before using MPD (example: /usr/share/mpd/mpd.conf.example)"
+}
+
+post_upgrade() {
+ getent group "mpd" &>/dev/null || groupadd -r -g 45 mpd 1>/dev/null
+ getent passwd "mpd" &>/dev/null || useradd -r -u 45 -g mpd -d "/var/lib/mpd" -s "/bin/true" -G "audio" mpd 1>/dev/null
+ for dir in /var/{lib,log}/mpd; do
+ chown -R mpd:mpd "$dir" 1>/dev/null
+ done
+}
+
+post_remove() {
+ getent passwd "mpd" &>/dev/null && userdel mpd 1>/dev/null
+ getent group "mpd" &>/dev/null && groupdel mpd 1>/dev/null
+ [ -f etc/mpd.conf ] && mv etc/mpd.conf etc/mpd.conf.pacsave 1>/dev/null
+}