Selaa lähdekoodia

package/avahi: add option to enable/disable default services

By default, Avahi installs service definitions for SSH and SFTP, but
those might not be present on all systems. This commit adds an option
to control the installation of those Avahi services. Even though that
potentially breaks backward compatibility with older configuration, we
have chosen to make the option default to disable, which means that
now the SSH and SFTP avahi services are no longer installed by
default.

As there is no way to tell the Avahi package not to install the
service files in the first place, we have to manually remove them from
the target directory.

Signed-off-by: Florian Larysch <fl@n621.de>
[Thomas: make the option default to disabled, fix small formatting issues.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Florian Larysch 4 vuotta sitten
vanhempi
commit
ebce685e1d
2 muutettua tiedostoa jossa 16 lisäystä ja 0 poistoa
  1. 7 0
      package/avahi/Config.in
  2. 9 0
      package/avahi/avahi.mk

+ 7 - 0
package/avahi/Config.in

@@ -42,6 +42,13 @@ config BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY
 	  Enable the libdns_sd (Bonjour) compatibility library support
 	  for legacy applications.
 
+config BR2_PACKAGE_AVAHI_DEFAULT_SERVICES
+	bool "install default service definitions"
+	depends on BR2_PACKAGE_AVAHI_DAEMON
+	help
+	  Install the SSH/SFTP service definitions included with the
+	  Avahi daemon by default.
+
 endif
 
 comment "avahi needs a toolchain w/ threads"

+ 9 - 0
package/avahi/avahi.mk

@@ -193,4 +193,13 @@ endef
 AVAHI_POST_INSTALL_STAGING_HOOKS += AVAHI_STAGING_INSTALL_LIBDNSSD_LINK
 endif
 
+ifeq ($(BR2_PACKAGE_AVAHI_DEFAULT_SERVICES),)
+define AVAHI_REMOVE_DEFAULT_SERVICES
+	$(foreach service,ssh sftp-ssh, \
+		$(RM) -f $(TARGET_DIR)/etc/avahi/services/$(service).service
+	)
+endef
+AVAHI_POST_INSTALL_TARGET_HOOKS += AVAHI_REMOVE_DEFAULT_SERVICES
+endif
+
 $(eval $(autotools-package))