avahi: factor out service files into own packages
[feed/packages.git] / libs / avahi / Makefile
1 #
2 # Copyright (C) 2007-2014 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 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)
13 else
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)
16 endif
17
18
19 PKG_NAME:=avahi
20 PKG_VERSION:=0.6.31
21 PKG_RELEASE:=8
22
23
24 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
25 PKG_SOURCE_URL:=http://avahi.org/download/
26 PKG_MD5SUM:=2f22745b8f7368ad5a0a3fddac343f2d
27 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
28
29 PKG_BUILD_DEPENDS:=libexpat libdaemon libgdbm intltool/host libpthread dbus
30
31 PKG_FIXUP:=autoreconf
32 PKG_REMOVE_FILES:=autogen.sh
33
34 PKG_INSTALL:=1
35 PKG_BUILD_PARALLEL:=1
36
37
38
39 include $(INCLUDE_DIR)/package.mk
40
41 define Package/avahi/Default
42 SECTION:=net
43 CATEGORY:=Network
44 TITLE:=An mDNS/DNS-SD implementation
45 URL:=http://www.avahi.org/
46 endef
47
48 define Package/avahi/Default/description
49 Avahi is an mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf)
50 implementation (library). It facilitates
51 service discovery on a local network -- this means that
52 you can plug your laptop or computer into a network and
53 instantly be able to view other people who you can chat with,
54 find printers to print to or find files being shared.
55 This kind of technology is already found in MacOS X
56 (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf')
57 and is very convenient.
58 endef
59
60 define Package/libavahi
61 $(call Package/avahi/Default)
62 SECTION:=libs
63 CATEGORY:=Libraries
64 DEPENDS:=+libpthread +SSP_SUPPORT:libssp
65 TITLE+= (library)
66 endef
67
68 define Package/libavahi/description
69 $(call Package/avahi/Default/description)
70 .
71 The libavahi package contains the mDNS/DNS-SD shared libraries,
72 used by other programs. Specifically, it provides
73 libavahi-core and libavahi-common libraries.
74 By default, it is built without D-Bus support,
75 i.e. the --disable-dbus configuration flag is set.
76 To enable D-Bus support, select the package
77 libavahi-dbus-support.
78 endef
79
80 define Package/avahi-autoipd
81 $(call Package/avahi/Default)
82 SUBMENU:=IP Addresses and Names
83 DEPENDS:=+libdaemon
84 TITLE:=IPv4LL network address configuration daemon
85 endef
86
87 define Package/avahi-autoipd/description
88 $(call Package/avahi/Default/description)
89 .
90 This package implements IPv4LL, "Dynamic Configuration of IPv4 Link-Local
91 Addresses" (IETF RFC3927), a protocol for automatic IP address configuration
92 from the link-local 169.254.0.0/16 range without the need for a central
93 server. It is primarily intended to be used in ad-hoc networks which lack a
94 DHCP server.
95 endef
96
97 define Package/avahi-daemon
98 $(call Package/avahi/Default)
99 SUBMENU:=IP Addresses and Names
100 ifeq ($(BUILD_VARIANT),dbus)
101 DEPENDS:=+libavahi +libexpat +librt +libdaemon +libdbus
102 else
103 DEPENDS:=+libavahi +libexpat +librt +libdaemon
104 endif
105 TITLE+= (daemon)
106 MENU:=1
107 endef
108
109 define Package/avahi-daemon/description
110 $(call Package/avahi/Default/description)
111 .
112 This package contains an mDNS/DNS-SD daemon.
113 endef
114
115 define Package/avahi-daemon/conffiles
116 /etc/avahi/avahi-daemon.conf
117 endef
118
119 define Package/avahi-daemon-service-http
120 $(call Package/avahi/Default)
121 SUBMENU:=IP Addresses and Names
122 DEPENDS:=avahi-daemon
123 TITLE:=Announce HTTP service
124 endef
125
126 define Package/avahi-daemon-service-http/description
127 $(call Package/avahi/Default/description)
128 .
129 This package contains the service definition for announcing HTTP service.
130 endef
131
132 define Package/avahi-daemon-service-http/conffiles
133 /etc/avahi/services/http.service
134 endef
135
136 define Package/avahi-daemon-service-ssh
137 $(call Package/avahi/Default)
138 SUBMENU:=IP Addresses and Names
139 DEPENDS:=avahi-daemon
140 TITLE:=Announce SSH service
141 endef
142
143 define Package/avahi-daemon-service-ssh/description
144 $(call Package/avahi/Default/description)
145 .
146 This package contains the service definition for announcing SSH service.
147 endef
148
149 define Package/avahi-daemon-service-ssh/conffiles
150 /etc/avahi/services/ssh.service
151 endef
152
153 define Package/avahi-dnsconfd
154 $(call Package/avahi/Default)
155 SUBMENU:=IP Addresses and Names
156 DEPENDS:=+libavahi +libdaemon
157 TITLE:=A Unicast DNS server from mDNS/DNS-SD configuration daemon
158 endef
159
160 define Package/avahi-dnsconfd/description
161 $(call Package/avahi/Default/description)
162 .
163 This package contains a Unicast DNS server from mDNS/DNS-SD configuration
164 daemon, which may be used to configure conventional DNS servers using mDNS
165 in a DHCP-like fashion. Especially useful on IPv6.
166 endef
167
168 define Package/libavahi-dbus-support
169 $(call Package/avahi/Default)
170 SECTION:=libs
171 CATEGORY:=Libraries
172 VARIANT:=dbus
173 DEPENDS:=+dbus +libavahi
174 TITLE+= (D-Bus support)
175 endef
176
177 define Package/libavahi-dbus-support/description
178 $(call Package/libavahi/description)
179 .
180 The libavahi-dbus-support package enables
181 D-Bus support in avahi, needed to support
182 the libavahi-client library and avahi-utils.
183 Selecting this package modifies the build configuration
184 so that avahi packages are built with support for D-BUS enabled;
185 it does not generate a separate binary of its own.
186 It also automatically adds the D-Bus package to the build.
187 libavahi-dbus-support is selected automatically if you select
188 libavahi-client or avahi-utils.
189 endef
190
191 define Package/libavahi-client
192 $(call Package/avahi/Default)
193 SECTION:=libs
194 CATEGORY:=Libraries
195 DEPENDS:=+libavahi-dbus-support +avahi-daemon
196 TITLE+= (libavahi-client library)
197 endef
198
199 define Package/libavahi-client/description
200 $(call Package/avahi/Default/description)
201 .
202 This packages adds the libavahi-client library.
203 It also automatically adds the required
204 libavahi-dbus-support and the avahi-daemon packages.
205 For more information please see the avahi documentation.
206 endef
207
208 define Package/libavahi-compat-libdnssd
209 $(call Package/avahi/Default)
210 SECTION:=libs
211 CATEGORY:=Libraries
212 DEPENDS:=+libavahi-client
213 TITLE+= (libdnssd)
214 endef
215
216 define Package/libavahi-compat-libdnssd/description
217 $(call Package/avahi/Default/description)
218 .
219 This packages adds the libavahi-compat-libdnssd library.
220 It also automatically adds the required libavahi-client package.
221 For more information please see the avahi documentation.
222 endef
223
224 define Package/avahi-utils
225 $(call Package/avahi/Default)
226 SUBMENU:=IP Addresses and Names
227 DEPENDS:=+libavahi-client +libgdbm
228 TITLE+= (utilities)
229 endef
230
231 define Package/avahi-utils/description
232 $(call Package/avahi/Default/description)
233 .
234 This packages installs the following avahi utility programs:
235 avahi-browse, avahi-publish, avahi-resolve, avahi-set-host-name.
236 It also automatically adds the required libavahi-client package.
237 For more information please see the avahi documentation.
238 endef
239
240 TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE
241
242 CONFIGURE_ARGS+= \
243 --enable-shared \
244 --enable-static \
245 --disable-glib \
246 --disable-gobject \
247 --disable-qt3 \
248 --disable-qt4 \
249 --disable-gtk \
250 --disable-gtk3 \
251 --with-xml=expat \
252 --disable-dbm \
253 --enable-gdbm \
254 --enable-libdaemon \
255 $(if $(CONFIG_PACKAGE_libavahi-compat-libdnssd),--enable-compat-libdns_sd) \
256 --disable-python \
257 --disable-pygtk \
258 --disable-python-dbus \
259 --disable-mono \
260 --disable-monodoc \
261 --disable-doxygen-doc \
262 --disable-doxygen-dot \
263 --disable-doxygen-man \
264 --disable-doxygen-rtf \
265 --disable-doxygen-xml \
266 --disable-doxygen-chm \
267 --disable-doxygen-chi \
268 --disable-doxygen-html \
269 --disable-doxygen-ps \
270 --disable-doxygen-pdf \
271 --disable-xmltoman \
272 --with-distro=none \
273 --with-avahi-user=nobody \
274 --with-avahi-group=nogroup \
275 --with-autoipd-user=nobody \
276 --with-autoipd-group=nogroup
277
278 ifneq ($(CONFIG_SSP_SUPPORT),y)
279 CONFIGURE_ARGS+= \
280 --disable-stack-protector
281 endif
282
283 ifeq ($(BUILD_VARIANT),dbus)
284 CONFIGURE_ARGS += \
285 --enable-dbus
286 else
287 CONFIGURE_ARGS += \
288 --disable-dbus
289 endif
290
291 CONFIGURE_VARS+= \
292 CFLAGS="$$$$CFLAGS -DNDEBUG -DDISABLE_SYSTEMD" \
293 ac_cv_header_sys_capability_h=no \
294
295 define Build/InstallDev
296 $(INSTALL_DIR) $(1)/usr/include
297 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
298 $(INSTALL_DIR) $(1)/usr/lib
299 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-* $(1)/usr/lib/
300 ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
301 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd* $(1)/usr/lib/
302 endif
303 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
304 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
305 endef
306
307 define Package/libavahi-dbus-support/install
308 $(INSTALL_DIR) $(1)/etc/dbus-1/system.d
309 $(CP) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d
310 endef
311
312 define Package/libavahi/install
313 # The next line removes the ".build" file from the "other" build.
314 # The effect is that, if the other build is re-selected in the future,
315 # the build system will be forced to replace all the code in the
316 # installer packages, removing anything from the current build.
317 # "Other" means this: if the current build is "dbus", the other is "nodebus",
318 # and if the current build is "nodbus", the other is "dbus".
319 $(RM) -f $(PKG_ALT_DIR)/.built
320 $(INSTALL_DIR) $(1)/usr/lib
321 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
322 endef
323
324 define Package/libavahi-client/install
325 $(INSTALL_DIR) $(1)/usr/lib
326 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/
327 endef
328
329 define Package/libavahi-compat-libdnssd/install
330 $(INSTALL_DIR) $(1)/usr/lib
331 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so.* $(1)/usr/lib/
332 endef
333
334 define Package/avahi-utils/install
335 $(INSTALL_DIR) $(1)/usr/bin
336 $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
337 endef
338
339 define Package/avahi-autoipd/install
340 $(INSTALL_DIR) $(1)/etc/avahi
341 $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
342 $(INSTALL_DIR) $(1)/usr/sbin
343 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
344 endef
345
346 define Package/avahi-daemon/install
347 $(INSTALL_DIR) $(1)/usr/sbin
348 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
349 $(INSTALL_DIR) $(1)/etc/avahi
350 $(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/
351 $(INSTALL_DIR) $(1)/etc/avahi/services
352 $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
353 $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
354 $(INSTALL_DIR) $(1)/etc/init.d
355 $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
356 endef
357
358 define Package/avahi-daemon-service-http/install
359 $(INSTALL_DIR) $(1)/etc/avahi/services
360 $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
361 endef
362
363 define Package/avahi-daemon-service-ssh/install
364 $(INSTALL_DIR) $(1)/etc/avahi/services
365 $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
366 endef
367
368 define Package/avahi-dnsconfd/install
369 $(INSTALL_DIR) $(1)/etc/avahi
370 $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
371 $(INSTALL_DIR) $(1)/usr/sbin
372 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
373 endef
374
375 $(eval $(call BuildPackage,libavahi-client))
376 $(eval $(call BuildPackage,libavahi-compat-libdnssd))
377 $(eval $(call BuildPackage,avahi-utils))
378 $(eval $(call BuildPackage,libavahi-dbus-support))
379 $(eval $(call BuildPackage,libavahi))
380 $(eval $(call BuildPackage,avahi-autoipd))
381 $(eval $(call BuildPackage,avahi-daemon))
382 $(eval $(call BuildPackage,avahi-daemon-service-http))
383 $(eval $(call BuildPackage,avahi-daemon-service-ssh))
384 $(eval $(call BuildPackage,avahi-dnsconfd))