avahi: fork with python3.9 support, https://bugs.gentoo.org/746905

This commit is contained in:
Anton Bolshakov 2021-05-09 10:45:53 +08:00
parent 9a9565475a
commit 2764fb0324
No known key found for this signature in database
GPG key ID: 32BDCED870788F04
6 changed files with 371 additions and 0 deletions

1
net-dns/avahi/Manifest Normal file
View file

@ -0,0 +1 @@
DIST avahi-0.8.tar.gz 953319 BLAKE2B ddede1b8790ff3057ea5f4bb710e95578229e078a7abac83121e043017dda1ab3d971c723f920fdd4f3d98b88bd2cf21f9645bec1b7bbd2ea194cb399a5f5b46 SHA512 27bba9a551152dfc7e721f326042e7bfce55d227044a6cbaee04d6fb0e3f59c36e159c2b7a4dd42d1c955cdf37cc1c303e91991c08928bbded91d796e9a22abe

View file

@ -0,0 +1,210 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
PYTHON_COMPAT=( python3_{7,8,9} )
PYTHON_REQ_USE="gdbm"
inherit autotools flag-o-matic multilib-minimal mono-env python-r1 systemd
DESCRIPTION="System which facilitates service discovery on a local network"
HOMEPAGE="http://avahi.org/"
SRC_URI="https://github.com/lathiat/avahi/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86"
IUSE="autoipd bookmarks +dbus doc gdbm gtk howl-compat +introspection ipv6 kernel_linux mdnsresponder-compat mono nls python qt5 selinux systemd test"
REQUIRED_USE="
python? ( dbus gdbm ${PYTHON_REQUIRED_USE} )
mono? ( dbus )
howl-compat? ( dbus )
mdnsresponder-compat? ( dbus )
systemd? ( dbus )
"
RESTRICT="!test? ( test )"
DEPEND="
dev-libs/libdaemon
dev-libs/libevent:=[${MULTILIB_USEDEP}]
dev-libs/expat
dev-libs/glib:2[${MULTILIB_USEDEP}]
gdbm? ( sys-libs/gdbm:=[${MULTILIB_USEDEP}] )
qt5? ( dev-qt/qtcore:5 )
gtk? ( x11-libs/gtk+:3[${MULTILIB_USEDEP}] )
dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
kernel_linux? ( sys-libs/libcap )
introspection? ( dev-libs/gobject-introspection:= )
mono? ( dev-lang/mono )
python? (
${PYTHON_DEPS}
dbus? ( dev-python/dbus-python[${PYTHON_USEDEP}] )
introspection? ( dev-python/pygobject:3[${PYTHON_USEDEP}] )
)
bookmarks? (
${PYTHON_DEPS}
>=dev-python/twisted-16.0.0[${PYTHON_USEDEP}]
)
"
RDEPEND="
acct-user/avahi
acct-group/avahi
acct-group/netdev
autoipd? (
acct-user/avahi-autoipd
acct-group/avahi-autoipd
)
${DEPEND}
selinux? ( sec-policy/selinux-avahi )
"
BDEPEND="
dev-util/glib-utils
doc? ( app-doc/doxygen )
app-doc/xmltoman
dev-util/intltool
virtual/pkgconfig
"
MULTILIB_WRAPPED_HEADERS=( /usr/include/avahi-qt5/qt-watch.h )
PATCHES=(
"${FILESDIR}/${P}-disable-avahi-ui-sharp.patch" # bug 769062
# These patches do not apply cleanly but may need to be re-instated.
# I'll leave them commented out for now.
# "${FILESDIR}/${PN}-0.7-qt5.patch"
# "${FILESDIR}/${PN}-0.7-CVE-2017-6519.patch"
# "${FILESDIR}/${PN}-0.7-remove-empty-avahi_discover.patch"
# "${FILESDIR}/${PN}-0.7-python3.patch"
# "${FILESDIR}/${PN}-0.7-python3-unittest.patch"
# "${FILESDIR}/${PN}-0.7-python3-gdbm.patch"
)
pkg_setup() {
use mono && mono-env_pkg_setup
use python || use bookmarks && python_setup
}
src_prepare() {
default
if ! use ipv6; then
sed -i \
-e "s/use-ipv6=yes/use-ipv6=no/" \
avahi-daemon/avahi-daemon.conf || die
fi
sed -i \
-e "s:\\.\\./\\.\\./\\.\\./doc/avahi-docs/html/:../../../doc/${PF}/html/:" \
doxygen_to_devhelp.xsl || die
eautoreconf
# bundled manpages
multilib_copy_sources
}
multilib_src_configure() {
local myconf=(
--disable-gtk
--disable-monodoc
--disable-python-dbus
--disable-qt3
--disable-qt4
--disable-static
--enable-manpages
--enable-glib
--enable-gobject
--enable-xmltoman
--localstatedir="${EPREFIX}/var"
--with-distro=gentoo
--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
$(use_enable dbus)
$(use_enable gdbm)
$(use_enable gtk gtk3)
$(use_enable howl-compat compat-howl)
$(use_enable mdnsresponder-compat compat-libdns_sd)
$(use_enable nls)
$(multilib_native_use_enable autoipd)
$(multilib_native_use_enable doc doxygen-doc)
$(multilib_native_use_enable introspection)
$(multilib_native_use_enable mono)
$(multilib_native_use_enable python)
$(multilib_native_use_enable test tests)
)
if use python; then
myconf+=(
$(multilib_native_use_enable dbus python-dbus)
$(multilib_native_use_enable introspection pygobject)
)
fi
if use mono; then
myconf+=( $(multilib_native_use_enable doc monodoc) )
fi
if ! multilib_is_native_abi; then
myconf+=(
# used by daemons only
--disable-libdaemon
--with-xml=none
)
fi
myconf+=( $(multilib_native_use_enable qt5) )
econf "${myconf[@]}"
}
multilib_src_compile() {
emake
multilib_is_native_abi && use doc && emake avahi.devhelp
}
multilib_src_install() {
emake install DESTDIR="${D}"
use bookmarks && use python && use dbus || \
rm -f "${ED}"/usr/bin/avahi-bookmarks
# https://github.com/lathiat/avahi/issues/28
use howl-compat && dosym avahi-compat-howl.pc /usr/$(get_libdir)/pkgconfig/howl.pc
use mdnsresponder-compat && dosym avahi-compat-libdns_sd/dns_sd.h /usr/include/dns_sd.h
if multilib_is_native_abi && use doc; then
docinto html
dodoc -r doxygen/html/.
insinto /usr/share/devhelp/books/avahi
doins avahi.devhelp
fi
# The build system creates an empty "/run" directory, so we clean it up here
rmdir "${ED}"/run || die
}
multilib_src_install_all() {
if use autoipd; then
insinto /lib/rcscripts/net
doins "${FILESDIR}"/autoipd.sh
insinto /lib/netifrc/net
newins "${FILESDIR}"/autoipd-openrc.sh autoipd.sh
fi
dodoc docs/{AUTHORS,NEWS,README,TODO}
find "${ED}" -name '*.la' -type f -delete || die
}
pkg_postinst() {
if use autoipd; then
elog
elog "To use avahi-autoipd to configure your interfaces with IPv4LL (RFC3927)"
elog "addresses, just set config_<interface>=( autoipd ) in /etc/conf.d/net!"
elog
fi
systemd_reenable avahi-daemon.service
}

