diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /media-sound/mpd/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'media-sound/mpd/files')
-rw-r--r-- | media-sound/mpd/files/mpd-0.18.conf.patch | 78 | ||||
-rw-r--r-- | media-sound/mpd/files/mpd-0.20.4.init | 32 | ||||
-rw-r--r-- | media-sound/mpd/files/mpd-0.20.4.logrotate | 6 | ||||
-rw-r--r-- | media-sound/mpd/files/mpd-0.9.15-systemd.patch | 106 | ||||
-rw-r--r-- | media-sound/mpd/files/mpd.logrotate | 7 | ||||
-rw-r--r-- | media-sound/mpd/files/mpd2.init | 36 |
6 files changed, 265 insertions, 0 deletions
diff --git a/media-sound/mpd/files/mpd-0.18.conf.patch b/media-sound/mpd/files/mpd-0.18.conf.patch new file mode 100644 index 000000000000..d71056f7cd0d --- /dev/null +++ b/media-sound/mpd/files/mpd-0.18.conf.patch @@ -0,0 +1,78 @@ +diff --git a/doc/mpdconf.dist b/doc/mpdconf.dist +index 470a5c9..9f595a6 100644 +--- a/doc/mpdconf.dist ++++ b/doc/mpdconf.dist +@@ -10,14 +10,14 @@ + # be disabled and audio files will only be accepted over ipc socket (using + # file:// protocol) or streaming files over an accepted protocol. + # +-#music_directory "~/music" ++music_directory "/var/lib/mpd/music" + # + # This setting sets the MPD internal playlist directory. The purpose of this + # directory is storage for playlists created by MPD. The server will use + # playlist files not created by the server but only if they are in the MPD + # format. This setting defaults to playlist saving being disabled. + # +-#playlist_directory "~/.mpd/playlists" ++playlist_directory "/var/lib/mpd/playlists" + # + # This setting sets the location of the MPD database. This file is used to + # load the database at server start up and store the database while the +@@ -25,7 +25,7 @@ + # MPD to accept files over ipc socket (using file:// protocol) or streaming + # files over an accepted protocol. + # +-#db_file "~/.mpd/database" ++db_file "/var/lib/mpd/database" + # + # These settings are the locations for the daemon log files for the daemon. + # These logs are great for troubleshooting, depending on your log_level +@@ -34,20 +34,20 @@ + # The special value "syslog" makes MPD use the local syslog daemon. This + # setting defaults to logging to syslog, otherwise logging is disabled. + # +-#log_file "~/.mpd/log" ++log_file "/var/lib/mpd/log" + # + # This setting sets the location of the file which stores the process ID +-# for use of mpd --kill and some init scripts. This setting is disabled by +-# default and the pid file will not be stored. ++# for use of mpd --kill and some init scripts. This setting is required when ++# using the Gentoo init script. + # +-#pid_file "~/.mpd/pid" ++pid_file "/var/lib/mpd/pid" + # + # This setting sets the location of the file which contains information about + # most variables to get MPD back into the same general shape it was in before + # it was brought down. This setting is disabled by default and the server + # state will be reset on server start up. + # +-#state_file "~/.mpd/state" ++state_file "/var/lib/mpd/state" + # + # The location of the sticker database. This is a database which + # manages dynamic information attached to songs. +@@ -64,7 +64,7 @@ + # initialization. This setting is disabled by default and MPD is run as the + # current user. + # +-#user "nobody" ++user "mpd" + # + # This setting specifies the group that MPD will run as. If not specified + # primary group of user specified with "user" setting will be used (if set). +@@ -78,10 +78,10 @@ + # This setting can deny access to control of the daemon. + # + # For network +-#bind_to_address "any" ++bind_to_address "localhost" + # + # And for Unix Socket +-#bind_to_address "~/.mpd/socket" ++bind_to_address "/var/lib/mpd/socket" + # + # This setting is the TCP port that is desired for the daemon to get assigned + # to. diff --git a/media-sound/mpd/files/mpd-0.20.4.init b/media-sound/mpd/files/mpd-0.20.4.init new file mode 100644 index 000000000000..3eb0bc2bcb82 --- /dev/null +++ b/media-sound/mpd/files/mpd-0.20.4.init @@ -0,0 +1,32 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +: CFGFILE=${CFGFILE:=/etc/mpd.conf} + +depend() { + need localmount + use net netmount nfsmount alsasound esound pulseaudio + config ${CFGFILE} +} + +get_config() { + x=$1 + test -e ${CFGFILE} || return 1 + sed -n \ + -e '/^[ \t]*'${x}'/{s:^[ \t]*'${x}'[ \t]\+"\?\([^#"]\+\)[^"]*"\?$:\1: ; p }' \ + ${CFGFILE} +} + +extra_started_commands='reload' +command=/usr/bin/mpd +command_args=${opts:=${CFGFILE}} +required_files=${CFGFILE} +pidfile=$(get_config pid_file) +description="Music Player Daemon" + +reload() { + ebegin "Reloading ${SVCNAME}" + kill -HUP `cat ${pidfile}` + eend $? +} diff --git a/media-sound/mpd/files/mpd-0.20.4.logrotate b/media-sound/mpd/files/mpd-0.20.4.logrotate new file mode 100644 index 000000000000..ff47d1098cf1 --- /dev/null +++ b/media-sound/mpd/files/mpd-0.20.4.logrotate @@ -0,0 +1,6 @@ +/var/lib/mpd/log { + missingok + postrotate + /etc/init.d/mpd reload + endscript +} diff --git a/media-sound/mpd/files/mpd-0.9.15-systemd.patch b/media-sound/mpd/files/mpd-0.9.15-systemd.patch new file mode 100644 index 000000000000..cd03ebe16855 --- /dev/null +++ b/media-sound/mpd/files/mpd-0.9.15-systemd.patch @@ -0,0 +1,106 @@ +Description: transition to libsystemd from deprecated libsystemd-daemon + systemd 209 merged the various libsystemd-* libraries into a single + libsystemd.so, so we check for that instead and rename the configure + option, define, etc accordingly. +Author: Florian Schlichting <fsfs@debian.org> +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=779762 +Forwarded: not-needed (solved in a less invasive and backward-compatible way upstream) + +--- a/configure.ac ++++ b/configure.ac +@@ -572,10 +572,10 @@ + MPD_DEPENDS([enable_sqlite], [enable_glib], + [Cannot use --enable-sqlite with --disable-glib]) + +-AC_ARG_ENABLE(systemd-daemon, +- AS_HELP_STRING([--enable-systemd-daemon], +- [use the systemd daemon library (default=auto)]),, +- [enable_systemd_daemon=$linux_auto]) ++AC_ARG_ENABLE(systemd, ++ AS_HELP_STRING([--enable-systemd], ++ [use the systemd library (default=auto)]),, ++ [enable_systemd=$linux_auto]) + + AC_ARG_ENABLE(tcp, + AS_HELP_STRING([--disable-tcp], +@@ -762,11 +762,11 @@ + AC_MSG_ERROR([No client interfaces configured!]) + fi + +-MPD_AUTO_PKG(systemd_daemon, SYSTEMD_DAEMON, libsystemd-daemon, +- [systemd activation], [libsystemd-daemon not found]) +-AM_CONDITIONAL(ENABLE_SYSTEMD_DAEMON, test x$enable_systemd_daemon = xyes) +-if test x$enable_systemd_daemon = xyes; then +- AC_DEFINE([ENABLE_SYSTEMD_DAEMON], 1, [Define to use the systemd daemon library]) ++MPD_AUTO_PKG(systemd, SYSTEMD, libsystemd, ++ [systemd activation], [libsystemd not found]) ++AM_CONDITIONAL(ENABLE_SYSTEMD, test x$enable_systemd = xyes) ++if test x$enable_systemd = xyes; then ++ AC_DEFINE([ENABLE_SYSTEMD], 1, [Define to use the systemd library]) + fi + + dnl --------------------------------------------------------------------------- +--- a/Makefile.am ++++ b/Makefile.am +@@ -58,7 +58,7 @@ + $(ICU_LDADD) \ + libutil.a \ + $(FS_LIBS) \ +- $(SYSTEMD_DAEMON_LIBS) \ ++ $(SYSTEMD_LIBS) \ + $(GLIB_LIBS) + + src_mpd_SOURCES = \ +--- a/config.h.in ++++ b/config.h.in +@@ -75,8 +75,8 @@ + /* Define to enable sqlite database support */ + #undef ENABLE_SQLITE + +-/* Define to use the systemd daemon library */ +-#undef ENABLE_SYSTEMD_DAEMON ++/* Define to use the systemd library */ ++#undef ENABLE_SYSTEMD + + /* Define to enable the TwoLAME encoder plugin */ + #undef ENABLE_TWOLAME_ENCODER +--- a/src/Listen.cxx ++++ b/src/Listen.cxx +@@ -32,7 +32,7 @@ + #include <string.h> + #include <assert.h> + +-#ifdef ENABLE_SYSTEMD_DAEMON ++#ifdef ENABLE_SYSTEMD + #include <systemd/sd-daemon.h> + #endif + +@@ -77,7 +77,7 @@ + } + } + +-#ifdef ENABLE_SYSTEMD_DAEMON ++#ifdef ENABLE_SYSTEMD + + static bool + listen_systemd_activation(Error &error_r) +@@ -109,7 +109,7 @@ + + listen_socket = new ClientListener(loop, partition); + +-#ifdef ENABLE_SYSTEMD_DAEMON ++#ifdef ENABLE_SYSTEMD + if (listen_systemd_activation(error)) + return true; + +--- a/doc/user.xml ++++ b/doc/user.xml +@@ -110,7 +110,7 @@ + libupnp-dev \ + libavahi-client-dev \ + libsqlite3-dev \ +- libsystemd-daemon-dev libwrap0-dev \ ++ libsystemd-dev libwrap0-dev \ + libcppunit-dev xmlto \ + libboost-dev \ + libglib2.0-dev libicu-dev diff --git a/media-sound/mpd/files/mpd.logrotate b/media-sound/mpd/files/mpd.logrotate new file mode 100644 index 000000000000..c913c1facc43 --- /dev/null +++ b/media-sound/mpd/files/mpd.logrotate @@ -0,0 +1,7 @@ +/var/lib/mpd/log { + missingok + postrotate + [ -f /var/run/mpd.pid ] && cat /var/run/mpd.pid | xargs /bin/kill -HUP + [ -f /var/lib/mpd/pid ] && cat /var/lib/mpd/pid | xargs /bin/kill -HUP + endscript +} diff --git a/media-sound/mpd/files/mpd2.init b/media-sound/mpd/files/mpd2.init new file mode 100644 index 000000000000..ae5a2cce0ebc --- /dev/null +++ b/media-sound/mpd/files/mpd2.init @@ -0,0 +1,36 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need localmount + use net netmount nfsmount alsasound esound pulseaudio +} + +checkconfig() { + if ! [ -f /etc/mpd.conf ]; then + eerror "Configuration file /etc/mpd.conf does not exist." + return 1 + fi + + if ! grep -q '^\s*pid_file' /etc/mpd.conf; then + eerror "Invalid configuration: pid_file needs to be set." + return 1 + fi + + return 0 +} + +start() { + checkconfig || return 1 + + ebegin "Starting Music Player Daemon" + start-stop-daemon --start --quiet --exec /usr/bin/mpd -- /etc/mpd.conf 2>/dev/null + eend $? +} + +stop() { + ebegin "Stopping Music Player Daemon" + /usr/bin/mpd --kill + eend $? +} |