diff --git a/0000-avahi-dnsconfd.service-Drop-Also-avahi-daemon.socket.patch b/0000-avahi-dnsconfd.service-Drop-Also-avahi-daemon.socket.patch new file mode 100644 index 0000000000000000000000000000000000000000..d736890394146771492bd61de88b75c916358d0c --- /dev/null +++ b/0000-avahi-dnsconfd.service-Drop-Also-avahi-daemon.socket.patch @@ -0,0 +1,25 @@ +From 9c3a314856affb288f701d2d3ee23278fc98eaee Mon Sep 17 00:00:00 2001 +From: Steve Langasek +Date: Tue, 18 Feb 2020 15:43:19 +0800 +Subject: [PATCH 06/11] avahi-dnsconfd.service: Drop "Also=avahi-daemon.socket" + +Also=avahi-daemon.socket' means that 'systemctl disable avahi-dnsconfd' +ill also disable avahi-daemon.socket, which is definitely not what we +ant, and it also causes debhelper to throw an error. Just drop this +entry from the configuration. +--- + avahi-dnsconfd/avahi-dnsconfd.service.in | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/avahi-dnsconfd/avahi-dnsconfd.service.in b/avahi-dnsconfd/avahi-dnsconfd.service.in +index 95db79f..7c293da 100644 +--- a/avahi-dnsconfd/avahi-dnsconfd.service.in ++++ b/avahi-dnsconfd/avahi-dnsconfd.service.in +@@ -26,4 +26,3 @@ ExecStart=@sbindir@/avahi-dnsconfd -s + + [Install] + WantedBy=multi-user.target +-Also=avahi-daemon.socket +-- +2.25.2 + diff --git a/0001-man-add-missing-bshell.1-symlink.patch b/0001-man-add-missing-bshell.1-symlink.patch new file mode 100644 index 0000000000000000000000000000000000000000..9a79ec3e53fdd3fc92af3acdc08251ea14b4884f --- /dev/null +++ b/0001-man-add-missing-bshell.1-symlink.patch @@ -0,0 +1,35 @@ +From f983df44870b602179b493f9c3d113753b378e27 Mon Sep 17 00:00:00 2001 +From: Michael Biebl +Date: Sun, 17 Sep 2017 12:52:39 +0200 +Subject: [PATCH 07/11] man: add missing bshell.1 symlink + +The bshell binary is missing a symlink to its manual page. It should be +symlinked to the man page for bssh, just like how the bvnc man page is. + +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655190 +--- + man/Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/man/Makefile.am b/man/Makefile.am +index d38267c..77a27bd 100644 +--- a/man/Makefile.am ++++ b/man/Makefile.am +@@ -137,12 +137,13 @@ BSSH_LN = + if HAVE_GTK + if HAVE_GLIB + BSSH_LN += $(LN_S) bssh.1 bvnc.1 && ++BSSH_LN += $(LN_S) bssh.1 bshell.1 && + endif + endif + install-exec-local: + mkdir -p $(DESTDIR)/$(mandir)/man1 && \ + cd $(DESTDIR)/$(mandir)/man1 && \ +- rm -f avahi-resolve-host-name.1 avahi-resolve-address.1 avahi-browse-domains.1 avahi-publish-address.1 avahi-publish-service.1 bvnc.1 && \ ++ rm -f avahi-resolve-host-name.1 avahi-resolve-address.1 avahi-browse-domains.1 avahi-publish-address.1 avahi-publish-service.1 bvnc.1 bshell.1 && \ + $(BSSH_LN) \ + $(LN_S) avahi-resolve.1 avahi-resolve-host-name.1 && \ + $(LN_S) avahi-resolve.1 avahi-resolve-address.1 && \ +-- +2.25.2 + diff --git a/0002-Ship-avahi-discover-1-bssh-1-and-bvnc-1-also-for-GTK.patch b/0002-Ship-avahi-discover-1-bssh-1-and-bvnc-1-also-for-GTK.patch new file mode 100644 index 0000000000000000000000000000000000000000..fbcebbb2a584931d77cce82e5c375c6d9b8d6b2a --- /dev/null +++ b/0002-Ship-avahi-discover-1-bssh-1-and-bvnc-1-also-for-GTK.patch @@ -0,0 +1,52 @@ +From 751be804e891aec5701a059144e2f5cbfc981b36 Mon Sep 17 00:00:00 2001 +From: Andreas Henriksson +Date: Thu, 24 Aug 2017 17:52:19 +0200 +Subject: [PATCH 08/11] Ship avahi-discover(1), bssh(1) and bvnc(1) also for + GTK3 + +These manpages went missing when you disabled gtk2 builds.... +--- + man/Makefile.am | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/man/Makefile.am b/man/Makefile.am +index 77a27bd..289b942 100644 +--- a/man/Makefile.am ++++ b/man/Makefile.am +@@ -56,7 +56,7 @@ man_MANS += \ + avahi-publish.1 \ + avahi-set-host-name.1 + +-if HAVE_GTK ++if HAVE_GTK2OR3 + man_MANS += \ + bssh.1 + endif +@@ -64,12 +64,13 @@ endif + if HAVE_PYTHON + man_MANS += \ + avahi-bookmarks.1 +-if HAVE_GTK ++endif ++ ++if HAVE_PYGOBJECT + man_MANS += \ + avahi-discover.1 + endif + endif +-endif + + if ENABLE_AUTOIPD + if HAVE_LIBDAEMON +@@ -134,7 +135,7 @@ EXTRA_DIST = \ + if HAVE_DBUS + + BSSH_LN = +-if HAVE_GTK ++if HAVE_GTK2OR3 + if HAVE_GLIB + BSSH_LN += $(LN_S) bssh.1 bvnc.1 && + BSSH_LN += $(LN_S) bssh.1 bshell.1 && +-- +2.25.2 + diff --git a/0003-fix-requires-in-pc-file.patch b/0003-fix-requires-in-pc-file.patch new file mode 100644 index 0000000000000000000000000000000000000000..a93e5c33f70bf8bf5c714af3999bf7f8e138a7ee --- /dev/null +++ b/0003-fix-requires-in-pc-file.patch @@ -0,0 +1,24 @@ +From 366e3798bdbd6b7bf24e59379f4a9a51af575ce9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tomasz=20Pawe=C5=82=20Gajc?= +Date: Thu, 20 Feb 2020 16:09:40 +0100 +Subject: [PATCH 09/11] fix requires in pc file + +--- + avahi-libevent.pc.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/avahi-libevent.pc.in b/avahi-libevent.pc.in +index a1dca01..3356b0b 100644 +--- a/avahi-libevent.pc.in ++++ b/avahi-libevent.pc.in +@@ -6,6 +6,6 @@ includedir=${prefix}/include + Name: avahi-libevent + Description: Avahi Multicast DNS Responder (libevent Support) + Version: @PACKAGE_VERSION@ +-Requires: libevent-2.1.5 ++Requires: libevent >= 2.1.5 + Libs: -L${libdir} -lavahi-libevent + Cflags: -D_REENTRANT -I${includedir} +-- +2.25.2 + diff --git a/0004-fix-bytestring-decoding-for-proper-display.patch b/0004-fix-bytestring-decoding-for-proper-display.patch new file mode 100644 index 0000000000000000000000000000000000000000..ce95875df9a00e5ef86cf6909a741b1a080d133e --- /dev/null +++ b/0004-fix-bytestring-decoding-for-proper-display.patch @@ -0,0 +1,32 @@ +From a94f72081dd1d546a1d95d860311a1242315bb28 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=89ric=20Araujo?= +Date: Sat, 29 Feb 2020 19:14:04 -0500 +Subject: [PATCH 10/11] fix bytestring decoding for proper display + +--- + avahi-python/avahi-discover/avahi-discover.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/avahi-python/avahi-discover/avahi-discover.py b/avahi-python/avahi-discover/avahi-discover.py +index 0db705d..4a2b575 100755 +--- a/avahi-python/avahi-discover/avahi-discover.py ++++ b/avahi-python/avahi-discover/avahi-discover.py +@@ -238,12 +238,15 @@ class Main_window: + txts+="" + _("TXT") + " %s = %s\n" % (k,v) + else: + txts = "" + _("TXT Data:") + " " + _("empty") + "" ++ ++ txts = txts.decode("utf-8") + + infos = "" + _("Service Type:") + " %s\n" + infos += "" + _("Service Name:") + " %s\n" + infos += "" + _("Domain Name:") + " %s\n" + infos += "" + _("Interface:") + " %s %s\n" + infos += "" + _("Address:") + " %s/%s:%i\n%s" ++ infos = infos.decode("utf-8") + infos = infos % (stype, name, domain, self.siocgifname(interface), self.protoname(protocol), host, address, port, txts.strip()) + self.info_label.set_markup(infos) + +-- +2.25.2 + diff --git a/avahi-modify-fuzz-test-err.patch b/0005-avahi_dns_packet_consume_uint32-fix-potential-undefi.patch similarity index 39% rename from avahi-modify-fuzz-test-err.patch rename to 0005-avahi_dns_packet_consume_uint32-fix-potential-undefi.patch index 922947020892686517dde30efe1048361451ad3e..d5bbf20cda352041c95bcd02042538ed0d228653 100644 --- a/avahi-modify-fuzz-test-err.patch +++ b/0005-avahi_dns_packet_consume_uint32-fix-potential-undefi.patch @@ -1,9 +1,16 @@ -From 6c909652e4b58d29448af695051efc377594e22f Mon Sep 17 00:00:00 2001 -From: xiaoweiwei -Date: Tue, 25 Feb 2020 11:37:10 +0800 -Subject: [PATCH] avahi: modify fuzz test err +From b897ca43ac100d326d118e5877da710eb7f836f9 Mon Sep 17 00:00:00 2001 +From: traffic-millions <60914101+traffic-millions@users.noreply.github.com> +Date: Tue, 3 Mar 2020 11:15:48 +0800 +Subject: [PATCH 11/11] avahi_dns_packet_consume_uint32: fix potential + undefined behavior -Signed-off-by: Buildteam +avahi_dns_packet_consume_uint32 left shifts uint8_t values by 8, 16 and 24 bits to combine them into a 32-bit value. This produces an undefined behavior warning with gcc -fsanitize when fed input values of 128 or 255 however in testing no actual unexpected behavior occurs in practice and the 32-bit uint32_t is always correctly produced as the final value is immediately stored into a uint32_t and the compiler appears to handle this "correctly". + +Cast the intermediate values to uint32_t to prevent this warning and ensure the intended result is explicit. + +Closes: #267 +Closes: #268 +Reference: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19304 --- avahi-core/dns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) @@ -22,5 +29,5 @@ index 7c38f42..d793b76 100644 return 0; -- -1.8.3.1 +2.25.2 diff --git a/CVE-2017-6519-Drop-legacy-unicast-queries-from-address-not-on-loca.patch b/CVE-2017-6519-Drop-legacy-unicast-queries-from-address-not-on-loca.patch deleted file mode 100644 index a0674eaa7bdee938d09a99978657442b6b0d611e..0000000000000000000000000000000000000000 --- a/CVE-2017-6519-Drop-legacy-unicast-queries-from-address-not-on-loca.patch +++ /dev/null @@ -1,46 +0,0 @@ -From e111def44a7df4624a4aa3f85fe98054bffb6b4f Mon Sep 17 00:00:00 2001 -From: Trent Lloyd -Date: Sat, 22 Dec 2018 09:06:07 +0800 -Subject: [PATCH] Drop legacy unicast queries from address not on local link - -When handling legacy unicast queries, ensure that the source IP is -inside a subnet on the local link, otherwise drop the packet. - -Fixes #145 -Fixes #203 -CVE-2017-6519 -CVE-2018-100084 - ---- - avahi-core/server.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/avahi-core/server.c b/avahi-core/server.c -index a2cb19a..a2580e3 100644 ---- a/avahi-core/server.c -+++ b/avahi-core/server.c -@@ -930,6 +930,7 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const AvahiAddres - - if (avahi_dns_packet_is_query(p)) { - int legacy_unicast = 0; -+ char t[AVAHI_ADDRESS_STR_MAX]; - - /* For queries EDNS0 might allow ARCOUNT != 0. We ignore the - * AR section completely here, so far. Until the day we add -@@ -947,6 +948,13 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const AvahiAddres - legacy_unicast = 1; - } - -+ if (!is_mdns_mcast_address(dst_address) && -+ !avahi_interface_address_on_link(i, src_address)) { -+ -+ avahi_log_debug("Received non-local unicast query from host %s on interface '%s.%i'.", avahi_address_snprint(t, sizeof(t), src_address), i->hardware->name, i->protocol); -+ return; -+ } -+ - if (legacy_unicast) - reflect_legacy_unicast_query_packet(s, p, i, src_address, port); - --- -2.19.1 - diff --git a/avahi-0.6.30-mono-libdir.patch b/avahi-0.6.30-mono-libdir.patch deleted file mode 100644 index 692b3b32c38f109ce8011f13757227176d15d245..0000000000000000000000000000000000000000 --- a/avahi-0.6.30-mono-libdir.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff -uNr avahi-0.6.30.old/avahi-sharp/Makefile.am avahi-0.6.30/avahi-sharp/Makefile.am ---- avahi-0.6.30.old/avahi-sharp/Makefile.am 2010-06-29 05:30:35.000000000 +0200 -+++ avahi-0.6.30/avahi-sharp/Makefile.am 2011-11-27 17:03:04.933192204 +0100 -@@ -73,10 +73,10 @@ - endif - - install-data-hook: $(ASSEMBLY) -- $(AM_V_GEN)MONO_SHARED_DIR=. $(GACUTIL) /i $(ASSEMBLY) /package avahi-sharp /gacdir $(libdir) /root $(DESTDIR)$(libdir) -+ $(AM_V_GEN)MONO_SHARED_DIR=. $(GACUTIL) /i $(ASSEMBLY) /package avahi-sharp /gacdir $(prefix)/lib /root $(DESTDIR)$(prefix)/lib - - uninstall-hook: $(ASSEMBLY) -- $(AM_V_GEN)MONO_SHARED_DIR=. $(GACUTIL) /u avahi-sharp /package avahi-sharp /gacdir $(libdir) /root $(DESTDIR)$(libdir) -+ $(AM_V_GEN)MONO_SHARED_DIR=. $(GACUTIL) /u avahi-sharp /package avahi-sharp /gacdir $(prefix)/lib /root $(DESTDIR)$(prefix)/lib - - endif - endif -diff -uNr avahi-0.6.30.old/avahi-sharp.pc.in avahi-0.6.30/avahi-sharp.pc.in ---- avahi-0.6.30.old/avahi-sharp.pc.in 2010-06-25 02:54:22.000000000 +0200 -+++ avahi-0.6.30/avahi-sharp.pc.in 2011-11-27 17:00:05.482192846 +0100 -@@ -5,4 +5,4 @@ - Name: avahi-sharp - Description: Mono bindings for the Avahi mDNS/DNS-SD stack - Version: @PACKAGE_VERSION@ --Libs: -r:${libdir}/mono/avahi-sharp/avahi-sharp.dll -+Libs: -r:${prefix}/lib/mono/avahi-sharp/avahi-sharp.dll -diff -uNr avahi-0.6.30.old/avahi-ui-sharp/Makefile.am avahi-0.6.30/avahi-ui-sharp/Makefile.am ---- avahi-0.6.30.old/avahi-ui-sharp/Makefile.am 2010-06-29 05:30:35.000000000 +0200 -+++ avahi-0.6.30/avahi-ui-sharp/Makefile.am 2011-11-27 17:04:59.812193067 +0100 -@@ -60,10 +60,10 @@ - endif - - install-data-hook: $(ASSEMBLY) -- $(GACUTIL) /i $(ASSEMBLY) /package avahi-ui-sharp /gacdir $(libdir) /root $(DESTDIR)$(libdir) -+ $(GACUTIL) /i $(ASSEMBLY) /package avahi-ui-sharp /gacdir $(prefix)/lib /root $(DESTDIR)$(prefix)/lib - - uninstall-hook: $(ASSEMBLY) -- $(GACUTIL) /u avahi-ui-sharp /package avahi-ui-sharp /gacdir $(libdir) /root $(DESTDIR)$(libdir) -+ $(GACUTIL) /u avahi-ui-sharp /package avahi-ui-sharp /gacdir $(prefix)/lib /root $(DESTDIR)$(prefix)/lib - - endif - endif -diff -uNr avahi-0.6.30.old/avahi-ui-sharp.pc.in avahi-0.6.30/avahi-ui-sharp.pc.in ---- avahi-0.6.30.old/avahi-ui-sharp.pc.in 2010-06-25 02:54:22.000000000 +0200 -+++ avahi-0.6.30/avahi-ui-sharp.pc.in 2011-11-27 17:04:05.077192737 +0100 -@@ -6,4 +6,4 @@ - Description: Mono bindings for the Avahi mDNS/DNS-SD stack - Version: @PACKAGE_VERSION@ - Requires: gtk-sharp-2.0 --Libs: -r:${libdir}/mono/avahi-ui-sharp/avahi-ui-sharp.dll -+Libs: -r:${prefix}/lib/mono/avahi-ui-sharp/avahi-ui-sharp.dll diff --git a/avahi-0.7.tar.gz b/avahi-0.7.tar.gz deleted file mode 100644 index b893f70bdf8ee6374efcdc00b1fea64777c30d11..0000000000000000000000000000000000000000 Binary files a/avahi-0.7.tar.gz and /dev/null differ diff --git a/avahi-0.8.tar.gz b/avahi-0.8.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0b2afc35161c3ef581a4f94668fe3eeed12da592 Binary files /dev/null and b/avahi-0.8.tar.gz differ diff --git a/avahi.spec b/avahi.spec index cebfb0756ec6b1f61df4f2bcb00ae5c58262c334..3881621511742604e4833ada50faad75ce4f25af 100644 --- a/avahi.spec +++ b/avahi.spec @@ -1,19 +1,37 @@ +%{?!WITH_QT5: %global WITH_QT5 1} +%{?!WITH_PYTHON: %global WITH_PYTHON 0} + Name: avahi -Version: 0.7 -Release: 21 +Version: 0.8 +Release: 1 Summary: Avahi is a local network service discovery License: LGPLv2+ URL: http://avahi.org Source0: http://avahi.org/download/%{name}-%{version}.tar.gz -Patch1: avahi-0.6.30-mono-libdir.patch -Patch6000: CVE-2017-6519-Drop-legacy-unicast-queries-from-address-not-on-loca.patch -Patch9000: avahi-modify-fuzz-test-err.patch - -BuildRequires: gcc automake libtool python2-dbus python2-libxml2 desktop-file-utils gtk2-devel glib2-devel -BuildRequires: libcap-devel expat-devel python2-devel python3-devel gdbm-devel pygobject3-devel pygtk2 -BuildRequires: intltool perl-XML-Parser xmltoman systemd +## upstream patches +Patch0: 0000-avahi-dnsconfd.service-Drop-Also-avahi-daemon.socket.patch +Patch1: 0001-man-add-missing-bshell.1-symlink.patch +Patch2: 0002-Ship-avahi-discover-1-bssh-1-and-bvnc-1-also-for-GTK.patch +Patch3: 0003-fix-requires-in-pc-file.patch +Patch4: 0004-fix-bytestring-decoding-for-proper-display.patch +Patch5: 0005-avahi_dns_packet_consume_uint32-fix-potential-undefi.patch + +BuildRequires: gcc automake libtool desktop-file-utils gtk2-devel glib2-devel +BuildRequires: libcap-devel expat-devel gdbm-devel +BuildRequires: intltool perl-XML-Parser xmltoman systemd qt5-qtbase-devel libevent-devel BuildRequires: dbus-devel >= 0.90 dbus-glib-devel >= 0.70 gtk3-devel >= 2.99.0 libdaemon-devel >= 0.11 +BuildRequires: pkgconfig(pygobject-3.0) pkgconfig(libevent) >= 2.0.21 +%if %{WITH_PYTHON} +BuildRequires: python2-dbus python2-libxml2 +BuildRequires: python2-devel +BuildRequires: python3-devel +%else +Obsoletes: python2-avahi < %{version}-%{release} +Obsoletes: python3-avahi < %{version}-%{release} +Obsoletes: avahi-ui-tools < %{version}-%{release} +BuildRequires: pygtk2 +%endif Requires: dbus expat libdaemon >= 0.11 %{name}-libs = %{version}-%{release} Requires(pre): shadow-utils coreutils @@ -32,27 +50,39 @@ you can chat with, find printers to print to or find files being shared. %package tools Summary: CMD tools for mDNS browsing and publishing +Requires: %{name} = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release} + %description tools -CMD tools for mDNS services. +Command line tools that use avahi to browse and publish mDNS services. %package ui-tools Summary: ui-tools for mDNS -Requires: %{name}-libs = %{version}-%{release} python2-avahi = %{version}-%{release} -Requires: tigervnc openssh-clients pygtk2 pygtk2-libglade gdbm python2-dbus pygobject3-base - +Requires: %{name} = %{version}-%{release} +Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-glib = %{version}-%{release} +Requires: %{name}-ui-gtk3 = %{version}-%{release} +Requires: tigervnc openssh-clients pygtk2 pygtk2-libglade gdbm +%if %{WITH_PYTHON} +Requires: python2-avahi = %{version}-%{release} +Requires: python2-dbus +Requires: python2-gobject-base +%endif %description ui-tools Avahi Graphical user interface tools for mDNS services. %package ui -Summary: Gtk library for Avahi (Gtk2) -Requires: %{name}-libs = %{version}-%{release} gtk2 +Summary: Gtk uesr interface library for Avahi (Gtk2) +Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-glib = %{version}-%{release} +Requires: gtk2 %description ui This package contains a Gtk 2.x widget for browsing services. %package dnsconfd Summary: This is useful for configuring unicast DNS servers in a DHCP-like fashion with mDNS +Requires: %{name} = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release} %description dnsconfd @@ -61,8 +91,8 @@ This is useful for configuring unicast DNS servers in a DHCP-like fashion with m %package compat-howl Summary: Libraries for compat-howl Requires: %{name}-libs = %{version}-%{release} -Obsoletes: howl-libs -Provides: howl-libs +Obsoletes: howl-libs < %{version}-%{release} +Provides: howl-libs = %{version}-%{release} %description compat-howl Libraries for compat-howl. @@ -71,8 +101,8 @@ Libraries for compat-howl. Summary: Header files and libs for howl compatibility libraries Requires: %{name}-compat-howl = %{version}-%{release} Requires: %{name}-devel = %{version}-%{release} -Obsoletes: howl-devel -Provides: howl-devel +Obsoletes: howl-devel < %{version}-%{release} +Provides: howl-devel = %{version}-%{release} %description compat-howl-devel Header files and libs for howl compatibility libraries @@ -94,18 +124,23 @@ Header files and libs for compat-libdns_sd-devel %package devel Summary: Libraries and header files for avahi development -Requires: %{name}-libs = %{version}-%{release} %{name}-ui = %{version}-%{release} +Requires: %{name}-libs = %{version}-%{release} +Requires: %{name} = %{version}-%{release} +Requires: %{name}-ui = %{version}-%{release} +Requires: %{name}-ui-gtk3 = %{version}-%{release} Requires: glib2-devel Provides: %{name}-glib-devel = %{version}-%{release} %{name}-gobject-devel = %{version}-%{release} %{name}-ui-devel = %{version}-%{release} -Obsoletes: %{name}-glib-devel = %{version}-%{release} %{name}-gobject-devel = %{version}-%{release} %{name}-ui-devel = %{version}-%{release} +Obsoletes: %{name}-glib-devel = %{version}-%{release} %{name}-gobject-devel < %{version}-%{release} %{name}-ui-devel < %{version}-%{release} %description devel Header files for using the avahi libraries. +%if %{WITH_PYTHON} %package -n python2-avahi Summary: Python2 Avahi api Obsoletes: python-avahi < 0.7 Provides: python-avahi = %{version}-%{release} +Requires: %{name} = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release} %description -n python2-avahi @@ -113,10 +148,12 @@ Python2 Avahi api. %package -n python3-avahi Summary: Python3 Avahi api +Requires: %{name} = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release} %description -n python3-avahi Python3 Avahi api. +%endif %package glib Summary: Glib libraries for avahi @@ -149,11 +186,32 @@ Summary: Libraries for avahi run-time use The avahi-libs package contains the libraries needed to run programs that use avahi. +%if %{WITH_QT5} +%package qt5 +Summary: Qt5 libraries for avahi +Requires: %{name}-libs = %{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 = %{version}-%{release} +Requires: %{name}-qt5 = %{version}-%{release} + +%description qt5-devel +The avahi-qt5-devel package contains the header files and libraries +necessary for developing programs using avahi with Qt5. +%endif + %package_help %prep %autosetup -n %{name}-%{version} -p1 +rm -fv docs/INSTALL + + %build NOCONFIGURE=1 ./autogen.sh @@ -163,8 +221,15 @@ NOCONFIGURE=1 ./autogen.sh --with-systemdsystemunitdir=%{_unitdir} --enable-introspection=no \ --enable-shared=yes --enable-static=no --disable-silent-rules \ --enable-compat-libdns_sd --enable-compat-howl --disable-qt3 \ - --disable-qt4 --disable-mono \ - --with-distro=none PYTHON=%{__python2} + --disable-qt4 --disable-mono --enable-gtk\ + --with-distro=none\ +%if ! %{WITH_PYTHON} + --disable-python \ +%endif +%if ! %{WITH_QT5} + --disable-qt5 \ +%endif +; %make_build -k V=1 || make V=1 @@ -181,24 +246,34 @@ install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/avahi-autoipd mkdir -p $RPM_BUILD_ROOT/etc/avahi/etc touch $RPM_BUILD_ROOT/etc/avahi/etc/localtime +%if %{WITH_PYTHON} +# Add python3 support install -d %{buildroot}%{python3_sitelib}/avahi cp -r $RPM_BUILD_ROOT%{python2_sitelib}/avahi/* $RPM_BUILD_ROOT%{python3_sitelib}/avahi/ rm -f $RPM_BUILD_ROOT%{python3_sitelib}/avahi/*.py{c,o} sed -i 's!/usr/bin/python2!/usr/bin/python3!' $RPM_BUILD_ROOT%{python3_sitelib}/avahi/ServiceTypeDatabase.py +# avoid empty GenericName keys from .desktop files for i in $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop ; do if [ -n "$(grep '^GenericName=$' $i)" ]; then desktop-file-edit --copy-name-to-generic-name $i fi done +%else +# unpackaged files +rm -fv $RPM_BUILD_ROOT%{_datadir}/applications/{bssh,bvnc}.desktop +rm -fv $RPM_BUILD_ROOT%{_datadir}/avahi/interfaces/avahi-discover.ui +%endif %find_lang %{name} %delete_la_and_a %check +%if %{WITH_PYTHON} for i in $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop ; do desktop-file-validate $i done +%endif %pre %define gid_uid 70 @@ -287,7 +362,9 @@ fi %{_sbindir}/avahi-daemon %{_sbindir}/avahi-autoipd %dir %{_libdir}/avahi +%if %{WITH_PYTHON} %{_libdir}/avahi/service-types.db +%endif %{_libdir}/libavahi-core.so.* %dir %{_datadir}/avahi @@ -310,7 +387,6 @@ fi %{_unitdir}/avahi-daemon.socket %attr(1770,avahi-autoipd,avahi-autoipd) %dir %{_localstatedir}/lib/avahi-autoipd/ - %exclude %{_sysconfdir}/rc.d/init.d/avahi-daemon %exclude %{_sysconfdir}/rc.d/init.d/avahi-dnsconfd %exclude %{_datadir}/%{name}-%{version}/* @@ -322,6 +398,7 @@ fi %license LICENSE %{_libdir}/libavahi-common.so.* %{_libdir}/libavahi-client.so.* +%{_libdir}/libavahi-libevent.so.* %files glib %{_libdir}/libavahi-glib.so.* @@ -340,22 +417,26 @@ fi %{_libdir}/libavahi-gobject.so %{_libdir}/libavahi-ui.so %{_libdir}/libavahi-ui-gtk3.so +%{_libdir}/libavahi-libevent.so %{_libdir}/pkgconfig/avahi-ui.pc %{_libdir}/pkgconfig/avahi-ui-gtk3.pc %{_libdir}/pkgconfig/avahi-gobject.pc %{_libdir}/pkgconfig/avahi-glib.pc %{_libdir}/pkgconfig/avahi-core.pc %{_libdir}/pkgconfig/avahi-client.pc +%{_libdir}/pkgconfig/avahi-libevent.pc %{_includedir}/* %exclude %{_includedir}/avahi-compat-howl %exclude %{_includedir}/avahi-compat-libdns_sd %exclude %{_includedir}/dns_sd.h +%if %{WITH_PYTHON} %files -n python2-avahi %{python2_sitelib}/avahi/ %files -n python3-avahi %{python3_sitelib}/avahi/ +%endif %files dnsconfd %{_sbindir}/avahi-dnsconfd @@ -364,13 +445,11 @@ fi %files tools %{_bindir}/* +%if %{WITH_PYTHON} %exclude %{_bindir}/b* %exclude %{_bindir}/avahi-discover* %exclude %{_bindir}/avahi-bookmarks -%files ui -%{_libdir}/libavahi-ui.so.* - %files ui-tools %{_bindir}/b* %{_bindir}/avahi-discover @@ -379,6 +458,10 @@ fi %{_datadir}/applications/avahi-discover.desktop %{_datadir}/avahi/interfaces/ %{python2_sitelib}/avahi_discover/ +%endif + +%files ui +%{_libdir}/libavahi-ui.so.* %files compat-howl %{_libdir}/libhowl.so.* @@ -400,6 +483,18 @@ fi %{_libdir}/pkgconfig/avahi-compat-libdns_sd.pc %{_libdir}/pkgconfig/libdns_sd.pc +%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 + %files help %defattr(644,root,root) %doc docs/* avahi-daemon/example.service avahi-daemon/sftp-ssh.service avahi-daemon/ssh.service @@ -408,6 +503,12 @@ fi %{_mandir}/man8/* %changelog +* Tue Aug 18 2020 wangye - 0.8-1 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:upgrade to version 0.8 + * Sat Feb 29 2020 hexiujun - 0.7-21 - Type:NA - ID:NA