From 0d2dbc2ae38474ebbc99f1932b7030976cebb2a9 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sat, 21 Nov 2020 22:12:26 +0100 Subject: [PATCH] avahi: new recipe needs dbus system daemon, untested --- net-dns/avahi/avahi-0.8.recipe | 137 +++++++++++++++++++++++ net-dns/avahi/patches/avahi-0.8.patchset | 121 ++++++++++++++++++++ 2 files changed, 258 insertions(+) create mode 100644 net-dns/avahi/avahi-0.8.recipe create mode 100644 net-dns/avahi/patches/avahi-0.8.patchset diff --git a/net-dns/avahi/avahi-0.8.recipe b/net-dns/avahi/avahi-0.8.recipe new file mode 100644 index 000000000..58a17b781 --- /dev/null +++ b/net-dns/avahi/avahi-0.8.recipe @@ -0,0 +1,137 @@ +SUMMARY="A C library for asynchronous DNS requests" +DESCRIPTION="Avahi is a free, LGPL implementation of DNS Service Discovery \ +(DNS-SD RFC 6763) over Multicast DNS (mDNS RFC 6762), commonly known as and \ +compatible with Apple Bonjour primarily targetting Linux." +HOMEPAGE="http://avahi.org/" +COPYRIGHT="2004-2015 the Avahi developers" +LICENSE="GNU LGPL v2.1" +REVISION="1" +srcGitRev="e8a3dd0d480a754318e312e6fa66fea249808187" +SOURCE_URI="https://github.com/lathiat/avahi/archive/$srcGitRev.tar.gz" +CHECKSUM_SHA256="09e3f0aaf05a174776b22b0cff0fed42adea1ba39fd5ff10a5660f3f97aa947c" +SOURCE_DIR="avahi-$srcGitRev" +PATCHES="avahi-$portVersion.patchset" + +GLOBAL_WRITABLE_FILES=" + settings/avahi/avahi-daemon.conf keep-old + settings/avahi/avahi-dnsconfd.action keep-old + settings/avahi/hosts keep-old + settings/avahi/services/sftp-ssh.service keep-old + settings/avahi/services/ssh.service keep-old + settings/dbus-1/system.d/avahi-dbus.conf keep-old + " +USER_SETTINGS_FILES=" + settings/avahi directory + " +avahiUserHomeDir="/packages/$portVersionedName-$REVISION/.self/$relativeDataDir/avahi/empty" + +PACKAGE_USERS=" + avahi real-name \"avahi user\" home \"$avahiUserHomeDir\" shell \"/bin/true\" groups \"avahi\" + " +PACKAGE_GROUPS="avahi" + +ARCHITECTURES="!x86_gcc2 ?x86_64" +SECONDARY_ARCHITECTURES="?x86" + +# On x86_gcc2 we don't want to install the commands in bin//, but in bin/. +commandSuffix=$secondaryArchSuffix +commandBinDir=$binDir +if [ "$targetArchitecture" = x86_gcc2 ]; then + commandSuffix= + commandBinDir=$prefix/bin +fi + +PROVIDES=" + avahi$secondaryArchSuffix = $portVersion + lib:libavahi_client$secondaryArchSuffix = 3.2.9 compat >= 3 + lib:libavahi_common$secondaryArchSuffix = 3.5.4 compat >= 3 + lib:libavahi_core$secondaryArchSuffix = 7.1.0 compat >= 7 + lib:libavahi_glib$secondaryArchSuffix = 1.0.2 compat >= 1 + lib:libavahi_gobject$secondaryArchSuffix = 0.0.5 compat >= 0 + lib:libavahi_libevent$secondaryArchSuffix = 1.0.0 compat >= 1 + lib:libavahi_qt5$secondaryArchSuffix = 1.0.2 compat >= 1 + cmd:avahi_browse + cmd:avahi_browse_domains + cmd:avahi_daemon + cmd:avahi_dnsconfd + cmd:avahi_publish + cmd:avahi_publish_address + cmd:avahi_publish_service + cmd:avahi_resolve + cmd:avahi_resolve_address + cmd:avahi_resolve_host_name + cmd:avahi_set_host_name + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libdbus_1$secondaryArchSuffix + lib:libevent_2.1$secondaryArchSuffix + lib:libexpat$secondaryArchSuffix + lib:libglib_2.0$secondaryArchSuffix + lib:libgobject_2.0$secondaryArchSuffix + lib:libintl$secondaryArchSuffix + lib:libQt5Core$secondaryArchSuffix + " + +PROVIDES_devel=" + avahi${secondaryArchSuffix}_devel = $portVersion + devel:libavahi_client$secondaryArchSuffix = 3.2.9 compat >= 3 + devel:libavahi_common$secondaryArchSuffix = 3.5.4 compat >= 3 + devel:libavahi_core$secondaryArchSuffix = 7.1.0 compat >= 7 + devel:libavahi_glib$secondaryArchSuffix = 1.0.2 compat >= 1 + devel:libavahi_gobject$secondaryArchSuffix = 0.0.5 compat >= 0 + devel:libavahi_libevent$secondaryArchSuffix = 1.0.0 compat >= 1 + devel:libavahi_qt5$secondaryArchSuffix = 1.0.2 compat >= 1 + " +REQUIRES_devel=" + avahi$secondaryArchSuffix == $portVersion base + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libdaemon$secondaryArchSuffix + devel:libdbus_1$secondaryArchSuffix + devel:libevent_2.1$secondaryArchSuffix + devel:libexpat$secondaryArchSuffix + devel:libglib_2.0$secondaryArchSuffix + devel:libpcap$secondaryArchSuffix + devel:libQt5Core$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:aclocal + cmd:autoconf + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:libtoolize$secondaryArchSuffix + cmd:make + cmd:pkg_config$secondaryArchSuffix + cmd:sed + cmd:which + " + +BUILD() +{ + autoreconf -fi + runConfigure --omit-dirs binDir ./configure --bindir=$commandBinDir \ + --disable-gtk3 --disable-gtk \ + --disable-gdbm --disable-python --disable-autoipd \ + --disable-mono --disable-manpages --disable-stack-protector \ + --localstatedir=$prefix/var/run + make $jobArgs +} + +INSTALL() +{ + make install + + # remove libtool files + rm $libDir/lib*.la + + prepareInstalledDevelLibs libavahi-client libavahi-common \ + libavahi-core libavahi-glib libavahi-gobject libavahi-libevent \ + libavahi-qt5 + fixPkgconfig + + packageEntries devel \ + "$developDir" +} diff --git a/net-dns/avahi/patches/avahi-0.8.patchset b/net-dns/avahi/patches/avahi-0.8.patchset new file mode 100644 index 000000000..e924a9bf0 --- /dev/null +++ b/net-dns/avahi/patches/avahi-0.8.patchset @@ -0,0 +1,121 @@ +From 3b1f96d28a2806562ae4ce73dade4d601f9389a9 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Sat, 21 Nov 2020 18:45:54 +0100 +Subject: Haiku patch + + +diff --git a/avahi-core/socket.c b/avahi-core/socket.c +index 7583dae..64ea8a7 100644 +--- a/avahi-core/socket.c ++++ b/avahi-core/socket.c +@@ -318,8 +318,8 @@ int avahi_open_socket_ipv4(int no_reuse) { + goto fail; + } + +- ttl = 255; +- if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)) < 0) { ++ ttl = ittl = 255; ++ if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &ittl, sizeof(ittl)) < 0) { + avahi_log_warn("IP_MULTICAST_TTL failed: %s", strerror(errno)); + goto fail; + } +@@ -330,11 +330,13 @@ int avahi_open_socket_ipv4(int no_reuse) { + goto fail; + } + ++#ifndef __HAIKU__ + cyes = 1; + if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, &cyes, sizeof(cyes)) < 0) { + avahi_log_warn("IP_MULTICAST_LOOP failed: %s", strerror(errno)); + goto fail; + } ++#endif + + memset(&local, 0, sizeof(local)); + local.sin_family = AF_INET; +diff --git a/avahi-daemon/Makefile.am b/avahi-daemon/Makefile.am +index 9645e6e..aaf45d1 100644 +--- a/avahi-daemon/Makefile.am ++++ b/avahi-daemon/Makefile.am +@@ -168,8 +168,10 @@ xmllint: + xmllint --noout --valid $$F ; \ + done + ++if ! TARGET_HAIKU + install-data-local: + test -z "$(avahi_runtime_dir)" || $(MKDIR_P) "$(DESTDIR)$(avahi_runtime_dir)" ++endif + + update-systemd: + curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c +diff --git a/avahi-daemon/sd-daemon.c b/avahi-daemon/sd-daemon.c +index 6d1eebf..032a739 100644 +--- a/avahi-daemon/sd-daemon.c ++++ b/avahi-daemon/sd-daemon.c +@@ -32,7 +32,11 @@ + #include + #include + #include ++#ifdef __HAIKU__ ++#include ++#else + #include ++#endif + #include + #include + #include +diff --git a/configure.ac b/configure.ac +index 58db8c7..9650bcc 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -178,6 +178,9 @@ AC_DEFINE([HAVE_PF_ROUTE],[],[Support for PF_ROUTE]) + #include + #include + #include ++#ifdef __HAIKU__ ++#error Haiku doesn't have PF_ROUTE ++#endif + ]) + + AM_CONDITIONAL(HAVE_PF_ROUTE, [ test x"$HAVE_PF_ROUTE" = xyes ]) +@@ -274,7 +277,7 @@ fi + with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' ` + + case $with_distro in +- lfs|debian|gentoo|archlinux|suse|fedora|mandriva|darwin|freebsd|slackware|none) ++ lfs|debian|gentoo|archlinux|suse|fedora|mandriva|darwin|freebsd|slackware|haiku|none) + ;; + netbsd) + AC_MSG_WARN([Your distribution (${with_distro}) is supported but no init script exist yet! (patches welcome)]) +@@ -298,6 +301,7 @@ AM_CONDITIONAL(TARGET_DARWIN, test x"$with_distro" = xdarwin) + AM_CONDITIONAL(TARGET_NETBSD, test x"$with_distro" = xnetbsd) + AM_CONDITIONAL(TARGET_FREEBSD, test x"$with_distro" = xfreebsd) + AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware) ++AM_CONDITIONAL(TARGET_HAIKU, test x"$with_distro" = xhaiku) + + test_gcc_flag() { + AC_LANG_CONFTEST([int main() {}]) +@@ -356,9 +360,9 @@ AC_TYPE_SIZE_T + AC_HEADER_TIME + AC_HEADER_SYS_WAIT + +- # Solaris stuff ++ # Haiku, Solaris stuff + AC_SEARCH_LIBS([inet_ntop],[nsl]) +- AC_SEARCH_LIBS([recv],[socket]) ++ AC_SEARCH_LIBS([recv],[socket network]) + AC_CHECK_DECL([CMSG_SPACE],,CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__", [[#include ]]) + + # Checks for library functions. +@@ -1004,7 +1008,7 @@ AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_GROUP,"$AVAHI_AUTOIPD_GROUP", [Group for runnin + # + # Avahi runtime dir + # +-avahi_runtime_dir="/run" ++avahi_runtime_dir="/var/run" + avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket" + AC_SUBST(avahi_runtime_dir) + AC_SUBST(avahi_socket) +-- +2.28.0 +