summaryrefslogtreecommitdiff
path: root/staging/mpd
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-06-05 00:01:46 +0000
committerroot <root@rshg054.dnsready.net>2012-06-05 00:01:46 +0000
commit67db4cf68dbdb364c4dee1599294d7701f3c3b0a (patch)
treeab6491b591fe7f704b48188ecffe80771edf822e /staging/mpd
parent1e6588d64f084decf287a58b7ff93ff0ce4d0446 (diff)
Tue Jun 5 00:01:46 UTC 2012
Diffstat (limited to 'staging/mpd')
-rw-r--r--staging/mpd/PKGBUILD65
-rw-r--r--staging/mpd/install11
-rwxr-xr-xstaging/mpd/rc.d25
-rw-r--r--staging/mpd/tmpfiles.d1
4 files changed, 102 insertions, 0 deletions
diff --git a/staging/mpd/PKGBUILD b/staging/mpd/PKGBUILD
new file mode 100644
index 000000000..17183d011
--- /dev/null
+++ b/staging/mpd/PKGBUILD
@@ -0,0 +1,65 @@
+# $Id: PKGBUILD 160682 2012-06-03 17:43:39Z bisson $
+# Maintainer: Gaetan Bisson <bisson@archlinux.org>
+# Contributor: Angel Velasquez <angvp@archlinux.org>
+# Contributor: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Damir Perisa <damir.perisa@bluewin.ch>
+# Contributor: Ben <ben@benmazer.net>
+
+pkgname=mpd
+pkgver=0.16.8
+pkgrel=4
+pkgdesc='Flexible, powerful, server-side application for playing music'
+url='http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki'
+license=('GPL')
+arch=('i686' 'x86_64')
+depends=('libao' 'ffmpeg' 'libmodplug' 'audiofile' 'libshout' 'libmad' 'curl' 'faad2'
+ 'sqlite' 'jack' 'libmms' 'wavpack' 'libmpcdec' 'avahi' 'libid3tag'
+ 'libpulse')
+makedepends=('doxygen')
+source=("http://downloads.sourceforge.net/musicpd/${pkgname}-${pkgver}.tar.bz2"
+ 'tmpfiles.d'
+ 'rc.d')
+sha1sums=('977c80db8dc64e65c2bc523f69a9a7a71adca2b1'
+ 'f4d5922abb69abb739542d8e93f4dfd748acdad7'
+ '3470d489565f0ed479f1665dd2876f66acb5a585')
+
+backup=('etc/mpd.conf')
+install=install
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --enable-lastfm \
+ --enable-jack \
+ --enable-pulse \
+ --enable-documentation \
+ --disable-libwrap \
+ --disable-cue \
+ --disable-sidplay \
+ --disable-documentation \
+ --with-systemdsystemunitdir=/usr/lib/systemd/system
+
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make DESTDIR="${pkgdir}" install
+
+ sed \
+ -e '/^#playlist_directory/c playlist_directory "/var/lib/mpd/playlists"' \
+ -e '/^#db_file/c db_file "/var/lib/mpd/mpd.db"' \
+ -e '/^#pid_file/c pid_file "/run/mpd/mpd.pid"' \
+ -e '/^#state_file/c state_file "/var/lib/mpd/mpdstate"' \
+ -e '/^#user/c user "mpd"' \
+ -i doc/mpdconf.example
+
+ install -Dm755 ../rc.d "${pkgdir}"/etc/rc.d/mpd
+ install -d -g 45 -o 45 "${pkgdir}"/var/lib/mpd/playlists
+ install -Dm644 doc/mpdconf.example "${pkgdir}"/etc/mpd.conf
+ install -Dm644 ../tmpfiles.d "${pkgdir}"/usr/lib/tmpfiles.d/mpd.conf
+}
diff --git a/staging/mpd/install b/staging/mpd/install
new file mode 100644
index 000000000..261b8fd0d
--- /dev/null
+++ b/staging/mpd/install
@@ -0,0 +1,11 @@
+post_install() {
+ getent group mpd &>/dev/null || groupadd -r -g 45 mpd >/dev/null
+ getent passwd mpd &>/dev/null || useradd -r -u 45 -g mpd -d /var/lib/mpd -s /bin/false -G audio mpd >/dev/null
+ true
+}
+
+post_remove() {
+ getent passwd mpd &>/dev/null && userdel mpd >/dev/null
+ getent group mpd &>/dev/null && groupdel mpd >/dev/null
+ true
+}
diff --git a/staging/mpd/rc.d b/staging/mpd/rc.d
new file mode 100755
index 000000000..f00e16067
--- /dev/null
+++ b/staging/mpd/rc.d
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy 'Starting Music Player Daemon'
+ /usr/bin/mpd /etc/mpd.conf &> /dev/null &&
+ { add_daemon mpd; stat_done; } || stat_fail
+ ;;
+ stop)
+ stat_busy 'Stopping Music Player Daemon'
+ /usr/bin/mpd --kill /etc/mpd.conf &> /dev/null &&
+ { rm_daemon mpd; stat_done; } || stat_fail
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/staging/mpd/tmpfiles.d b/staging/mpd/tmpfiles.d
new file mode 100644
index 000000000..41c4e743a
--- /dev/null
+++ b/staging/mpd/tmpfiles.d
@@ -0,0 +1 @@
+d /run/mpd 0755 mpd mpd