View file

@ -0,0 +1,32 @@
# Copyright (C) 2004-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Contributed by Sven Wegener (swegener@gentoo.org)
_config_vars="$_config_vars autoipd"
autoipd_depend() {
program /usr/sbin/avahi-autoipd
after interface
}
autoipd_start() {
_exists true || return 1
eval args=\$autoipd_${IFVAR}
ebegin "Starting avahi-autoipd"
/usr/sbin/avahi-autoipd --daemonize --syslog --wait ${args} "${IFACE}"
eend "${?}" || return 1
_show_address
return 0
}
autoipd_stop() {
/usr/sbin/avahi-autoipd --check --syslog "${IFACE}" || return 0
ebegin "Stopping avahi-autoipd"
/usr/sbin/avahi-autoipd --kill --syslog "${IFACE}"
eend "${?}"
}

View file

@ -0,0 +1,52 @@
# Copyright (c) 2004-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Contributed by Sven Wegener (swegener@gentoo.org)
# void autoipd_depend(void)
#
# Sets up the dependencies for the module
autoipd_depend() {
after interface
}
# void autoipd_expose(void)
#
# Expose variables that can be configured
autoipd_expose() {
variables autoipd
}
# bool autoipd_start(char *iface)
#
# Tries to configure the interface via avahi-autoipd
autoipd_start() {
local iface="${1}" ifvar="$(bash_variable "${iface}")" opts="autoipd_${ifvar}" addr=""
interface_exists "${iface}" true || return 1
ebegin "Starting avahi-autoipd"
if /usr/sbin/avahi-autoipd --daemonize --syslog --wait ${!opts} "${iface}"
then
eend 0
addr="$(interface_get_address "${iface}")"
einfo "${iface} received address ${addr}"
return 0
fi
eend "${?}" "Failed to get address via avahi-autoipd!"
}
# bool autoipd_stop(char *iface)
#
# Stops a running avahi-autoipd instance
autoipd_stop() {
local iface="${1}"
/usr/sbin/avahi-autoipd --check --syslog "${iface}" || return 0
ebegin "Stopping avahi-autoipd"
/usr/sbin/avahi-autoipd --kill --syslog "${iface}"
eend "${?}" "Failed to stop running avahi-autoipd instance!"
}
# vim: set ts=4 :

