avahi: cleanup / enhance

This patch updates the avahi Makefile to correct a number of errors. In
particular it handles the choice of D-BUS- or non-D-BUS-enabled packages
more consistently.

Packages that don't require D-BUS support are compiled with D-BUS
support disabled by default, keeping the build as small as possible.
Support for D-BUS can be selected if desired.

Selecting packages that require D-BUS support -- avahi-utils or
libavahi-client -- will automatically cause all packages to be built
with D-BUS support and will add the D-BUS package to the build.

Note that after this update, the D-BUS package will be needed as part of
the compilation environment, so it will be downloaded and compiled, but
it will not be added to the build unless the user has enabled D-BUS
support or has selected avahi-utils or the avahi-client library, both of
which need it.

Tested on trunk r29283.

Signed-off-by Mike Brady <mikebrady@eircom.net>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@29359 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
blogic 2011-11-30 12:44:08 +00:00
parent ac1bc5f090
commit 827825fd7f

View File

@ -7,17 +7,23 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
ifeq ($(BUILD_VARIANT),dbus)
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-dbus/$(PKG_NAME)-$(PKG_VERSION)
else
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-nodbus/$(PKG_NAME)-$(PKG_VERSION)
endif
PKG_NAME:=avahi PKG_NAME:=avahi
PKG_VERSION:=0.6.30 PKG_VERSION:=0.6.30
PKG_RELEASE:=2 PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://avahi.org/download/ PKG_SOURCE_URL:=http://avahi.org/download/
PKG_MD5SUM:=e4db89a2a403ff4c47d66ac66fad1f43 PKG_MD5SUM:=e4db89a2a403ff4c47d66ac66fad1f43
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DEPENDS:=libexpat libdaemon libgdbm intltool/host libpthread dbus
PKG_BUILD_DEPENDS:=libexpat libdaemon libgdbm intltool/host libpthread
PKG_FIXUP:=autoreconf PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=autogen.sh PKG_REMOVE_FILES:=autogen.sh
@ -25,22 +31,26 @@ PKG_REMOVE_FILES:=autogen.sh
PKG_INSTALL:=1 PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define Package/avahi/Default define Package/avahi/Default
SECTION:=net SECTION:=net
CATEGORY:=Network CATEGORY:=Network
TITLE:=mDNS/DNS-SD TITLE:=An mDNS/DNS-SD implementation
URL:=http://www.avahi.org/ URL:=http://www.avahi.org/
endef endef
define Package/avahi/Default/description define Package/avahi/Default/description
An mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf) implementation (library). Avahi is an mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf)
Avahi is a system which facilitates service discovery on a local network -- implementation (library). It facilitates
this means that you can plug your laptop or computer into a network and service discovery on a local network -- this means that
instantly be able to view other people who you can chat with, find printers you can plug your laptop or computer into a network and
to print to or find files being shared. This kind of technology is already instantly be able to view other people who you can chat with,
found in MacOS X (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf') find printers to print to or find files being shared.
This kind of technology is already found in MacOS X
(branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf')
and is very convenient. and is very convenient.
endef endef
@ -50,49 +60,25 @@ define Package/libavahi
CATEGORY:=Libraries CATEGORY:=Libraries
DEPENDS:=+libdaemon +libpthread +libgdbm DEPENDS:=+libdaemon +libpthread +libgdbm
TITLE+= (library) TITLE+= (library)
VARIANT:=nodbus
endef
define Package/libavahi-dbus
$(call Package/avahi/Default)
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libdaemon +libpthread +libgdbm +dbus
TITLE+= (library) (dbus)
VARIANT:=dbus
endef endef
define Package/libavahi/description define Package/libavahi/description
$(call Package/avahi/Default/description) $(call Package/avahi/Default/description)
. .
This package contains the mDNS/DNS-SD shared libraries, used by other programs. The libavahi package contains the mDNS/DNS-SD shared libraries,
Specifically, it provides libavahi-core and libavahi-common libraries. used by other programs. Specifically, it provides
This version is compiled without D-Bus support, i.e. the --disable-dbus libavahi-core and libavahi-common libraries.
compilation flag is set. By default, it is compiled without D-Bus support,
endef i.e. the --disable-dbus compilation flag is set.
To enable D-Bus support, select the package
define Package/libavahi-dbus/description libavahi-dbus-support.
$(call Package/avahi/Default/description)
.
This package contains the mDNS/DNS-SD shared libraries, used by other programs.
Specifically, it provides libavahi-core and libavahi-common libraries.
This version is compiled with D-Bus support
endef endef
define Package/avahi-autoipd define Package/avahi-autoipd
$(call Package/avahi/Default) $(call Package/avahi/Default)
SUBMENU:=IP Addresses and Names SUBMENU:=IP Addresses and Names
DEPENDS:=+libdaemon DEPENDS:=+libdaemon
TITLE:=IPv4LL address conf daemon TITLE:=IPv4LL network address configuration daemon
VARIANT:=nodbus
endef
define Package/avahi-autoipd-dbus
$(call Package/avahi/Default)
SUBMENU:=IP Addresses and Names
DEPENDS:=+libdaemon
TITLE:=IPv4LL address conf daemon (dbus)
VARIANT:=dbus
endef endef
define Package/avahi-autoipd/description define Package/avahi-autoipd/description
@ -103,20 +89,6 @@ $(call Package/avahi/Default/description)
from the link-local 169.254.0.0/16 range without the need for a central from the link-local 169.254.0.0/16 range without the need for a central
server. It is primarily intended to be used in ad-hoc networks which lack a server. It is primarily intended to be used in ad-hoc networks which lack a
DHCP server. DHCP server.
.
This verison is compile along with non-D-Bus version of libavahi.
endef
define Package/avahi-autoipd-dbus/description
$(call Package/avahi/Default/description)
.
This package implements IPv4LL, "Dynamic Configuration of IPv4 Link-Local
Addresses" (IETF RFC3927), a protocol for automatic IP address configuration
from the link-local 169.254.0.0/16 range without the need for a central
server. It is primarily intended to be used in ad-hoc networks which lack a
DHCP server.
.
This version is compiled along with the D-Bus version of libavahi.
endef endef
define Package/avahi-daemon define Package/avahi-daemon
@ -124,15 +96,6 @@ define Package/avahi-daemon
SUBMENU:=IP Addresses and Names SUBMENU:=IP Addresses and Names
DEPENDS:=+libavahi +libexpat DEPENDS:=+libavahi +libexpat
TITLE+= (daemon) TITLE+= (daemon)
VARIANT:=nodbus
endef
define Package/avahi-daemon-dbus
$(call Package/avahi/Default)
SUBMENU:=IP Addresses and Names
DEPENDS:=+libavahi-dbus +libexpat
TITLE+= (daemon) (dbus)
VARIANT:=dbus
endef endef
define Package/avahi-daemon/description define Package/avahi-daemon/description
@ -141,38 +104,17 @@ $(call Package/avahi/Default/description)
This package contains an mDNS/DNS-SD daemon. This package contains an mDNS/DNS-SD daemon.
endef endef
define Package/avahi-daemon-dbus/description
$(call Package/avahi/Default/description)
.
This package contains an mDNS/DNS-SD daemon with dbus support.
endef
define Package/avahi-daemon/conffiles define Package/avahi-daemon/conffiles
/etc/avahi/avahi-daemon.conf /etc/avahi/avahi-daemon.conf
/etc/avahi/services/http.service /etc/avahi/services/http.service
/etc/avahi/services/ssh.service /etc/avahi/services/ssh.service
endef endef
define Package/avahi-daemon-dbus/conffiles
/etc/avahi/avahi-daemon.conf
/etc/avahi/services/http.service
/etc/avahi/services/ssh.service
endef
define Package/avahi-dnsconfd define Package/avahi-dnsconfd
$(call Package/avahi/Default) $(call Package/avahi/Default)
SUBMENU:=IP Addresses and Names SUBMENU:=IP Addresses and Names
DEPENDS:=+libavahi DEPENDS:=+libavahi
TITLE:=A Unicast DNS server from mDNS/DNS-SD configuration daemon TITLE:=A Unicast DNS server from mDNS/DNS-SD configuration daemon
VARIANT:=nodbus
endef
define Package/avahi-dnsconfd-dbus
$(call Package/avahi/Default)
SUBMENU:=IP Addresses and Names
DEPENDS:=+libavahi-dbus
TITLE:=A Unicast DNS server from mDNS/DNS-SD configuration daemon with dbus support
VARIANT:=dbus
endef endef
define Package/avahi-dnsconfd/description define Package/avahi-dnsconfd/description
@ -181,36 +123,46 @@ $(call Package/avahi/Default/description)
This package contains a Unicast DNS server from mDNS/DNS-SD configuration This package contains a Unicast DNS server from mDNS/DNS-SD configuration
daemon, which may be used to configure conventional DNS servers using mDNS daemon, which may be used to configure conventional DNS servers using mDNS
in a DHCP-like fashion. Especially useful on IPv6. in a DHCP-like fashion. Especially useful on IPv6.
.
This version does not have D-Bus support.
endef endef
define Package/avahi-dnsconfd-dbus/description define Package/libavahi-dbus-support
$(call Package/avahi/Default/description) $(call Package/avahi/Default)
SECTION:=libs
CATEGORY:=Libraries
VARIANT:=dbus
DEPENDS:=+dbus +libavahi
TITLE+= (D-Bus support)
endef
define Package/libavahi-dbus-support/description
$(call Package/libavahi/description)
. .
This package contains a Unicast DNS server from mDNS/DNS-SD configuration The libavahi-dbus-support package enables
daemon, which may be used to configure conventional DNS servers using mDNS D-Bus support in libavahi, needed to support
in a DHCP-like fashion. Especially useful on IPv6. the libavahi-client library and avahi-utils.
. Selecting this package modifies the contents of the
This version has D-Bus support. libavahi package by setting the --enable-dbus compilation flag;
it does not generate a separate binary of its own.
It also automatically adds the D-Bus package to the build.
libavahi-dbus-support is selected automatically if you select
libavahi-client or avahi-utils.
endef endef
define Package/libavahi-client define Package/libavahi-client
$(call Package/avahi/Default) $(call Package/avahi/Default)
SECTION:=libs SECTION:=libs
CATEGORY:=Libraries CATEGORY:=Libraries
DEPENDS:=+libavahi-dbus DEPENDS:=+libavahi-dbus-support +avahi-daemon
TITLE+= (libavahi-client library) TITLE+= (libavahi-client library)
VARIANT:=dbus
endef endef
define Package/libavahi-client/description define Package/libavahi-client/description
$(call Package/avahi/Default/description) $(call Package/avahi/Default/description)
. .
This packages adds the libavahi-client library. This packages adds the libavahi-client library.
It also automatically adds the required
libavahi-dbus-support and the avahi-daemon packages.
For more information please see the avahi documentation. For more information please see the avahi documentation.
.
Requires D-Bus support.
endef endef
define Package/avahi-utils define Package/avahi-utils
@ -218,7 +170,6 @@ define Package/avahi-utils
SUBMENU:=IP Addresses and Names SUBMENU:=IP Addresses and Names
DEPENDS:=+libavahi-client DEPENDS:=+libavahi-client
TITLE+= (utilities) TITLE+= (utilities)
VARIANT:=dbus
endef endef
define Package/avahi-utils/description define Package/avahi-utils/description
@ -226,9 +177,8 @@ $(call Package/avahi/Default/description)
. .
This packages installs the following avahi utility programs: This packages installs the following avahi utility programs:
avahi-browse, avahi-publish, avahi-resolve, avahi-set-host-name. avahi-browse, avahi-publish, avahi-resolve, avahi-set-host-name.
It also automatically adds the required libavahi-client package.
For more information please see the avahi documentation. For more information please see the avahi documentation.
.
Requires D-Bus support.
endef endef
TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE
@ -276,8 +226,7 @@ endif
ifeq ($(BUILD_VARIANT),dbus) ifeq ($(BUILD_VARIANT),dbus)
CONFIGURE_ARGS += \ CONFIGURE_ARGS += \
--enable-dbus --enable-dbus
endif else
ifeq ($(BUILD_VARIANT),nodbus)
CONFIGURE_ARGS += \ CONFIGURE_ARGS += \
--disable-dbus --disable-dbus
endif endif
@ -294,16 +243,17 @@ define Build/InstallDev
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
endef endef
define Package/libavahi-dbus/install define Package/libavahi-dbus-support/install
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/etc/dbus-1/system.d
$(CP) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d
endef endef
define Package/libavahi/install define Package/libavahi/install
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
ifeq ($(BUILD_VARIANT),dbus)
$(INSTALL_DIR) $(1)/etc/dbus-1/system.d
$(CP) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d
endif
endef endef
define Package/libavahi-client/install define Package/libavahi-client/install
@ -335,18 +285,6 @@ define Package/avahi-daemon/install
$(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
endef endef
define Package/avahi-daemon-dbus/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/avahi
$(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/
$(INSTALL_DIR) $(1)/etc/avahi/services
$(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
$(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
endef
define Package/avahi-dnsconfd/install define Package/avahi-dnsconfd/install
$(INSTALL_DIR) $(1)/etc/avahi $(INSTALL_DIR) $(1)/etc/avahi
$(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/ $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
@ -354,21 +292,11 @@ define Package/avahi-dnsconfd/install
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
endef endef
define Package/avahi-dnsconfd-dbus/install
$(INSTALL_DIR) $(1)/etc/avahi
$(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,libavahi-client)) $(eval $(call BuildPackage,libavahi-client))
$(eval $(call BuildPackage,avahi-utils)) $(eval $(call BuildPackage,avahi-utils))
$(eval $(call BuildPackage,libavahi-dbus)) $(eval $(call BuildPackage,libavahi-dbus-support))
$(eval $(call BuildPackage,libavahi)) $(eval $(call BuildPackage,libavahi))
$(eval $(call BuildPackage,avahi-autoipd)) $(eval $(call BuildPackage,avahi-autoipd))
$(eval $(call BuildPackage,avahi-autoipd-dbus))
$(eval $(call BuildPackage,avahi-daemon)) $(eval $(call BuildPackage,avahi-daemon))
$(eval $(call BuildPackage,avahi-daemon-dbus))
$(eval $(call BuildPackage,avahi-dnsconfd)) $(eval $(call BuildPackage,avahi-dnsconfd))
$(eval $(call BuildPackage,avahi-dnsconfd-dbus))