From f11f722e4d91aca54bd4b7b04330201a0787e3df Mon Sep 17 00:00:00 2001
From: James Meyer <jams@linhes.org>
Date: Wed, 22 Dec 2010 19:54:09 +0000
Subject: mpd/mpc/libmpdclient: add mpd and simple client refs:#741

---
 abs/extra/libmpdclient/PKGBUILD | 26 +++++++++++++++++++
 abs/extra/mpc/PKGBUILD          | 27 ++++++++++++++++++++
 abs/extra/mpd/PKGBUILD          | 55 +++++++++++++++++++++++++++++++++++++++++
 abs/extra/mpd/mpd               | 36 +++++++++++++++++++++++++++
 abs/extra/mpd/mpd.install       | 18 ++++++++++++++
 5 files changed, 162 insertions(+)
 create mode 100644 abs/extra/libmpdclient/PKGBUILD
 create mode 100644 abs/extra/mpc/PKGBUILD
 create mode 100644 abs/extra/mpd/PKGBUILD
 create mode 100755 abs/extra/mpd/mpd
 create mode 100644 abs/extra/mpd/mpd.install

diff --git a/abs/extra/libmpdclient/PKGBUILD b/abs/extra/libmpdclient/PKGBUILD
new file mode 100644
index 0000000..84ecda6
--- /dev/null
+++ b/abs/extra/libmpdclient/PKGBUILD
@@ -0,0 +1,26 @@
+# $Id: PKGBUILD 50625 2009-08-30 03:02:23Z allan $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+
+pkgname=libmpdclient
+pkgver=2.3
+pkgrel=1
+pkgdesc="An asynchronous API library for interfacing MPD in the C, C++ & Objective C languages"
+arch=('i686' 'x86_64')
+url="http://mpd.wikia.com/wiki/ClientLib:libmpdclient"
+license=('GPL2')
+depends=('glibc')
+options=('!libtool')
+source=("http://downloads.sourceforge.net/musicpd/${pkgname}-${pkgver}.tar.bz2")
+sha1sums=('d1ccd40f1c7a723ef0a8eb0e19b51699ec9a8f9e')
+
+build() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  ./configure --prefix=/usr
+  make
+}
+
+package() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  make DESTDIR="${pkgdir}" install
+}
diff --git a/abs/extra/mpc/PKGBUILD b/abs/extra/mpc/PKGBUILD
new file mode 100644
index 0000000..deb999e
--- /dev/null
+++ b/abs/extra/mpc/PKGBUILD
@@ -0,0 +1,27 @@
+# $Id: PKGBUILD 63171 2010-01-15 15:11:21Z giovanni $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Alexander Fehr <pizzapunk gmail com>
+# Contributor: Link Dupont <link@subpop.net>
+
+pkgname=mpc
+pkgver=0.19
+pkgrel=1
+pkgdesc="Minimalist command line interface to MPD"
+arch=('i686' 'x86_64')
+url="http://mpd.wikia.com/wiki/Client:Mpc"
+license=('GPL2')
+depends=('libmpdclient')
+options=('!emptydirs')
+source=(http://downloads.sourceforge.net/musicpd/${pkgname}-$pkgver.tar.bz2)
+md5sums=('9ab2967d9ec719b06a86f3b4121be654')
+
+build() {
+  cd "$srcdir/$pkgname-$pkgver"
+
+  ./configure --prefix=/usr || return 1
+  make || return 1
+  make DESTDIR="$pkgdir" install || return 1
+
+  # Install bash completion file
+  install -D -m644 doc/mpc-completion.bash "$pkgdir/etc/bash_completion.d/mpc" || return 1
+}
diff --git a/abs/extra/mpd/PKGBUILD b/abs/extra/mpd/PKGBUILD
new file mode 100644
index 0000000..60d0a9d
--- /dev/null
+++ b/abs/extra/mpd/PKGBUILD
@@ -0,0 +1,55 @@
+# $Id: PKGBUILD 102920 2010-12-13 06:36:00Z angvp $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Damir Perisa <damir.perisa@bluewin.ch>
+# Contributor: Ben <ben@benmazer.net>
+
+pkgname=mpd
+pkgver=0.16
+pkgrel=2
+pkgdesc="Music daemon that plays MP3, FLAC, and Ogg Vorbis files"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://mpd.wikia.com/wiki/Server"
+depends=('libao' 'ffmpeg' 'libmodplug' 'audiofile' 'libshout' 'libmad' 'curl' 'faad2'
+         'sqlite3' 'libsamplerate' 'libmms' 'wavpack' 'libmpcdec' 'avahi' 'libid3tag')
+         
+makedepends=('pkgconfig' 'doxygen')
+install=${pkgname}.install
+source=("http://downloads.sourceforge.net/musicpd/${pkgname}-${pkgver}.tar.bz2"
+        'mpd')
+md5sums=('3fc8ccc4488cbaadc1a10f415eada35f'
+         'e5669c2bff4031928531e52475addeb1')
+
+build() {
+  cd ${srcdir}/${pkgname}-${pkgver}
+  ./configure --prefix=/usr \
+    --sysconfdir=/etc \
+    --enable-lastfm \
+    --enable-pulse \
+    --enable-documentation \
+    --disable-libwrap \
+    --disable-cue \
+    --disable-sidplay \
+    --disable-pulse 
+  make
+}
+
+package() {
+  cd ${srcdir}/${pkgname}-${pkgver}
+  make DESTDIR=${pkgdir} install
+
+  # set ours dirs in mpd.conf file
+  sed -i 's|^music_directory.*$|#music_directory "path_to_your_music_collection"|1' doc/mpdconf.example
+  sed -i 's|playlist_directory.*$|playlist_directory "/var/lib/mpd/playlists"|1' doc/mpdconf.example
+  sed -i 's|db_file.*$|db_file "/var/lib/mpd/mpd.db"|1' doc/mpdconf.example
+  sed -i 's|log_file.*$|log_file "/var/log/mpd/mpd.log"|1' doc/mpdconf.example
+  sed -i 's|error_file.*$|error_file "/var/log/mpd/mpd.error"|1' doc/mpdconf.example
+  sed -i 's|#pid_file.*$|pid_file "/var/run/mpd/mpd.pid"|1' doc/mpdconf.example
+  sed -i 's|#state_file.*$|state_file "/var/lib/mpd/mpdstate"|1' doc/mpdconf.example
+  sed -i 's|#user.*$|user "mpd"|1' doc/mpdconf.example
+
+  install -Dm644 doc/mpdconf.example ${pkgdir}/usr/share/mpd/mpd.conf.example
+
+  install -Dm755 ${srcdir}/mpd ${pkgdir}/etc/rc.d/mpd
+  install -d ${pkgdir}/var/{lib/mpd/playlists,log/mpd}
+}
diff --git a/abs/extra/mpd/mpd b/abs/extra/mpd/mpd
new file mode 100755
index 0000000..6134e2e
--- /dev/null
+++ b/abs/extra/mpd/mpd
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+  start)
+    stat_busy "Starting Music Player Daemon"
+    [ ! -d /var/run/mpd ] && install -d -g 45 -o 45 /var/run/mpd
+    /usr/bin/mpd /etc/mpd.conf &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      add_daemon mpd
+      stat_done
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping Music Player Daemon"
+    /usr/bin/mpd --kill /etc/mpd.conf &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm_daemon mpd
+      stat_done
+    fi
+    ;;
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  *)
+    echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
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
+}
-- 
cgit v0.12