summaryrefslogtreecommitdiffstats
path: root/abs/extra-testing/community/mpd/mpd.install
blob: e44c9be1743f9378a485b6882a54990725e3399e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# arg 1:  the new package version
post_install() {
  echo "==> mpd: Create a config under /etc/mpd.conf before using MPD (Example: /etc/mpd.conf.example)"
  groupadd -g 45 mpd &>/dev/null
  useradd -u 45 -g mpd -d /var/lib/mpd -s /bin/true mpd &>/dev/null
  gpasswd -a mpd audio &>/dev/null
  chown mpd:mpd -R /var/{lib,log,run}/mpd
}

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
  if [ "$(vercmp $2 0.12)" -lt 0 ]; then
    echo "==> mpd: upgrade from 0.11 -> 0.12: configuration file syntax changed, "
    echo "==> mpd: make sure to update your configuration file! example conf: /etc/mpd.conf.example"
  fi
  chown mpd:mpd -R /var/{lib,log,run}/mpd
}

# arg 1:  the old package version
pre_remove() {
  userdel mpd &>/dev/null
}