avahi: factor out service files into own packages
authorMichael Heimpold <mhei@heimpold.de>
Mon, 8 Dec 2014 22:04:00 +0000 (23:04 +0100)
committerMichael Heimpold <mhei@heimpold.de>
Mon, 8 Dec 2014 22:04:00 +0000 (23:04 +0100)
This allows the user to select individual services to be announced
via Avahi.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
libs/avahi/Makefile

index ea4353be8c9afb71213f23b28af8bb102451c71f..9dc3270f5733dbc34afb4610d1156a009ff8583e 100644 (file)
@@ -18,7 +18,7 @@ endif
 
 PKG_NAME:=avahi
 PKG_VERSION:=0.6.31
-PKG_RELEASE:=7
+PKG_RELEASE:=8
 
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@@ -103,6 +103,7 @@ define Package/avahi-daemon
   DEPENDS:=+libavahi +libexpat +librt +libdaemon
   endif
   TITLE+= (daemon)
+  MENU:=1
 endef
 
 define Package/avahi-daemon/description
@@ -113,7 +114,39 @@ endef
 
 define Package/avahi-daemon/conffiles
 /etc/avahi/avahi-daemon.conf
+endef
+
+define Package/avahi-daemon-service-http
+  $(call Package/avahi/Default)
+  SUBMENU:=IP Addresses and Names
+  DEPENDS:=avahi-daemon
+  TITLE:=Announce HTTP service
+endef
+
+define Package/avahi-daemon-service-http/description
+$(call Package/avahi/Default/description)
+ .
+ This package contains the service definition for announcing HTTP service.
+endef
+
+define Package/avahi-daemon-service-http/conffiles
 /etc/avahi/services/http.service
+endef
+
+define Package/avahi-daemon-service-ssh
+  $(call Package/avahi/Default)
+  SUBMENU:=IP Addresses and Names
+  DEPENDS:=avahi-daemon
+  TITLE:=Announce SSH service
+endef
+
+define Package/avahi-daemon-service-ssh/description
+$(call Package/avahi/Default/description)
+ .
+ This package contains the service definition for announcing SSH service.
+endef
+
+define Package/avahi-daemon-service-ssh/conffiles
 /etc/avahi/services/ssh.service
 endef
 
@@ -322,6 +355,16 @@ define Package/avahi-daemon/install
        $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
 endef
 
+define Package/avahi-daemon-service-http/install
+       $(INSTALL_DIR) $(1)/etc/avahi/services
+       $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
+endef
+
+define Package/avahi-daemon-service-ssh/install
+       $(INSTALL_DIR) $(1)/etc/avahi/services
+       $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
+endef
+
 define Package/avahi-dnsconfd/install
        $(INSTALL_DIR) $(1)/etc/avahi
        $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
@@ -336,4 +379,6 @@ $(eval $(call BuildPackage,libavahi-dbus-support))
 $(eval $(call BuildPackage,libavahi))
 $(eval $(call BuildPackage,avahi-autoipd))
 $(eval $(call BuildPackage,avahi-daemon))
+$(eval $(call BuildPackage,avahi-daemon-service-http))
+$(eval $(call BuildPackage,avahi-daemon-service-ssh))
 $(eval $(call BuildPackage,avahi-dnsconfd))