2 # Copyright (C) 2007-2012 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
10 ifeq ($(BUILD_VARIANT),dbus)
11 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/dbus/$(PKG_NAME)-$(PKG_VERSION)
12 PKG_ALT_DIR=$(BUILD_DIR)/$(PKG_NAME)/nodbus/$(PKG_NAME)-$(PKG_VERSION)
14 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/nodbus/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_ALT_DIR=$(BUILD_DIR)/$(PKG_NAME)/dbus/$(PKG_NAME)-$(PKG_VERSION)
24 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
25 PKG_SOURCE_URL:=http://avahi.org/download/
26 PKG_MD5SUM:=2f22745b8f7368ad5a0a3fddac343f2d
28 PKG_BUILD_DEPENDS:=libexpat libdaemon libgdbm intltool/host libpthread dbus
31 PKG_REMOVE_FILES:=autogen.sh
38 include $(INCLUDE_DIR)/package.mk
40 define Package/avahi/Default
43 TITLE:=An mDNS/DNS-SD implementation
44 URL:=http://www.avahi.org/
47 define Package/avahi/Default/description
48 Avahi is an mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf)
49 implementation (library). It facilitates
50 service discovery on a local network -- this means that
51 you can plug your laptop or computer into a network and
52 instantly be able to view other people who you can chat with,
53 find printers to print to or find files being shared.
54 This kind of technology is already found in MacOS X
55 (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf')
56 and is very convenient.
59 define Package/libavahi
60 $(call Package/avahi/Default)
63 DEPENDS:=+libpthread +SSP_SUPPORT:libssp
67 define Package/libavahi/description
68 $(call Package/avahi/Default/description)
70 The libavahi package contains the mDNS/DNS-SD shared libraries,
71 used by other programs. Specifically, it provides
72 libavahi-core and libavahi-common libraries.
73 By default, it is built without D-Bus support,
74 i.e. the --disable-dbus configuration flag is set.
75 To enable D-Bus support, select the package
76 libavahi-dbus-support.
79 define Package/avahi-autoipd
80 $(call Package/avahi/Default)
81 SUBMENU:=IP Addresses and Names
83 TITLE:=IPv4LL network address configuration daemon
86 define Package/avahi-autoipd/description
87 $(call Package/avahi/Default/description)
89 This package implements IPv4LL, "Dynamic Configuration of IPv4 Link-Local
90 Addresses" (IETF RFC3927), a protocol for automatic IP address configuration
91 from the link-local 169.254.0.0/16 range without the need for a central
92 server. It is primarily intended to be used in ad-hoc networks which lack a
96 define Package/avahi-daemon
97 $(call Package/avahi/Default)
98 SUBMENU:=IP Addresses and Names
99 ifeq ($(BUILD_VARIANT),dbus)
100 DEPENDS:=+libavahi +libexpat +librt +libdaemon +libdbus
102 DEPENDS:=+libavahi +libexpat +librt +libdaemon
107 define Package/avahi-daemon/description
108 $(call Package/avahi/Default/description)
110 This package contains an mDNS/DNS-SD daemon.
113 define Package/avahi-daemon/conffiles
114 /etc/avahi/avahi-daemon.conf
115 /etc/avahi/services/http.service
116 /etc/avahi/services/ssh.service
119 define Package/avahi-dnsconfd
120 $(call Package/avahi/Default)
121 SUBMENU:=IP Addresses and Names
122 DEPENDS:=+libavahi +libdaemon
123 TITLE:=A Unicast DNS server from mDNS/DNS-SD configuration daemon
126 define Package/avahi-dnsconfd/description
127 $(call Package/avahi/Default/description)
129 This package contains a Unicast DNS server from mDNS/DNS-SD configuration
130 daemon, which may be used to configure conventional DNS servers using mDNS
131 in a DHCP-like fashion. Especially useful on IPv6.
134 define Package/libavahi-dbus-support
135 $(call Package/avahi/Default)
139 DEPENDS:=+dbus +libavahi
140 TITLE+= (D-Bus support)
143 define Package/libavahi-dbus-support/description
144 $(call Package/libavahi/description)
146 The libavahi-dbus-support package enables
147 D-Bus support in avahi, needed to support
148 the libavahi-client library and avahi-utils.
149 Selecting this package modifies the build configuration
150 so that avahi packages are built with support for D-BUS enabled;
151 it does not generate a separate binary of its own.
152 It also automatically adds the D-Bus package to the build.
153 libavahi-dbus-support is selected automatically if you select
154 libavahi-client or avahi-utils.
157 define Package/libavahi-client
158 $(call Package/avahi/Default)
161 DEPENDS:=+libavahi-dbus-support +avahi-daemon
162 TITLE+= (libavahi-client library)
165 define Package/libavahi-client/description
166 $(call Package/avahi/Default/description)
168 This packages adds the libavahi-client library.
169 It also automatically adds the required
170 libavahi-dbus-support and the avahi-daemon packages.
171 For more information please see the avahi documentation.
174 define Package/avahi-utils
175 $(call Package/avahi/Default)
176 SUBMENU:=IP Addresses and Names
177 DEPENDS:=+libavahi-client +libgdbm
181 define Package/avahi-utils/description
182 $(call Package/avahi/Default/description)
184 This packages installs the following avahi utility programs:
185 avahi-browse, avahi-publish, avahi-resolve, avahi-set-host-name.
186 It also automatically adds the required libavahi-client package.
187 For more information please see the avahi documentation.
190 TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE
207 --disable-python-dbus \
210 --disable-doxygen-doc \
211 --disable-doxygen-dot \
212 --disable-doxygen-man \
213 --disable-doxygen-rtf \
214 --disable-doxygen-xml \
215 --disable-doxygen-chm \
216 --disable-doxygen-chi \
217 --disable-doxygen-html \
218 --disable-doxygen-ps \
219 --disable-doxygen-pdf \
222 --with-avahi-user=nobody \
223 --with-avahi-group=nogroup \
224 --with-autoipd-user=nobody \
225 --with-autoipd-group=nogroup
227 ifneq ($(CONFIG_SSP_SUPPORT),y)
229 --disable-stack-protector
232 ifeq ($(BUILD_VARIANT),dbus)
241 CFLAGS="$$$$CFLAGS -DNDEBUG -DDISABLE_SYSTEMD" \
242 ac_cv_header_sys_capability_h=no \
244 define Build/InstallDev
245 $(INSTALL_DIR) $(1)/usr/include
246 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
247 $(INSTALL_DIR) $(1)/usr/lib
248 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-* $(1)/usr/lib/
249 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
250 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
253 define Package/libavahi-dbus-support/install
254 $(INSTALL_DIR) $(1)/etc/dbus-1/system.d
255 $(CP) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d
258 define Package/libavahi/install
259 # The next line removes the ".build" file from the "other" build.
260 # The effect is that, if the other build is re-selected in the future,
261 # the build system will be forced to replace all the code in the
262 # installer packages, removing anything from the current build.
263 # "Other" means this: if the current build is "dbus", the other is "nodebus",
264 # and if the current build is "nodbus", the other is "dbus".
265 $(RM) -f $(PKG_ALT_DIR)/.built
266 $(INSTALL_DIR) $(1)/usr/lib
267 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
270 define Package/libavahi-client/install
271 $(INSTALL_DIR) $(1)/usr/lib
272 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/
275 define Package/avahi-utils/install
276 $(INSTALL_DIR) $(1)/usr/bin
277 $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
280 define Package/avahi-autoipd/install
281 $(INSTALL_DIR) $(1)/etc/avahi
282 $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
283 $(INSTALL_DIR) $(1)/usr/sbin
284 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
287 define Package/avahi-daemon/install
288 $(INSTALL_DIR) $(1)/usr/sbin
289 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
290 $(INSTALL_DIR) $(1)/etc/avahi
291 $(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/
292 $(INSTALL_DIR) $(1)/etc/avahi/services
293 $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
294 $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
295 $(INSTALL_DIR) $(1)/etc/init.d
296 $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
299 define Package/avahi-dnsconfd/install
300 $(INSTALL_DIR) $(1)/etc/avahi
301 $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
302 $(INSTALL_DIR) $(1)/usr/sbin
303 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
306 $(eval $(call BuildPackage,libavahi-client))
307 $(eval $(call BuildPackage,avahi-utils))
308 $(eval $(call BuildPackage,libavahi-dbus-support))
309 $(eval $(call BuildPackage,libavahi))
310 $(eval $(call BuildPackage,avahi-autoipd))
311 $(eval $(call BuildPackage,avahi-daemon))
312 $(eval $(call BuildPackage,avahi-dnsconfd))