aboutsummaryrefslogtreecommitdiffstats
path: root/community/mpd
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2017-10-19 11:42:08 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2017-10-19 12:19:07 +0200
commit5e15f7cfb012720adb56bc085947f98fc3f8effa (patch)
tree3d3e36ce01e3e594e5a41bdbcf14f8209542cf1c /community/mpd
parent2f7c5415d86a218b7b55c037cb57954fa9086d0f (diff)
downloadaports-5e15f7cfb012720adb56bc085947f98fc3f8effa.tar.bz2
aports-5e15f7cfb012720adb56bc085947f98fc3f8effa.tar.xz
community/mpd: move from main
Diffstat (limited to 'community/mpd')
-rw-r--r--community/mpd/APKBUILD90
-rw-r--r--community/mpd/mpd.confd7
-rw-r--r--community/mpd/mpd.initd48
-rw-r--r--community/mpd/mpd.pre-install5
-rw-r--r--community/mpd/stacksize.patch19
-rw-r--r--community/mpd/underlinking.patch10
6 files changed, 179 insertions, 0 deletions
diff --git a/community/mpd/APKBUILD b/community/mpd/APKBUILD
new file mode 100644
index 0000000000..4bc2f154fa
--- /dev/null
+++ b/community/mpd/APKBUILD
@@ -0,0 +1,90 @@
+# Contributor: Łukasz Jendrysik <scadu@yandex.com>
+# Contributor: Sebastian Wicki <gandro@gmx.net>
+# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
+# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
+pkgname=mpd
+pkgver=0.20.11
+case $pkgver in
+*.*.*) _branch=${pkgver%.*};;
+*.*) _branch=$pkgver;;
+esac
+pkgrel=1
+pkgdesc="Music daemon that plays MP3, FLAC, and Ogg Vorbis files"
+url="https://musicpd.org"
+pkgusers="mpd"
+pkggroups="mpd audio"
+arch="all"
+license="GPL2"
+depends=""
+makedepends="lame-dev glib-dev curl-dev libao-dev libmad-dev flac-dev
+ libogg-dev faad2-dev libid3tag-dev libvorbis-dev alsa-lib-dev
+ libsamplerate-dev libshout-dev libmodplug-dev boost-dev icu-dev
+ libnfs-dev samba-dev opus-dev ffmpeg-dev autoconf automake
+ libtool libmpdclient-dev"
+checkdepends="cppunit-dev"
+install="$pkgname.pre-install"
+subpackages="$pkgname-doc $pkgname-dbg"
+source="https://www.musicpd.org/download/mpd/$_branch/mpd-$pkgver.tar.xz
+ underlinking.patch
+ stacksize.patch
+ mpd.initd
+ mpd.confd"
+builddir="$srcdir/$pkgname-$pkgver"
+
+prepare() {
+ default_prepare
+ cd "$builddir"
+ libtoolize --force && aclocal && autoconf && automake --add-missing
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --enable-shout \
+ --enable-opus \
+ --enable-modplug \
+ --enable-nfs \
+ --enable-smbclient \
+ --enable-ffmpeg \
+ --enable-libmpdclient \
+ --enable-test
+ make
+}
+
+check() {
+ make -C "$builddir" check
+}
+
+package() {
+ cd "$builddir"
+ 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\t"mpd":' \
+ -e 's:\#log_file.*:log_file\t\t"syslog":' \
+ 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 \
+ "$pkgdir"/var/lib/mpd/playlists \
+ "$pkgdir"/var/lib/mpd/music
+}
+
+sha512sums="1dd1c366f7ed43a497a6f2622b7ea01e822b582efd7868498ae73f1617c0abadac1a8aae5bf8b7f9aa561d247dc5d0f2c9c3903d8ddf2da28e6c124a378050f0 mpd-0.20.11.tar.xz
+d6a98c5f60a60ddd5fa94b25864f800a6a6fb6ffe114793293d0ccc71bb5d1cdb847ca39fde4128446b55a38be85634106d5d6f2c77ee450f33631b30140781a underlinking.patch
+f425c20e18207a406f84a6a664f02625fca9d42977b1289f4ba8595406b26f6aa73b4f1cb5a1115858cb75fa7844f42d7174adba3f6af1af216c44901a1ccaa0 stacksize.patch
+3725a528a45edf60e6a9ebd75c880aa63d0e71ab40c20dbc538af2d7c83ca657833b6853d9b488d635883fb7871bb76fada129b3bf8acff4bb060f98a5ad8774 mpd.initd
+41b2467f5b03f5c4dd7003cd5f56f6cfc1f67af7a9aa2538d70360f839625222bdd0c4b04c33e8cd52eeecfc354da3ca22f5aaab8aee357a5774aaf3503594e7 mpd.confd"
diff --git a/community/mpd/mpd.confd b/community/mpd/mpd.confd
new file mode 100644
index 0000000000..720306e89e
--- /dev/null
+++ b/community/mpd/mpd.confd
@@ -0,0 +1,7 @@
+# conf.d file for music player daemon
+
+#
+# Specify daemon $OPTS here.
+#
+
+OPTS=""
diff --git a/community/mpd/mpd.initd b/community/mpd/mpd.initd
new file mode 100644
index 0000000000..c92bb982a6
--- /dev/null
+++ b/community/mpd/mpd.initd
@@ -0,0 +1,48 @@
+#!/sbin/openrc-run
+
+# init.d file for music player daemon
+
+NAME=mpd
+DAEMON=/usr/bin/$NAME
+CONF=/etc/mpd.conf
+
+depend() {
+ need localmount
+ use net netmount nfsmount esound pulseaudio
+ after firewall
+}
+
+checkconfig() {
+ [ -f "$CONF" ] && return 0
+ eerror "configuration file $CONF is missing"
+ return 1
+}
+
+get_pidfile() {
+ pidfile=$(awk '$1 == "pid_file" { print $2 }' "$CONF" | sed 's/"//')
+ pidfile=${pidfile:-/var/run/mpd/$NAME.pid}
+}
+
+start() {
+ checkconfig || return 1
+ get_pidfile
+ checkpath --owner ${M_USER:-mpd}:${M_GROUP:-audio} \
+ --directory ${pidfile%/*}
+
+ ebegin "Starting ${NAME}"
+ start-stop-daemon --start --quiet \
+ --exec ${DAEMON} -- ${MPD_OPTS}
+ eend $?
+}
+
+stop() {
+ get_pidfile
+ ebegin "Stopping ${NAME}"
+ mpd --kill
+ eend $?
+}
+
+start_pre() {
+ checkpath --directory --owner ${M_USER:-mpd} \
+ --mode 0775 /var/run/$NAME
+}
diff --git a/community/mpd/mpd.pre-install b/community/mpd/mpd.pre-install
new file mode 100644
index 0000000000..c0439b71ec
--- /dev/null
+++ b/community/mpd/mpd.pre-install
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+adduser -S -D -h /var/lib/mpd -s /sbin/nologin -G audio -g mpd mpd 2>/dev/null
+
+exit 0
diff --git a/community/mpd/stacksize.patch b/community/mpd/stacksize.patch
new file mode 100644
index 0000000000..26d6f78079
--- /dev/null
+++ b/community/mpd/stacksize.patch
@@ -0,0 +1,19 @@
+diff --git a/src/thread/Thread.cxx b/src/thread/Thread.cxx
+index 2932d47..fd1f3ce 100644
+--- a/src/thread/Thread.cxx
++++ b/src/thread/Thread.cxx
+@@ -43,8 +43,12 @@ Thread::Start(void (*_f)(void *ctx), void *_ctx, Error &error)
+ #ifndef NDEBUG
+ creating = true;
+ #endif
+-
+- int e = pthread_create(&handle, nullptr, ThreadProc, this);
++ pthread_attr_t attr, *attrptr = nullptr;
++ if ((pthread_attr_init(&attr) == 0)
++ && (pthread_attr_setstacksize(&attr, 1024*1024) == 0)) {
++ attrptr = &attr;
++ }
++ int e = pthread_create(&handle, attrptr, ThreadProc, this);
+
+ if (e != 0) {
+ #ifndef NDEBUG
diff --git a/community/mpd/underlinking.patch b/community/mpd/underlinking.patch
new file mode 100644
index 0000000000..8ce3a5d38a
--- /dev/null
+++ b/community/mpd/underlinking.patch
@@ -0,0 +1,10 @@
+--- ./Makefile.am.orig
++++ ./Makefile.am
+@@ -1028,6 +1028,7 @@
+ $(FLAC_LIBS) \
+ $(OPUS_LIBS) \
+ $(SHINE_LIBS) \
++ $(VORBIS_LIBS) \
+ $(VORBISENC_LIBS)
+
+ libencoder_plugins_a_SOURCES = \