[package] update avahi to included D-Bus support, libavahi-client library and avahi...
[openwrt/svn-archive/archive.git] / libs / avahi / Makefile
1 #
2 # Copyright (C) 2007-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=avahi
11 PKG_VERSION:=0.6.29
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://avahi.org/download/
16 PKG_MD5SUM:=bb9d326770689610d1dbaceab5a787fc
17
18 PKG_BUILD_DEPENDS:=libexpat libdaemon libgdbm intltool/host libpthread dbus
19
20 PKG_FIXUP:=autoreconf
21 PKG_REMOVE_FILES:=autogen.sh
22
23 PKG_INSTALL:=1
24 PKG_BUILD_PARALLEL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/avahi/Default
29 SECTION:=net
30 CATEGORY:=Network
31 TITLE:=An mDNS/DNS-SD implementation
32 URL:=http://www.avahi.org/
33 endef
34
35 define Package/avahi/Default/description
36 An mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf) implementation (library).
37 Avahi is a system which facilitates service discovery on a local network --
38 this means that you can plug your laptop or computer into a network and
39 instantly be able to view other people who you can chat with, find printers
40 to print to or find files being shared. This kind of technology is already
41 found in MacOS X (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf')
42 and is very convenient.
43 endef
44
45 define Package/libavahi
46 $(call Package/avahi/Default)
47 SECTION:=libs
48 CATEGORY:=Libraries
49 DEPENDS:=+libdaemon +libpthread +libgdbm
50 TITLE+= (library)
51 endef
52
53 define Package/libavahi/description
54 $(call Package/avahi/Default/description)
55 .
56 This package contains the mDNS/DNS-SD shared libraries, used by other programs.
57 Specifically, it provides libavahi-core and libavahi-common libraries.
58 By default, it is compiled without D-Bus support, i.e. the --disable-dbus compilation flag is set.
59 To enable D-Bus support, add the package libavahi-dbus-support.
60 endef
61
62 define Package/avahi-autoipd
63 $(call Package/avahi/Default)
64 SUBMENU:=IP Addresses and Names
65 DEPENDS:=+libdaemon
66 TITLE:=IPv4LL network address configuration daemon
67 endef
68
69 define Package/avahi-autoipd/description
70 $(call Package/avahi/Default/description)
71 .
72 This package implements IPv4LL, "Dynamic Configuration of IPv4 Link-Local
73 Addresses" (IETF RFC3927), a protocol for automatic IP address configuration
74 from the link-local 169.254.0.0/16 range without the need for a central
75 server. It is primarily intended to be used in ad-hoc networks which lack a
76 DHCP server.
77 endef
78
79 define Package/avahi-daemon
80 $(call Package/avahi/Default)
81 SUBMENU:=IP Addresses and Names
82 DEPENDS:=+libavahi +libexpat
83 TITLE+= (daemon)
84 endef
85
86 define Package/avahi-daemon/description
87 $(call Package/avahi/Default/description)
88 .
89 This package contains an mDNS/DNS-SD daemon.
90 endef
91
92 define Package/avahi-daemon/conffiles
93 /etc/avahi/avahi-daemon.conf
94 /etc/avahi/services/http.service
95 /etc/avahi/services/ssh.service
96 endef
97
98 define Package/avahi-dnsconfd
99 $(call Package/avahi/Default)
100 SUBMENU:=IP Addresses and Names
101 DEPENDS:=+libavahi
102 TITLE:=A Unicast DNS server from mDNS/DNS-SD configuration daemon
103 endef
104
105 define Package/avahi-dnsconfd/description
106 $(call Package/avahi/Default/description)
107 .
108 This package contains an Unicast DNS server from mDNS/DNS-SD configuration
109 daemon, which may be used to configure conventional DNS servers using mDNS
110 in a DHCP-like fashion. Especially useful on IPv6.
111 endef
112
113 define Package/libavahi-dbus-support
114 $(call Package/avahi/Default)
115 SECTION:=libs
116 CATEGORY:=Libraries
117 VARIANT:=dbus
118 DEPENDS:=+dbus +libavahi
119 TITLE+= (D-Bus support for advanced features)
120 endef
121
122 define Package/libavahi-dbus-support/description
123 $(call Package/libavahi/description)
124 .
125 This package enables D-Bus support in libavahi. This is needed for libavahi to
126 provide advanced features -- support for avahi-browse, avahi-publish
127 and the libavahi-client library.
128 It requires the D-Bus package to be included in the build.
129 Selecting this modifies the contents of the libavahi package by setting
130 the --enable-dbuscompilation flag; it does not generate a separate package of its own.
131 endef
132
133 define Package/libavahi-client
134 $(call Package/avahi/Default)
135 SECTION:=libs
136 CATEGORY:=Libraries
137 DEPENDS:=+libavahi-dbus-support
138 TITLE+= (libavahi-client library)
139 endef
140
141 define Package/libavahi-client/description
142 $(call Package/avahi/Default/description)
143 .
144 This packages adds the libavahi-client library.
145 For more information please see the avahi documentation.
146 endef
147
148 define Package/avahi-utils
149 $(call Package/avahi/Default)
150 SUBMENU:=IP Addresses and Names
151 DEPENDS:=+libavahi-client
152 TITLE+= (utilities)
153 endef
154
155 define Package/avahi-utils/description
156 $(call Package/avahi/Default/description)
157 .
158 This packages installs the following avahi utility programs:
159 avahi-browse, avahi-publish, avahi-resolve, avahi-set-host-name.
160 For more information please see the avahi documentation.
161 endef
162
163 TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE
164
165 CONFIGURE_ARGS+= \
166 --enable-shared \
167 --enable-static \
168 --disable-glib \
169 --disable-gobject \
170 --disable-qt3 \
171 --disable-qt4 \
172 --disable-gtk \
173 --disable-gtk3 \
174 --with-xml=expat \
175 --disable-dbm \
176 --enable-gdbm \
177 --enable-libdaemon \
178 --disable-python \
179 --disable-pygtk \
180 --disable-python-dbus \
181 --disable-mono \
182 --disable-monodoc \
183 --disable-doxygen-doc \
184 --disable-doxygen-dot \
185 --disable-doxygen-man \
186 --disable-doxygen-rtf \
187 --disable-doxygen-xml \
188 --disable-doxygen-chm \
189 --disable-doxygen-chi \
190 --disable-doxygen-html \
191 --disable-doxygen-ps \
192 --disable-doxygen-pdf \
193 --disable-xmltoman \
194 --with-distro=none \
195 --with-avahi-user=nobody \
196 --with-avahi-group=nogroup \
197 --with-autoipd-user=nobody \
198 --with-autoipd-group=nogroup
199
200 ifneq ($(CONFIG_SSP_SUPPORT),y)
201 CONFIGURE_ARGS+= \
202 --disable-stack-protector
203 endif
204
205 ifeq ($(BUILD_VARIANT),dbus)
206 CONFIGURE_ARGS += \
207 --enable-dbus
208 else
209 CONFIGURE_ARGS += \
210 --disable-dbus
211 endif
212
213 CONFIGURE_VARS+= \
214 CFLAGS="$$$$CFLAGS -DNDEBUG -DDISABLE_SYSTEMD" \
215
216 define Build/InstallDev
217 $(INSTALL_DIR) $(1)/usr/include
218 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
219 $(INSTALL_DIR) $(1)/usr/lib
220 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-* $(1)/usr/lib/
221 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
222 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
223 endef
224
225 define Package/libavahi-dbus-support/install
226 $(INSTALL_DIR) $(1)/usr/lib
227 endef
228
229 define Package/libavahi/install
230 $(INSTALL_DIR) $(1)/usr/lib
231 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
232 ifeq ($(BUILD_VARIANT),dbus)
233 $(INSTALL_DIR) $(1)/etc/dbus-1/system.d
234 $(CP) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d
235 endif
236 endef
237
238 define Package/libavahi-client/install
239 $(INSTALL_DIR) $(1)/usr/lib
240 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/
241 endef
242
243 define Package/avahi-utils/install
244 $(INSTALL_DIR) $(1)/usr/bin
245 $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
246 endef
247
248 define Package/avahi-autoipd/install
249 $(INSTALL_DIR) $(1)/etc/avahi
250 $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
251 $(INSTALL_DIR) $(1)/usr/sbin
252 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
253 endef
254
255 define Package/avahi-daemon/install
256 $(INSTALL_DIR) $(1)/usr/sbin
257 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
258 $(INSTALL_DIR) $(1)/etc/avahi
259 $(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/
260 $(INSTALL_DIR) $(1)/etc/avahi/services
261 $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
262 $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
263 $(INSTALL_DIR) $(1)/etc/init.d
264 $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
265 endef
266
267 define Package/avahi-dnsconfd/install
268 $(INSTALL_DIR) $(1)/etc/avahi
269 $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
270 $(INSTALL_DIR) $(1)/usr/sbin
271 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
272 endef
273
274 $(eval $(call BuildPackage,libavahi-client))
275 $(eval $(call BuildPackage,avahi-utils))
276 $(eval $(call BuildPackage,libavahi-dbus-support))
277 $(eval $(call BuildPackage,libavahi))
278 $(eval $(call BuildPackage,avahi-autoipd))
279 $(eval $(call BuildPackage,avahi-daemon))
280 $(eval $(call BuildPackage,avahi-dnsconfd))
281