View file

@ -0,0 +1,57 @@
From ebd2a01a7b5e88f3be35b2f803d5adbd36ae6593 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Sat, 27 Mar 2021 22:49:08 +0100
Subject: [PATCH] Disable avahi-ui-sharp
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
Makefile.am | 6 ++----
configure.ac | 1 -
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 33c51f5..0e12120 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,6 @@ EXTRA_DIST = \
avahi-qt4.pc.in \
avahi-qt5.pc.in \
avahi-sharp.pc.in \
- avahi-ui-sharp.pc.in \
avahi-compat-libdns_sd.pc.in \
avahi-compat-howl.pc.in \
avahi-ui.pc.in \
@@ -77,7 +76,6 @@ SUBDIRS = \
avahi-compat-howl \
avahi-autoipd \
avahi-ui \
- avahi-ui-sharp \
avahi-libevent \
po
@@ -188,8 +186,8 @@ CLEANFILES += avahi-compat-libdns_sd.pc
endif
if HAVE_MONO
-pkgconfig_DATA += avahi-sharp.pc avahi-ui-sharp.pc
-CLEANFILES += avahi-sharp.pc avahi-ui-sharp.pc
+pkgconfig_DATA += avahi-sharp.pc
+CLEANFILES += avahi-sharp.pc
endif
endif
diff --git a/configure.ac b/configure.ac
index 58db8c7..844360f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1166,7 +1166,6 @@ man/Makefile
tests/Makefile
service-type-database/Makefile
avahi-sharp/Makefile
-avahi-ui-sharp/Makefile
avahi-compat-libdns_sd/Makefile
avahi-compat-howl/Makefile
avahi-compat-howl/samples/Makefile
--
2.31.1

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>blueness@gentoo.org</email>
<name>Anthony G. Basile</name>
</maintainer>
<use>
<flag name="autoipd">Build and install the IPv4LL (RFC3927) network address configuration daemon</flag>
<flag name="bookmarks">Install the avahi-bookmarks application (requires <pkg>dev-python/twisted</pkg>)</flag>
<flag name="gtk">Use gtk3 for the avahi utilities to build the avahi-ui-gtk3 library</flag>
<flag name="howl-compat">Enable compat libraries for howl</flag>
<flag name="mdnsresponder-compat">Enable compat libraries for mDNSResponder</flag>
</use>
<upstream>
<remote-id type="github">lathiat/avahi</remote-id>
<remote-id type="cpe">cpe:/a:avahi:avahi</remote-id>
</upstream>
</pkgmetadata>