summaryrefslogtreecommitdiffstats
path: root/testing/mpd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-09-10 09:04:06 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-09-10 09:07:14 +0000
commit868e4cbd62215412630b50ba8fa82a81d55edca0 (patch)
tree655ef50c27e66467dfd1643c06539830d8ffab98 /testing/mpd
parent08a789230fb36d32a10b92ecbf12d8ec55c5e4a6 (diff)
downloadaports-868e4cbd62215412630b50ba8fa82a81d55edca0.tar.bz2
aports-868e4cbd62215412630b50ba8fa82a81d55edca0.tar.xz
testing/mpd: new aport
Music daemon that plays MP3, FLAC, and Ogg Vorbis files http://musicpd.org
Diffstat (limited to 'testing/mpd')
-rw-r--r--testing/mpd/APKBUILD48
-rw-r--r--testing/mpd/mpd.confd7
-rw-r--r--testing/mpd/mpd.initd43
-rw-r--r--testing/mpd/mpd.pre-install4
4 files changed, 102 insertions, 0 deletions
diff --git a/testing/mpd/APKBUILD b/testing/mpd/APKBUILD
new file mode 100644
index 000000000..92e8c6db7
--- /dev/null
+++ b/testing/mpd/APKBUILD
@@ -0,0 +1,48 @@
+# Contributor: Sebastian Wicki <gandro@gmx.net>
+# Maintainer: Natanael Copa <natanael.copa@gmail.com>
+pkgname=mpd
+pkgver=0.15.2
+pkgrel=0
+pkgdesc="Music daemon that plays MP3, FLAC, and Ogg Vorbis files"
+url="http://musicpd.org"
+pkgusers="mpd"
+pkggroups="mpd audio"
+license="GPL2"
+depends=
+makedepends="pkgconfig lame-dev glib-dev curl-dev libao-dev libmad-dev flac-dev
+ libogg-dev faad2-dev libid3tag-dev libvorbis-dev alsa-lib-dev"
+install="$pkgname.pre-install"
+subpackages="$pkgname-doc"
+source="http://downloads.sourceforge.net/project/musicpd/mpd/${pkgver}/mpd-${pkgver}.tar.bz2
+ mpd.initd
+ mpd.confd
+ "
+
+build() {
+ cd "$srcdir"/$pkgname-$pkgver
+
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info
+ make || return 1
+ make DESTDIR="$pkgdir" install
+
+ #provide a config that works by default
+ install -d "$pkgdir"/etc
+ sed -e 's:\#pid_file.*:pid_file\t\t/var/run/mpd/mpd.pid:' \
+ -e 's:\#user.*:user\t\tmpd:' \
+ -e 's:\#log_file.*:log_file\t\t/var/log/mpd:' \
+ doc/mpdconf.example > "$pkgdir"/etc/mpd.conf
+
+ install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+ install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
+ install -d -g audio -o mpd -m775 \
+ "$pkgdir"/var/run/mpd \
+ "$pkgdir"/var/log/mpd \
+ "$pkgdir"/var/lib/mpd/playlists \
+ "$pkgdir"/var/lib/mpd/music
+}
+md5sums="869779fdf592ac45d067c7dec228cb51 mpd-0.15.2.tar.bz2
+942017fbdc8bbaf5109e972a0a51b2c1 mpd.initd
+dbd301041953a5cf9c2b9de8f23eb6bb mpd.confd"
diff --git a/testing/mpd/mpd.confd b/testing/mpd/mpd.confd
new file mode 100644
index 000000000..720306e89
--- /dev/null
+++ b/testing/mpd/mpd.confd
@@ -0,0 +1,7 @@
+# conf.d file for music player daemon
+
+#
+# Specify daemon $OPTS here.
+#
+
+OPTS=""
diff --git a/testing/mpd/mpd.initd b/testing/mpd/mpd.initd
new file mode 100644
index 000000000..7601ed4f2
--- /dev/null
+++ b/testing/mpd/mpd.initd
@@ -0,0 +1,43 @@
+#!/sbin/runscript
+
+# init.d file for music player daemon
+
+NAME=mpd
+DAEMON=/usr/sbin/$NAME
+CONF=/etc/mpd.conf
+
+depend() {
+ need localmount
+ use net netmount nfsmount esound pulseaudio
+}
+
+checkconfig() {
+ [ -f "$CONF" ] && return 0
+ eerror "configuration file $CONF is missing"
+ return 1
+}
+
+get_pidfile() {
+ pidfile=$(awk '$1 == "pid_file" { print $2 }' "$CONF")
+ pidfile=${pidfile:-/var/run/mpd/$NAME.pid}
+}
+
+start() {
+ checkconf || return 1
+ get_pidfile
+ ebegin "Starting ${NAME}"
+ start-stop-daemon --start --quiet \
+ --pidfile $pidfile\
+ --exec ${DAEMON} -- ${MPD_OPTS}
+ eend $?
+}
+
+stop() {
+ get_pidfile
+ ebegin "Stopping ${NAME}"
+ start-stop-daemon --stop --quiet \
+ --pidfile $pidfile \
+ --exec ${DAEMON}
+ eend $?
+}
+
diff --git a/testing/mpd/mpd.pre-install b/testing/mpd/mpd.pre-install
new file mode 100644
index 000000000..4baabab1a
--- /dev/null
+++ b/testing/mpd/mpd.pre-install
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+adduser -h /var/lib/mpd -s /bin/false -G audio -D mpd 2>/dev/null || true
+