added mpd fixes, signed off by <michu-at-neophobdotcom>
authorJohn Crispin <john@openwrt.org>
Fri, 28 Dec 2007 15:27:42 +0000 (15:27 +0000)
committerJohn Crispin <john@openwrt.org>
Fri, 28 Dec 2007 15:27:42 +0000 (15:27 +0000)
SVN-Revision: 9983

sound/mpd/Makefile
sound/mpd/files/mpd.init [new file with mode: 0644]

index 4ae9fbfdc8323337c4fb878bfd12c959720bd19b..ce7cce00d9b44fdd340d2aa0b2fc47d4cc7167a2 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mpd
 PKG_VERSION:=0.13.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.musicpd.org/uploads/files/
@@ -74,6 +74,8 @@ define Package/mpd/install
        $(CP) $(PKG_BUILD_DIR)/doc/mpdconf.example $(1)/etc/mpd.conf
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mpd $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/mpd.init $(1)/etc/init.d/mpd
 endef
 
 $(eval $(call BuildPackage,mpd))
diff --git a/sound/mpd/files/mpd.init b/sound/mpd/files/mpd.init
new file mode 100644 (file)
index 0000000..7fdea35
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2007 OpenWrt.org
+START=93
+
+start() {
+       #create mpd db
+        /usr/bin/mpd --stdout --create-db
+       
+       #optional export for mpc
+        #export MPD_HOST=192.168.111.123
+       
+       #start mpd
+        /usr/bin/mpd
+       
+       #generate playlist and start to play
+        /usr/bin/mpc listall | /usr/bin/mpc add -
+        /usr/bin/mpc play
+}
+
+stop() {
+        killall mpd
+}
+                                               
\ No newline at end of file