packages/mpd: use new service functions

git-svn-id: svn://svn.openwrt.org/openwrt/packages@29080 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nico 2011-11-13 22:16:27 +00:00
parent 3da206df0a
commit 94bb1f0d7c
2 changed files with 13 additions and 11 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=mpd
PKG_VERSION:=0.16.5
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/musicpd
@ -193,14 +193,14 @@ define Package/mpd/install
$(CP) $(PKG_INSTALL_DIR)/usr/bin/mpd $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc
$(CP) $(PKG_BUILD_DIR)/doc/mpdconf.example $(1)/etc/mpd.conf
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/mpd.init $(1)/etc/init.d/mpd
endef
define Package/mpd-full/install
$(call Package/mpd/install,$1)
$(INSTALL_DIR) $(1)/etc/avahi/services
$(INSTALL_DATA) ./files/mpd.service $(1)/etc/avahi/services/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/mpd.init $(1)/etc/init.d/mpd
endef
define Package/mpd-mini/install

View File

@ -1,26 +1,28 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2007-2010 OpenWrt.org
# Copyright (C) 2007-2011 OpenWrt.org
START=93
start() {
#create mpd directories
pld=`grep ^playlist_directory /etc/mpd.conf | cut -d "\"" -f 2 | sed "s/~/\/root/g"`
if [ ! -d $pld ]; then
mkdir -p $pld
mkdir -m 0755 -p $pld
fi
# Set the initial volume to something manageable
amixer set PCM 40
#start mpd
# Set the initial volume to something manageable
[ -x /usr/bin/amixer ] && /usr/bin/amixer set PCM 40
if [ -x /bin/nice ]; then
# This has real-time constraints, so let's at least tell the OS
# that this should have higher priority to avoid skipping
# when doing other things in the background.
nice="nice -n -10"
nice -n -10
fi
$nice /usr/bin/mpd
service_start /usr/bin/mpd
}
stop() {
killall mpd
service_stop /usr/bin/mpd
}