mpd: factor out avahi service file 618/head
authorMichael Heimpold <mhei@heimpold.de>
Mon, 8 Dec 2014 22:11:20 +0000 (23:11 +0100)
committerMichael Heimpold <mhei@heimpold.de>
Mon, 8 Dec 2014 22:15:25 +0000 (23:15 +0100)
As discussed in #543 provide the avahi service file within its own
tiny package to allow the user to choose which services are
announced.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
---

The former avahi service file was only installed for mpd-full. Does
the mpd-mini does not support network functionality?

Then we should adjust deps here...

sound/mpd/Makefile
sound/mpd/files/mpd.service

index 9146a844382771ecf191f3d8c4ab09add71a30c1..8b36a4701b88231e703e5be699a89038f1fb5ae8 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mpd
 PKG_VERSION:=0.18.16
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.musicpd.org/download/mpd/0.18/
@@ -63,7 +63,6 @@ $(call Package/mpd/Default/description)
 endef
 
 define Package/mpd-full/conffiles
-/etc/avahi/services/mpd.service
 /etc/mpd.conf
 endef
 
@@ -85,6 +84,23 @@ define Package/mpd-mini/conffiles
 /etc/mpd.conf
 endef
 
+define Package/mpd-avahi-service
+$(call Package/mpd/Default)
+  TITLE+= (Avahi service)
+  DEPENDS+=+avahi-daemon
+endef
+
+define Package/mpd-avahi-service/description
+$(call Package/mpd/Default/description)
+ .
+ This package contains the service definition for announcing the
+ Music Player Daemon service via mDNS/DNS-SD.
+endef
+
+define Package/mpd-avahi-service/conffiles
+/etc/avahi/services/mpd.service
+endef
+
 CONFIGURE_ARGS += \
        $(call autoconf_bool,CONFIG_IPV6,ipv6) \
        --disable-debug \
@@ -198,13 +214,17 @@ 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/
 endef
 
 define Package/mpd-mini/install
 $(call Package/mpd/install,$1)
 endef
 
+define Package/mpd-avahi-service/install
+       $(INSTALL_DIR) $(1)/etc/avahi/services
+       $(INSTALL_DATA) ./files/mpd.service $(1)/etc/avahi/services/
+endef
+
 $(eval $(call BuildPackage,mpd-full))
 $(eval $(call BuildPackage,mpd-mini))
+$(eval $(call BuildPackage,mpd-avahi-service))
index 086a2bb3fc53ebe2d9e203652ab7f3d672e64578..a545f240f37f7a412720928ed662cdeb0e110086 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" standalone='no'?><!--*-nxml-*-->
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <service-group>
- <name replace-wildcards="yes">Music Player Daemon on %h</name>
+ <name replace-wildcards="yes">%h</name>
   <service>
    <type>_mpd._tcp</type>
    <port>6600</port>