micropython: replace local fix with upstream one
[buildroot-gz.git] / package / avahi / avahi.mk
blob069b45a96d44bd06b26468b46ea0bf2c7d387e1c
1 ################################################################################
3 # avahi
5 ################################################################################
8 # This program is free software; you can redistribute it
9 # and/or modify it under the terms of the GNU Lesser General
10 # Public License as published by the Free Software Foundation
11 # either version 2.1 of the License, or (at your option) any
12 # later version.
14 AVAHI_VERSION = 0.6.32
15 AVAHI_SITE = https://github.com/lathiat/avahi/releases/download/v$(AVAHI_VERSION)
16 AVAHI_LICENSE = LGPLv2.1+
17 AVAHI_LICENSE_FILES = LICENSE
18 AVAHI_INSTALL_STAGING = YES
20 AVAHI_CONF_ENV = \
21 ac_cv_func_strtod=yes \
22 ac_fsusage_space=yes \
23 fu_cv_sys_stat_statfs2_bsize=yes \
24 ac_cv_func_closedir_void=no \
25 ac_cv_func_getloadavg=no \
26 ac_cv_lib_util_getloadavg=no \
27 ac_cv_lib_getloadavg_getloadavg=no \
28 ac_cv_func_getgroups=yes \
29 ac_cv_func_getgroups_works=yes \
30 ac_cv_func_chown_works=yes \
31 ac_cv_have_decl_euidaccess=no \
32 ac_cv_func_euidaccess=no \
33 ac_cv_have_decl_strnlen=yes \
34 ac_cv_func_strnlen_working=yes \
35 ac_cv_func_lstat_dereferences_slashed_symlink=yes \
36 ac_cv_func_lstat_empty_string_bug=no \
37 ac_cv_func_stat_empty_string_bug=no \
38 vb_cv_func_rename_trailing_slash_bug=no \
39 ac_cv_have_decl_nanosleep=yes \
40 jm_cv_func_nanosleep_works=yes \
41 gl_cv_func_working_utimes=yes \
42 ac_cv_func_utime_null=yes \
43 ac_cv_have_decl_strerror_r=yes \
44 ac_cv_func_strerror_r_char_p=no \
45 jm_cv_func_svid_putenv=yes \
46 ac_cv_func_getcwd_null=yes \
47 ac_cv_func_getdelim=yes \
48 ac_cv_func_mkstemp=yes \
49 utils_cv_func_mkstemp_limitations=no \
50 utils_cv_func_mkdir_trailing_slash_bug=no \
51 jm_cv_func_gettimeofday_clobber=no \
52 am_cv_func_working_getline=yes \
53 gl_cv_func_working_readdir=yes \
54 jm_ac_cv_func_link_follows_symlink=no \
55 utils_cv_localtime_cache=no \
56 ac_cv_struct_st_mtim_nsec=no \
57 gl_cv_func_tzset_clobber=no \
58 gl_cv_func_getcwd_null=yes \
59 gl_cv_func_getcwd_path_max=yes \
60 ac_cv_func_fnmatch_gnu=yes \
61 am_getline_needs_run_time_check=no \
62 am_cv_func_working_getline=yes \
63 gl_cv_func_mkdir_trailing_slash_bug=no \
64 gl_cv_func_mkstemp_limitations=no \
65 ac_cv_func_working_mktime=yes \
66 jm_cv_func_working_re_compile_pattern=yes \
67 ac_use_included_regex=no \
68 avahi_cv_sys_cxx_works=yes \
69 DATADIRNAME=share
71 # Note: even if we have Gtk2 and Gtk3 support in Buildroot, we
72 # explicitly disable support for them, in order to avoid the following
73 # circular dependencies:
75 # avahi -> libglade -> libgtk2 -> cups -> avahi
76 # avahi -> libgtk3 -> cups -> avahi
78 # Since Gtk2 and Gtk3 in Avahi are only used for some example/demo
79 # programs, we decided to disable their support to solve the circular
80 # dependency.
81 AVAHI_CONF_OPTS = \
82 --disable-qt3 \
83 --disable-qt4 \
84 --disable-gtk \
85 --disable-gtk3 \
86 --disable-gdbm \
87 --disable-pygtk \
88 --disable-mono \
89 --disable-monodoc \
90 --disable-stack-protector \
91 --with-distro=none \
92 --disable-manpages \
93 $(if $(BR2_PACKAGE_AVAHI_AUTOIPD),--enable,--disable)-autoipd \
94 --with-avahi-user=avahi \
95 --with-avahi-group=avahi \
96 --with-autoipd-user=avahi \
97 --with-autoipd-group=avahi
99 AVAHI_DEPENDENCIES = \
100 $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) host-intltool \
101 host-pkgconf host-gettext
103 AVAHI_CFLAGS = $(TARGET_CFLAGS)
105 ifeq ($(BR2_PACKAGE_SYSTEMD),y)
106 AVAHI_CONF_OPTS += --with-systemdsystemunitdir=/usr/lib/systemd/system
107 else
108 AVAHI_CONF_OPTS += --with-systemdsystemunitdir=no
109 AVAHI_CFLAGS += -DDISABLE_SYSTEMD
110 endif
112 ifneq ($(BR2_PACKAGE_AVAHI_DAEMON)$(BR2_PACKAGE_AVAHI_AUTOIPD),)
113 AVAHI_DEPENDENCIES += libdaemon
114 else
115 AVAHI_CONF_OPTS += --disable-libdaemon
116 endif
118 ifeq ($(BR2_PACKAGE_LIBCAP),y)
119 AVAHI_DEPENDENCIES += libcap
120 endif
122 ifeq ($(BR2_PACKAGE_AVAHI_DAEMON),y)
123 AVAHI_DEPENDENCIES += expat
124 AVAHI_CONF_OPTS += --with-xml=expat
125 else
126 AVAHI_CONF_OPTS += --with-xml=none
127 endif
129 ifeq ($(BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY),y)
130 AVAHI_CONF_OPTS += --enable-compat-libdns_sd
131 endif
133 ifeq ($(BR2_PACKAGE_DBUS),y)
134 AVAHI_DEPENDENCIES += dbus
135 else
136 AVAHI_CONF_OPTS += --disable-dbus
137 endif
139 ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
140 AVAHI_DEPENDENCIES += libglib2
141 else
142 AVAHI_CONF_OPTS += --disable-glib --disable-gobject
143 endif
145 ifeq ($(BR2_PACKAGE_PYTHON),y)
146 AVAHI_CONF_ENV += \
147 am_cv_pathless_PYTHON=python \
148 am_cv_path_PYTHON=$(PYTHON_TARGET_BINARY) \
149 am_cv_python_version=$(PYTHON_VERSION) \
150 am_cv_python_platform=linux2 \
151 am_cv_python_pythondir=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
152 am_cv_python_pyexecdir=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
153 py_cv_mod_socket_=yes
155 AVAHI_DEPENDENCIES += python
156 AVAHI_CONF_OPTS += --enable-python
157 else
158 AVAHI_CONF_OPTS += --disable-python
159 endif
161 ifeq ($(BR2_PACKAGE_DBUS_PYTHON),y)
162 AVAHI_CONF_OPTS += --enable-python-dbus
163 AVAHI_CONF_ENV += py_cv_mod_dbus_=yes
164 AVAHI_DEPENDENCIES += dbus-python
165 else
166 AVAHI_CONF_OPTS += --disable-python-dbus
167 endif
169 AVAHI_CONF_ENV += CFLAGS="$(AVAHI_CFLAGS)"
171 AVAHI_MAKE_OPTS += $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),LIBS=-lintl)
173 define AVAHI_USERS
174 avahi -1 avahi -1 * - - -
175 endef
177 define AVAHI_REMOVE_INITSCRIPT
178 rm -rf $(TARGET_DIR)/etc/init.d/avahi-*
179 endef
181 AVAHI_POST_INSTALL_TARGET_HOOKS += AVAHI_REMOVE_INITSCRIPT
183 ifeq ($(BR2_PACKAGE_AVAHI_AUTOIPD),y)
184 define AVAHI_INSTALL_AUTOIPD
185 rm -f $(TARGET_DIR)/var/lib/avahi-autoipd
186 $(INSTALL) -d -m 0755 $(TARGET_DIR)/var/lib
187 ln -sf /tmp/avahi-autoipd $(TARGET_DIR)/var/lib/avahi-autoipd
188 endef
190 define AVAHI_INSTALL_AUTOIPD_INIT_SYSV
191 $(INSTALL) -D -m 0755 package/avahi/S05avahi-setup.sh $(TARGET_DIR)/etc/init.d/S05avahi-setup.sh
192 endef
194 AVAHI_POST_INSTALL_TARGET_HOOKS += AVAHI_INSTALL_AUTOIPD
195 endif
197 ifeq ($(BR2_PACKAGE_AVAHI_DAEMON),y)
199 define AVAHI_INSTALL_INIT_SYSTEMD
200 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
202 ln -fs ../../../../usr/lib/systemd/system/avahi-daemon.service \
203 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/avahi-daemon.service
205 ln -fs ../../../../usr/lib/systemd/system/avahi-dnsconfd.service \
206 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/avahi-dnsconfd.service
208 $(INSTALL) -D -m 644 package/avahi/avahi_tmpfiles.conf \
209 $(TARGET_DIR)/usr/lib/tmpfiles.d/avahi.conf
210 endef
212 define AVAHI_INSTALL_DAEMON_INIT_SYSV
213 $(INSTALL) -D -m 0755 package/avahi/S50avahi-daemon $(TARGET_DIR)/etc/init.d/S50avahi-daemon
214 endef
216 endif
218 define AVAHI_INSTALL_INIT_SYSV
219 $(AVAHI_INSTALL_AUTOIPD_INIT_SYSV)
220 $(AVAHI_INSTALL_DAEMON_INIT_SYSV)
221 endef
223 ifeq ($(BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY),y)
224 # applications expects to be able to #include <dns_sd.h>
225 define AVAHI_STAGING_INSTALL_LIBDNSSD_LINK
226 ln -sf avahi-compat-libdns_sd/dns_sd.h \
227 $(STAGING_DIR)/usr/include/dns_sd.h
228 endef
230 AVAHI_POST_INSTALL_STAGING_HOOKS += AVAHI_STAGING_INSTALL_LIBDNSSD_LINK
231 endif
233 $(eval $(autotools-package))