summaryrefslogtreecommitdiffstats
path: root/abs/extra/mpd/mpd.install
diff options
context:
space:
mode:
authorJames Meyer <jams@linhes.org>2010-12-22 19:54:09 (GMT)
committerJames Meyer <jams@linhes.org>2010-12-22 19:54:09 (GMT)
commitf11f722e4d91aca54bd4b7b04330201a0787e3df (patch)
tree952050d92b790dde5f5dd619cf7bd8808492f437 /abs/extra/mpd/mpd.install
parent51d7490509b3908658953e62c5c16c26370f495c (diff)
downloadlinhes_pkgbuild-f11f722e4d91aca54bd4b7b04330201a0787e3df.zip
linhes_pkgbuild-f11f722e4d91aca54bd4b7b04330201a0787e3df.tar.gz
linhes_pkgbuild-f11f722e4d91aca54bd4b7b04330201a0787e3df.tar.bz2
mpd/mpc/libmpdclient: add mpd and simple client
refs:#741
Diffstat (limited to 'abs/extra/mpd/mpd.install')
-rw-r--r--abs/extra/mpd/mpd.install18
1 files changed, 18 insertions, 0 deletions
diff --git a/abs/extra/mpd/mpd.install b/abs/extra/mpd/mpd.install
new file mode 100644
index 0000000..885505a
--- /dev/null
+++ b/abs/extra/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
+}