From 4a59644ef2ed627404ffc46e381a503c6657dc2c Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@openwrt.org>
Date: Sat, 2 Feb 2008 01:48:25 +0000
Subject: [PATCH] add pls handler to mpc

this patch adds a little script to the mpc package. pls handler takes
a .pls file as argument - mpd is then playing the stream.

cheers
michu

Signed-off-by: Michael Vogt <michu at neophob.com>

SVN-Revision: 10352
---
 sound/mpc/Makefile             | 3 ++-
 sound/mpc/files/pls-handler.sh | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 sound/mpc/files/pls-handler.sh

diff --git a/sound/mpc/Makefile b/sound/mpc/Makefile
index ae3fabf95..22da22a7f 100644
--- a/sound/mpc/Makefile
+++ b/sound/mpc/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mpc
 PKG_VERSION:=0.12.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.musicpd.org/uploads/files/
@@ -51,6 +51,7 @@ endef
 define Package/mpc/install
 	$(INSTALL_DIR) $(1)/usr/bin
 	$(CP) $(PKG_BUILD_DIR)/src/mpc $(1)/usr/bin/
+	$(INSTALL_BIN) ./files/pls-handler.sh $(1)/usr/bin
 endef
 
 $(eval $(call BuildPackage,mpc))
diff --git a/sound/mpc/files/pls-handler.sh b/sound/mpc/files/pls-handler.sh
new file mode 100644
index 000000000..939441783
--- /dev/null
+++ b/sound/mpc/files/pls-handler.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env sh
+echo parameter: file.pls
+mpc clear
+grep '^File[0-9]*' $1 | sed -e 's/^File[0-9]*=//' | mpc add
+mpc play
\ No newline at end of file
-- 
2.30.2