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