[package] avahi: Makefile fix to honor configuration changes

his patch is to fix a long-standing problem with avahi builds:
if you change the configuration, sometimes the relevant packages are not
correctly rebuilt; see, for example, ticket #11110.

Background: avahi can be built in two modes: with or without D-BUS support.
If you switch builds from one mode to the other and then back again, the
packages will not
always be rebuilt as required. For example, if you choose to build avahi (1)
without D-BUS support,
then (2) with D-BUS support and then (3) without D-BUS support, the packages
will not
be rebuilt the third time, and you'll be left with the packages
from the second build -- packages that require D-BUS support.

The patch works by deleting the ".build" file belonging to the mode not
currently chosen, so
that if that mode is chosen again in the future, its packages will always be
rebuilt.

A few small corrections to the explanatory text are included.

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

git-svn-id: svn://svn.openwrt.org/openwrt/packages@33472 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2012-09-19 15:09:30 +00:00
parent b7fd9fe387
commit 058c9ac1ab

View File

@ -8,15 +8,17 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
ifeq ($(BUILD_VARIANT),dbus) ifeq ($(BUILD_VARIANT),dbus)
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-dbus/$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/dbus/$(PKG_NAME)-$(PKG_VERSION)
PKG_ALT_DIR=$(BUILD_DIR)/$(PKG_NAME)/nodbus/$(PKG_NAME)-$(PKG_VERSION)
else else
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-nodbus/$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/nodbus/$(PKG_NAME)-$(PKG_VERSION)
PKG_ALT_DIR=$(BUILD_DIR)/$(PKG_NAME)/dbus/$(PKG_NAME)-$(PKG_VERSION)
endif endif
PKG_NAME:=avahi PKG_NAME:=avahi
PKG_VERSION:=0.6.31 PKG_VERSION:=0.6.31
PKG_RELEASE:=4 PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@ -68,8 +70,8 @@ $(call Package/avahi/Default/description)
The libavahi package contains the mDNS/DNS-SD shared libraries, The libavahi package contains the mDNS/DNS-SD shared libraries,
used by other programs. Specifically, it provides used by other programs. Specifically, it provides
libavahi-core and libavahi-common libraries. libavahi-core and libavahi-common libraries.
By default, it is compiled without D-Bus support, By default, it is built without D-Bus support,
i.e. the --disable-dbus compilation flag is set. i.e. the --disable-dbus configuration flag is set.
To enable D-Bus support, select the package To enable D-Bus support, select the package
libavahi-dbus-support. libavahi-dbus-support.
endef endef
@ -142,10 +144,10 @@ define Package/libavahi-dbus-support/description
$(call Package/libavahi/description) $(call Package/libavahi/description)
. .
The libavahi-dbus-support package enables The libavahi-dbus-support package enables
D-Bus support in libavahi, needed to support D-Bus support in avahi, needed to support
the libavahi-client library and avahi-utils. the libavahi-client library and avahi-utils.
Selecting this package modifies the contents of the Selecting this package modifies the build configuration
libavahi package by setting the --enable-dbus compilation flag; so that avahi packages are built with support for D-BUS enabled;
it does not generate a separate binary of its own. it does not generate a separate binary of its own.
It also automatically adds the D-Bus package to the build. It also automatically adds the D-Bus package to the build.
libavahi-dbus-support is selected automatically if you select libavahi-dbus-support is selected automatically if you select
@ -249,16 +251,20 @@ define Build/InstallDev
endef endef
define Package/libavahi-dbus-support/install define Package/libavahi-dbus-support/install
$(INSTALL_DIR) $(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
# The next line removes the ".build" file from the "other" build.
# The effect is that, if the other build is re-selected in the future,
# the build system will be forced to replace all the code in the
# installer packages, removing anything from the current build.
# "Other" means this: if the current build is "dbus", the other is "nodebus",
# and if the current build is "nodbus", the other is "dbus".
$(RM) -f $(PKG_ALT_DIR)/.built
$(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