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