[arch-commits] Commit in mpd/trunk (PKGBUILD mpd.install)

Andrea Scarpino andrea at archlinux.org
Mon Mar 22 17:33:50 CET 2010


    Date: Monday, March 22, 2010 @ 12:33:50
  Author: andrea
Revision: 73076

upgpkg: mpd 0.15.9-1
upstream release; delete /etc/mpd.conf when remove mpd

Modified:
  mpd/trunk/PKGBUILD
  mpd/trunk/mpd.install

-------------+
 PKGBUILD    |   10 +++++++---
 mpd.install |   20 +++++++-------------
 2 files changed, 14 insertions(+), 16 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-03-22 16:28:06 UTC (rev 73075)
+++ PKGBUILD	2010-03-22 16:33:50 UTC (rev 73076)
@@ -4,7 +4,7 @@
 # Contributor: Ben <ben at benmazer.net>
 
 pkgname=mpd
-pkgver=0.15.8
+pkgver=0.15.9
 pkgrel=1
 pkgdesc="Music daemon that plays MP3, FLAC, and Ogg Vorbis files"
 arch=('i686' 'x86_64')
@@ -13,10 +13,10 @@
 depends=('libao' 'ffmpeg' 'libmodplug' 'audiofile' 'libshout' 'libmad' 'curl'
          'sqlite3' 'libsamplerate' 'libmms' 'wavpack' 'libmpcdec' 'avahi')
 makedepends=('pkgconfig')
-install=mpd.install
+install=${pkgname}.install
 source=(http://downloads.sourceforge.net/musicpd/${pkgname}-${pkgver}.tar.bz2
         'mpd')
-md5sums=('824e1ce46c0f468865d9e5e403cdaf5d'
+md5sums=('88f7bc0b17eac81d03b24929d12b8aa1'
          'b1fd15de359db08e4b9ae4b199640f0e')
 
 build() {
@@ -28,6 +28,10 @@
     --disable-sidplay \
     --disable-pulse || return 1
   make || return 1
+}
+
+package() {
+  cd ${srcdir}/${pkgname}-${pkgver}
   make DESTDIR=${pkgdir} install
 
   # set ours dirs in mpd.conf file

Modified: mpd.install
===================================================================
--- mpd.install	2010-03-22 16:28:06 UTC (rev 73075)
+++ mpd.install	2010-03-22 16:33:50 UTC (rev 73076)
@@ -1,23 +1,17 @@
-# 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
+  chown mpd:mpd -R /var/{lib,log,run}/mpd &>/dev/null
 }
 
-# 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
+  chown mpd:mpd -R /var/{lib,log,run}/mpd &>/dev/null
 }
 
-# arg 1:  the old package version
-pre_remove() {
-  userdel mpd &>/dev/null
-}
+post_remove() {
+  getent passwd mpd >/dev/null 2>&1 && userdel mpd &>/dev/null
+  getent group mpd >/dev/null 2>&1 && userdel mpd &>/dev/null
+  [ -f etc/mpd.conf ] && rm etc/mpd.conf &>/dev/null
+}
\ No newline at end of file



More information about the arch-commits mailing list