Update to release 0.8

- Dropped the patch for the functionality equivalent to what has been done
  upstream in avahi.git commit 2fd76baeb829 ("Listen on loopback interfaces").
- Added Qt5
- Adjusted for upstream flipping QT3 and QT4 to default off
- Packaged the libevent library
This commit is contained in:
Lubomir Rintel 2020-03-22 18:44:44 +01:00
parent cbce6b24de
commit eb82c89c94
4 changed files with 56 additions and 94 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@
/avahi-0.6.31.tar.gz
/avahi-0.6.32.tar.gz
/avahi-0.7.tar.gz
/avahi-0.8.tar.gz

View File

@ -1,86 +0,0 @@
From 9283ba29b23dd6dc7faaf138188fd02ab38b30e8 Mon Sep 17 00:00:00 2001
From: Till Kamppeter <till.kamppeter@gmail.com>
Date: Fri, 15 Dec 2017 10:16:28 -0200
Subject: [PATCH] Add support to advertise local services ("localhost") on the
local machine only
This is the patch attached to Issue #125 (on Dec 6, 2017) and also
shown in the readme.md of ippusbxd
(https://github.com/OpenPrinting/ippusbxd).
It makes also services on the loopback ("lo") interface being
advertised and these records use "localhost" instead of the network
host name of the machine as server host name. This way clients, like
for example CUPS or cups-browsed will find these local services and be
able to work with them as they were network services.
---
avahi-core/iface-linux.c | 4 ++--
avahi-core/iface-pfroute.c | 8 ++++----
avahi-core/resolve-service.c | 3 ++-
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/avahi-core/iface-linux.c b/avahi-core/iface-linux.c
index c6c5f77..e116c7b 100644
--- a/avahi-core/iface-linux.c
+++ b/avahi-core/iface-linux.c
@@ -104,8 +104,8 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat
hw->flags_ok =
(ifinfomsg->ifi_flags & IFF_UP) &&
(!m->server->config.use_iff_running || (ifinfomsg->ifi_flags & IFF_RUNNING)) &&
- !(ifinfomsg->ifi_flags & IFF_LOOPBACK) &&
- (ifinfomsg->ifi_flags & IFF_MULTICAST) &&
+ ((ifinfomsg->ifi_flags & IFF_LOOPBACK) ||
+ (ifinfomsg->ifi_flags & IFF_MULTICAST)) &&
(m->server->config.allow_point_to_point || !(ifinfomsg->ifi_flags & IFF_POINTOPOINT));
/* Handle interface attributes */
diff --git a/avahi-core/iface-pfroute.c b/avahi-core/iface-pfroute.c
index 9a2e953..27c3443 100644
--- a/avahi-core/iface-pfroute.c
+++ b/avahi-core/iface-pfroute.c
@@ -80,8 +80,8 @@ static void rtm_info(struct rt_msghdr *rtm, AvahiInterfaceMonitor *m)
hw->flags_ok =
(ifm->ifm_flags & IFF_UP) &&
(!m->server->config.use_iff_running || (ifm->ifm_flags & IFF_RUNNING)) &&
- !(ifm->ifm_flags & IFF_LOOPBACK) &&
- (ifm->ifm_flags & IFF_MULTICAST) &&
+ ((ifm->ifm_flags & IFF_LOOPBACK) ||
+ (ifm->ifm_flags & IFF_MULTICAST)) &&
(m->server->config.allow_point_to_point || !(ifm->ifm_flags & IFF_POINTOPOINT));
avahi_free(hw->name);
@@ -427,8 +427,8 @@ static void if_add_interface(struct lifreq *lifreq, AvahiInterfaceMonitor *m, in
hw->flags_ok =
(flags & IFF_UP) &&
(!m->server->config.use_iff_running || (flags & IFF_RUNNING)) &&
- !(flags & IFF_LOOPBACK) &&
- (flags & IFF_MULTICAST) &&
+ ((flags & IFF_LOOPBACK) ||
+ (flags & IFF_MULTICAST)) &&
(m->server->config.allow_point_to_point || !(flags & IFF_POINTOPOINT));
hw->name = avahi_strdup(lifreq->lifr_name);
hw->mtu = mtu;
diff --git a/avahi-core/resolve-service.c b/avahi-core/resolve-service.c
index 3377a50..3311b6b 100644
--- a/avahi-core/resolve-service.c
+++ b/avahi-core/resolve-service.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <net/if.h>
#include <avahi-common/domain.h>
#include <avahi-common/timeval.h>
@@ -129,7 +130,7 @@ static void finish(AvahiSServiceResolver *r, AvahiResolverEvent event) {
r->service_name,
r->service_type,
r->domain_name,
- r->srv_record->data.srv.name,
+ (r->interface == if_nametoindex("lo")) ? "localhost" : r->srv_record->data.srv.name,
r->address_record ? &a : NULL,
r->srv_record->data.srv.port,
r->txt_record ? r->txt_record->data.txt.string_list : NULL,
--
2.17.2

View File

@ -3,6 +3,7 @@
%{?!WITH_COMPAT_HOWL: %global WITH_COMPAT_HOWL 1}
%{?!WITH_QT3: %global WITH_QT3 1}
%{?!WITH_QT4: %global WITH_QT4 1}
%{?!WITH_QT5: %global WITH_QT5 1}
%{?!WITH_PYTHON: %global WITH_PYTHON 1}
%ifnarch %{mono_arches}
@ -18,6 +19,7 @@
%define WITH_MONO 0
%if 0%{?rhel} >= 6
%define WITH_QT4 0
%define WITH_QT5 0
%endif
%if 0%{?rhel} > 7
%define WITH_QT3 0
@ -31,8 +33,8 @@
%global _changelog_trimtime %(date +%s -d "1 year ago")
Name: avahi
Version: 0.7
Release: 24%{?dist}
Version: 0.8
Release: 1%{?dist}
Summary: Local network service discovery
License: LGPLv2+
URL: http://avahi.org
@ -58,6 +60,9 @@ BuildRequires: qt3-devel
%if %{WITH_QT4}
BuildRequires: qt4-devel
%endif
%if %{WITH_QT5}
BuildRequires: qt5-qtbase-devel
%endif
BuildRequires: libdaemon-devel >= 0.11
BuildRequires: glib2-devel
BuildRequires: libcap-devel
@ -83,6 +88,7 @@ BuildRequires: pygtk2
%endif
BuildRequires: gdbm-devel
BuildRequires: pkgconfig(pygobject-3.0)
BuildRequires: pkgconfig(libevent) >= 2.0.21
BuildRequires: intltool
BuildRequires: perl-XML-Parser
BuildRequires: xmltoman
@ -93,6 +99,7 @@ BuildRequires: monodoc-devel
BuildRequires: systemd
%{?systemd_requires}
BuildRequires: gcc
BuildRequires: gcc-c++
%if 0%{?beta:1}
Source0: https://github.com/lathiat/avahi/archive/%{version}-%{beta}.tar.gz#/%{name}-%{version}-%{beta}.tar.gz
@ -105,7 +112,6 @@ Source0: https://github.com/lathiat/avahi/releases/download/v%{version}
## downstream patches
Patch100: avahi-0.6.30-mono-libdir.patch
Patch101: 0001-Add-support-to-advertise-local-services-localhost-on.patch
%description
Avahi is a system which facilitates service discovery on
@ -244,6 +250,24 @@ Th avahi-qt4-devel package contains the header files and libraries
necessary for developing programs using avahi with Qt4.
%endif
%if %{WITH_QT5}
%package qt5
Summary: Qt5 libraries for avahi
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description qt5
Libraries for easy use of avahi from Qt5 applications.
%package qt5-devel
Summary: Libraries and header files for avahi Qt5 development
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-qt5%{?_isa} = %{version}-%{release}
%description qt5-devel
Th avahi-qt5-devel package contains the header files and libraries
necessary for developing programs using avahi with Qt5.
%endif
%if %{WITH_MONO}
%package sharp
Summary: Mono language bindings for avahi mono development
@ -401,6 +425,7 @@ NOCONFIGURE=1 ./autogen.sh
--enable-shared=yes \
--enable-static=no \
--disable-silent-rules \
--enable-gtk \
%if ! %{WITH_PYTHON}
--disable-python \
%endif
@ -410,11 +435,14 @@ NOCONFIGURE=1 ./autogen.sh
%if %{WITH_COMPAT_HOWL}
--enable-compat-howl \
%endif
%if ! %{WITH_QT3}
--disable-qt3 \
%if %{WITH_QT3}
--enable-qt3 \
%endif
%if ! %{WITH_QT4}
--disable-qt4 \
%if %{WITH_QT4}
--enable-qt4 \
%endif
%if ! %{WITH_QT5}
--disable-qt5 \
%endif
%if ! %{WITH_MONO}
--disable-mono \
@ -614,17 +642,21 @@ exit 0
%{_libdir}/libavahi-common.so
%{_libdir}/libavahi-core.so
%{_libdir}/libavahi-client.so
%{_libdir}/libavahi-libevent.so
%{_includedir}/avahi-client
%{_includedir}/avahi-common
%{_includedir}/avahi-core
%{_includedir}/avahi-libevent
%{_libdir}/pkgconfig/avahi-core.pc
%{_libdir}/pkgconfig/avahi-client.pc
%{_libdir}/pkgconfig/avahi-libevent.pc
%files libs
%doc README
%license LICENSE
%{_libdir}/libavahi-common.so.*
%{_libdir}/libavahi-client.so.*
%{_libdir}/libavahi-libevent.so.*
%files glib
%{_libdir}/libavahi-glib.so.*
@ -683,6 +715,18 @@ exit 0
%{_libdir}/pkgconfig/avahi-qt4.pc
%endif
%if %{WITH_QT5}
%ldconfig_scriptlets qt5
%files qt5
%{_libdir}/libavahi-qt5.so.*
%files qt5-devel
%{_libdir}/libavahi-qt5.so
%{_includedir}/avahi-qt5/
%{_libdir}/pkgconfig/avahi-qt5.pc
%endif
%if %{WITH_MONO}
%files sharp
%{_prefix}/lib/mono/avahi-sharp
@ -730,6 +774,9 @@ exit 0
%changelog
* Sun Mar 22 2020 Lubomir Rintel <lkundrak@v3.sk> - 0.8-1
- Update to version 0.8
* Thu Feb 20 2020 Petr Viktorin <pviktori@redhat.com> - 0.7-24
- Don't BuildRequire pygtk2 if building without Python

View File

@ -1 +1 @@
SHA512 (avahi-0.7.tar.gz) = bae5a1e9204aca90b90e7fd223d19e809e3514d03ba5fa2da1e55bf1d72d3d3b98567f357900c36393613dc17dc98e15ff3ebf0f226f2f6b9766e592452a6ce7
SHA512 (avahi-0.8.tar.gz) = c6ba76feb6e92f70289f94b3bf12e5f5c66c11628ce0aeb3cadfb72c13a5d1a9bd56d71bdf3072627a76cd103b9b056d9131aa49ffe11fa334c24ab3b596c7de