PKG_NAME:=mpd
PKG_VERSION:=0.22.6
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.musicpd.org/download/mpd/0.22/
URL:=https://www.musicpd.org/
DEPENDS:= +zlib +libcurl +libpthread +libmpdclient +boost $(ICONV_DEPENDS) \
+AUDIO_SUPPORT:alsa-lib +libexpat +libflac +libid3tag +libfaad2 +libopus
+ USERID:=mpd:mpd
endef
define Package/mpd/Default/description
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mpd $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc
- $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/mpdconf.example $(1)/etc/mpd.conf
+ $(INSTALL_DATA) $(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
CONFIGFILE=/etc/mpd.conf
NICEPRIO=-10
+USER="mpd"
+GROUP="mpd"
+
#TODO: Add uci config - nice, config
start_service() {
#create mpd directories from config
pld=$(grep ^playlist_directory "$CONFIGFILE" | cut -d "\"" -f 2 | sed "s/~/\/root/g")
- [ -d "$pld" ] || mkdir -m 0755 -p "$pld"
+ if [ ! -d "$pld" ]; then
+ mkdir -m 0755 -p "$pld"
+ chown $USER:$GROUP $pld
+ fi
lport=$(grep ^port "$CONFIGFILE" | cut -d "\"" -f 2)
[ -z "$lport" ] && lport=6600
procd_open_instance
procd_add_mdns "mpd" "tcp" "$lport"
procd_set_param command "$PROG" --no-daemon "$CONFIGFILE"
+ procd_set_param user "$USER"
+ procd_set_param group "$GROUP"
procd_set_param stderr 1
# Give MPD some real-time priority
procd_set_param nice "$NICEPRIO"