mpd: new package
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Thu, 20 Jan 2011 20:49:42 +0000 (17:49 -0300)
committerPeter Korsgaard <jacmet@sunsite.dk>
Fri, 21 Jan 2011 14:00:17 +0000 (15:00 +0100)
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/multimedia/Config.in
package/multimedia/mpd/Config.in [new file with mode: 0644]
package/multimedia/mpd/S95mpd [new file with mode: 0644]
package/multimedia/mpd/mpd.conf [new file with mode: 0644]
package/multimedia/mpd/mpd.mk [new file with mode: 0644]

index 14c4145fd97356e7c3716c80e97269c8bfc9af31..ae26ceb309b7530431dc58e343406d07f40cfd26 100644 (file)
@@ -28,6 +28,7 @@ source "package/multimedia/libsndfile/Config.in"
 source "package/multimedia/libtheora/Config.in"
 source "package/multimedia/libvorbis/Config.in"
 source "package/multimedia/madplay/Config.in"
+source "package/multimedia/mpd/Config.in"
 source "package/multimedia/mpg123/Config.in"
 source "package/multimedia/mplayer/Config.in"
 source "package/multimedia/musepack/Config.in"
diff --git a/package/multimedia/mpd/Config.in b/package/multimedia/mpd/Config.in
new file mode 100644 (file)
index 0000000..3906a5f
--- /dev/null
@@ -0,0 +1,138 @@
+menuconfig BR2_PACKAGE_MPD
+       bool "mpd"
+       depends on BR2_INSTALL_LIBSTDCPP
+       depends on BR2_USE_WCHAR
+       select BR2_PACKAGE_LIBGLIB2
+       select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
+       help
+         MPD is a flexible, powerful, server-side application
+         for playing music. Through plugins and libraries
+         it can play a variety of sound files while being
+         controlled by its network protocol.
+
+         http://www.musicpd.org
+
+if BR2_PACKAGE_MPD
+
+config BR2_PACKAGE_MPD_ALSA
+       bool "alsa"
+       default y
+       select BR2_PACKAGE_ALSA_LIB
+       help
+         Enable alsa output support.
+
+config BR2_PACKAGE_MPD_AO
+       bool "ao"
+       select BR2_PACKAGE_LIBAO
+       help
+         Enable libao output support.
+
+config BR2_PACKAGE_MPD_BZIP2
+       bool "bzip2"
+       select BR2_PACKAGE_BZIP2
+       help
+         Enable bzip2 archive support.
+
+config BR2_PACKAGE_MPD_CURL
+       bool "curl"
+       select BR2_PACKAGE_LIBCURL
+       help
+         Enable curl streaming (http) support.
+
+config BR2_PACKAGE_MPD_FAAD2
+       bool "faad2"
+       select BR2_PACKAGE_FAAD2
+       help
+         Enable faad2 input support.
+         Select this if you want to play back MP4/AAC files.
+
+config BR2_PACKAGE_MPD_FLAC
+       bool "flac"
+       select BR2_PACKAGE_FLAC
+       help
+         Enable flac input/streaming support.
+         Select this if you want to play back FLAC files.
+
+config BR2_PACKAGE_MPD_LIBSAMPLERATE
+       bool "libsamplerate"
+       select BR2_PACKAGE_LIBSAMPLERATE
+       help
+         Enable libsamplerate input support.
+         Select this for software sample rate conversion.
+
+config BR2_PACKAGE_MPD_LIBSNDFILE
+       bool "libsndfile"
+       select BR2_PACKAGE_LIBSNDFILE
+       help
+         Enable libsndfile input/streaming support.
+         Select this if you want to play back WAV files.
+
+config BR2_PACKAGE_MPD_MAD
+       bool "mad"
+       default y
+       select BR2_PACKAGE_LIBID3TAG
+       select BR2_PACKAGE_LIBMAD
+       help
+         Enable mad input support.
+         Select this if you want to play back MP3 files.
+
+config BR2_PACKAGE_MPD_MPG123
+       bool "mpg123"
+       select BR2_PACKAGE_LIBID3TAG
+       select BR2_PACKAGE_MPG123
+       help
+         Enable mpg123 input support.
+         Select this if you want to play back MP3 files.
+
+config BR2_PACKAGE_MPD_MUSEPACK
+       bool "musepack"
+       select BR2_PACKAGE_LIBCUE
+       select BR2_PACKAGE_LIBREPLAYGAIN
+       select BR2_PACKAGE_MUSEPACK
+       help
+         Enable musepack input support.
+         Select this if you want to play back MPC files.
+
+config BR2_PACKAGE_MPD_SQLITE
+       bool "sqlite"
+       select BR2_PACKAGE_SQLITE
+       help
+         Enable sqlite database support.
+         If you don't use sqlite it will use an ASCII database.
+
+config BR2_PACKAGE_MPD_TCP
+       bool "tcp sockets"
+       default y
+       help
+         Enable mpd to listen on tcp sockets.
+
+         You want this on if mpd and the client(s) work
+         on different machines (the usual scenario).
+
+config BR2_PACKAGE_MPD_TREMOR
+       bool "tremor"
+       select BR2_PACKAGE_LIBOGG
+       select BR2_PACKAGE_TREMOR
+       help
+         Enable vorbis input support.
+         Select this if you want to play back OGG files on softfloat targets.
+
+config BR2_PACKAGE_MPD_VORBIS
+       bool "vorbis"
+       select BR2_PACKAGE_LIBOGG
+       select BR2_PACKAGE_LIBVORBIS
+       help
+         Enable vorbis input/streaming support.
+         Select this if you want to play back OGG files on hardfloat targets.
+
+config BR2_PACKAGE_MPD_WAVPACK
+       bool "wavpack"
+       select BR2_PACKAGE_WAVPACK
+       help
+         Enable wavpack input support.
+         Select this if you want to play back WV files.
+
+endif
+
+comment "mpd requires a toolchain with C++ and WCHAR support"
+       depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR
diff --git a/package/multimedia/mpd/S95mpd b/package/multimedia/mpd/S95mpd
new file mode 100644 (file)
index 0000000..7c242f4
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+start() {
+       echo -n "Starting mpd: "
+       start-stop-daemon --start --quiet --background --exec /usr/bin/mpd
+       echo "OK"
+}
+
+stop() {
+       echo -n "Stopping mpd: "
+       start-stop-daemon --stop --quiet --pidfile /var/run/mpd.pid
+       echo "OK"
+}
+
+case "$1" in
+       start)
+               start
+               ;;
+       stop)
+               stop
+               ;;
+       restart|reload)
+               stop
+               sleep 1
+               start
+               ;;
+       *)
+               echo $"Usage: $0 {start|stop|restart}"
+               exit 1
+esac
diff --git a/package/multimedia/mpd/mpd.conf b/package/multimedia/mpd/mpd.conf
new file mode 100644 (file)
index 0000000..1a08ed0
--- /dev/null
@@ -0,0 +1,32 @@
+#
+# Sample configuration file for mpd
+# This is a minimal configuration, see the manpage for more options
+#
+
+# Directory where the music is stored
+music_directory                "/var/lib/mpd/music"
+
+# Directory where user-made playlists are stored (RW)
+playlist_directory     "/mnt/mpd/playlists"
+
+# Database file (RW)
+db_file                        "/var/lib/mpd/database"
+
+# Log file (RW)
+log_file               "/var/log/mpd.log"
+
+# Process ID file (RW)
+pid_file               "/var/run/mpd.pid"
+
+# State file (RW)
+state_file             "/var/lib/mpd/state"
+
+# User id to run the daemon as
+#user                  "nobody"
+
+# TCP socket binding
+bind_to_address                "any"
+#bind_to_address       "localhost"
+
+# Unix socket to listen on
+bind_to_address                "/var/lib/mpd/socket"
diff --git a/package/multimedia/mpd/mpd.mk b/package/multimedia/mpd/mpd.mk
new file mode 100644 (file)
index 0000000..c60ccc6
--- /dev/null
@@ -0,0 +1,109 @@
+#############################################################
+#
+# mpd
+#
+#############################################################
+
+MPD_VERSION = 0.16.1
+MPD_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/musicpd
+MPD_DEPENDENCIES = host-pkg-config libglib2
+
+# Some options need an explicit --disable or --enable
+
+ifeq ($(BR2_PACKAGE_MPD_ALSA),y)
+MPD_DEPENDENCIES += alsa-lib
+else
+MPD_CONF_OPT += --disable-alsa
+endif
+
+ifeq ($(BR2_PACKAGE_MPD_AO),y)
+MPD_DEPENDENCIES += libao
+else
+MPD_CONF_OPT += --disable-ao
+endif
+
+ifeq ($(BR2_PACKAGE_MPD_BZIP2),y)
+MPD_DEPENDENCIES += bzip2
+MPD_CONF_OPT += --enable-bzip2
+endif
+
+ifeq ($(BR2_PACKAGE_MPD_FAAD2),y)
+MPD_DEPENDENCIES += faad2
+else
+MPD_CONF_OPT += --disable-faad2
+endif
+
+ifeq ($(BR2_PACKAGE_MPD_FLAC),y)
+MPD_DEPENDENCIES += flac
+else
+MPD_CONF_OPT += --without-flac
+endif
+
+ifeq ($(BR2_PACKAGE_MPD_CURL),y)
+MPD_DEPENDENCIES += libcurl
+else
+MPD_CONF_OPT += --disable-curl
+endif
+
+ifeq ($(BR2_PACKAGE_MPD_LIBSAMPLERATE),y)
+MPD_DEPENDENCIES += libsamplerate
+else
+MPD_CONF_OPT += --disable-lsr
+endif
+
+ifeq ($(BR2_PACKAGE_MPD_LIBSNDFILE),y)
+MPD_DEPENDENCIES += libsndfile
+else
+MPD_CONF_OPT += --disable-sndfile
+endif
+
+ifeq ($(BR2_PACKAGE_MPD_VORBIS),y)
+MPD_DEPENDENCIES += libvorbis
+else
+MPD_CONF_OPT += --disable-vorbis
+endif
+
+ifeq ($(BR2_PACKAGE_MPD_MPG123),y)
+MPD_DEPENDENCIES += libid3tag mpg123
+else
+MPD_CONF_OPT += --disable-mpg123
+endif
+
+ifeq ($(BR2_PACKAGE_MPD_MUSEPACK),y)
+MPD_DEPENDENCIES += musepack
+else
+MPD_CONF_OPT += --disable-mpc
+endif
+
+ifeq ($(BR2_PACKAGE_MPD_SQLITE),y)
+MPD_DEPENDENCIES += sqlite
+else
+MPD_CONF_OPT += --disable-sqlite
+endif
+
+ifneq ($(BR2_PACKAGE_MPD_TCP),y)
+MPD_CONF_OPT += --disable-tcp
+endif
+
+ifeq ($(BR2_PACKAGE_MPD_TREMOR),y)
+MPD_DEPENDENCIES += tremor
+MPD_CONF_OPT += --with-tremor
+endif
+
+ifeq ($(BR2_PACKAGE_MPD_WAVPACK),y)
+MPD_DEPENDENCIES += wavpack
+else
+MPD_CONF_OPT += --disable-wavpack
+endif
+
+define MPD_INSTALL_EXTRA_FILES
+       [ ! -f $(TARGET_DIR)/etc/mpd.conf ] && \
+               $(INSTALL) -D package/multimedia/mpd/mpd.conf \
+                       $(TARGET_DIR)/etc/mpd.conf
+       $(INSTALL) -m 0755 -D package/multimedia/mpd/S95mpd \
+               $(TARGET_DIR)/etc/init.d/S95mpd
+endef
+
+MPD_POST_INSTALL_TARGET_HOOKS += MPD_INSTALL_EXTRA_FILES
+
+$(eval $(call AUTOTARGETS,package/multimedia,mpd))