@ -1,4 +1,5 @@
%bcond_with bootstrap
%bcond_without check
%if %{without bootstrap}
%{?!WITH_MONO: %global WITH_MONO 1}
@ -12,8 +13,12 @@
%{?!WITH_QT4: %global WITH_QT4 0}
%if %{without bootstrap}
%{?!WITH_GTK2: %global WITH_GTK2 1}
%{?!WITH_GTK3: %global WITH_GTK3 1}
%{?!WITH_QT5: %global WITH_QT5 1}
%else
%{?!WITH_GTK2: %global WITH_GTK2 0}
%{?!WITH_GTK3: %global WITH_GTK3 0}
%{?!WITH_QT5: %global WITH_QT5 0}
%endif
@ -30,6 +35,9 @@
%endif
%if 0%{?rhel}
%if 0%{?rhel} > 9
%global WITH_GTK2 0
%endif
%global WITH_MONO 0
%global WITH_QT5 0
%if 0%{?rhel} < 8
@ -37,8 +45,10 @@
%endif
%endif
%if 0%{?fedora} == 34 || 0%{?rhel} >= 9
# https://bugzilla.redhat.com/show_bug.cgi?id=1907727
%global _lto_cflags %{nil}
%endif
# http://bugzilla.redhat.com/1008395 - no hardened build
%global _hardened_build 1
@ -48,9 +58,9 @@
Name: avahi
Version: 0.8
Release: 15 %{?dist}
Release: 30 %{?dist}
Summary: Local network service discovery
License: LGPLv2+
License: LGPL-2.1-or-later AND LGPL-2.0-or-later AND BSD-2-Clause-Views AND MIT
URL: http://avahi.org
Requires: dbus
Requires: expat
@ -63,10 +73,11 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
BuildRequires: automake
BuildRequires: libtool
BuildRequires: dbus-devel >= 0.90
BuildRequires: dbus-glib-devel >= 0.70
BuildRequires: desktop-file-utils
%if %{without bootstrap }
%if %{WITH_GTK2 }
BuildRequires: gtk2-devel
%endif
%if %{WITH_GTK3}
BuildRequires: gtk3-devel >= 2.99.0
%endif
#BuildRequires: gobject-introspection-devel
@ -114,7 +125,6 @@ BuildRequires: mono-devel
BuildRequires: monodoc-devel
%endif
BuildRequires: systemd
%{?systemd_requires}
BuildRequires: gcc
BuildRequires: gcc-c++
@ -122,19 +132,33 @@ BuildRequires: gcc-c++
Source0: https://github.com/lathiat/avahi/archive/%{version}-%{beta}.tar.gz#/%{name}-%{version}-%{beta}.tar.gz
%else
Source0: https://github.com/lathiat/avahi/releases/download/v%{version}/avahi-%{version}.tar.gz
#Source0: http://avahi.org/download/avahi-%{version}.tar.gz
#Source0: http://avahi.org/download/avahi-%% {version}.tar.gz
%endif
## upstream patches
# https://github.com/lathiat/avahi/commit/9c3a314856affb288f701d2d3ee23278fc98eaee
Patch6: 0006-avahi-dnsconfd.service-Drop-Also-avahi-daemon.socket.patch
# https://github.com/lathiat/avahi/pull/148
# https://github.com/lathiat/avahi/commit/f983df44870b602179b493f9c3d113753b378e27
Patch7: 0007-man-add-missing-bshell.1-symlink.patch
# https://github.com/lathiat/avahi/pull/142
Patch8: 0008-Ship-avahi-discover-1-bssh-1-and-bvnc-1-also-for-GTK.patch
# https://github.com/lathiat/avahi/pull/265
# https://github.com/lathiat/avahi/commit/366e3798bdbd6b7bf24e59379f4a9a51af575ce9
Patch9: 0009-fix-requires-in-pc-file.patch
# https://github.com/lathiat/avahi/pull/270
# https://github.com/lathiat/avahi/commit/a94f72081dd1d546a1d95d860311a1242315bb28
Patch10: 0010-fix-bytestring-decoding-for-proper-display.patch
# https://github.com/lathiat/avahi/pull/268
# https://github.com/lathiat/avahi/commit/b897ca43ac100d326d118e5877da710eb7f836f9
Patch11: 0011-avahi_dns_packet_consume_uint32-fix-potential-undefi.patch
Patch12: 0001-Avoid-infinite-loop-in-avahi-daemon-by-handling-HUP-.patch
Patch13: 0001-Fix-NULL-pointer-crashes-from-175.patch
Patch14: 0001-Emit-error-if-requested-service-is-not-found.patch
# https://github.com/lathiat/avahi/pull/324
# https://github.com/lathiat/avahi/commit/9d31939e55280a733d930b15ac9e4dda4497680c
Patch16: 0016-Fix-NULL-pointer-crashes-from-175.patch
# https://github.com/lathiat/avahi/pull/407
Patch17: 0017-Emit-error-if-requested-service-is-not-found.patch
Patch18: 0001-avahi-client-fix-resource-leak.patch
Patch19: 0001-avahi-core-rearrange-deallocations-in-avahi_time_eve.patch
## downstream patches
Patch100: avahi-0.6.30-mono-libdir.patch
@ -142,6 +166,7 @@ Patch100: avahi-0.6.30-mono-libdir.patch
# https://github.com/lathiat/avahi/pull/312
Patch101: 0016-fix-QT3-build.patch
Patch102: avahi-0.8-no_undefined.patch
Patch103: avahi-0.8-no-vncviewer-c10s.patch
%description
Avahi is a system which facilitates service discovery on
@ -166,7 +191,11 @@ Requires: %{name} = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: %{name}-glib%{?_isa} = %{version}-%{release}
Requires: %{name}-ui-gtk3%{?_isa} = %{version}-%{release}
%if 0%{?rhel} && 0%{?rhel} > 9
Requires: gnome-connections
%else
Requires: tigervnc
%endif
Requires: openssh-clients
%if %{WITH_PYTHON}
Requires: gdbm
@ -209,13 +238,12 @@ This library contains a GObject wrapper for the Avahi API
Summary: Libraries and header files for Avahi GObject development
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-gobject%{?_isa} = %{version}-%{release}
#Requires: %{name}-glib-devel = %{version}-%{release}
%description gobject-devel
The avahi-gobject-devel package contains the header files and libraries
necessary for developing programs using avahi-gobject.
%if %{without bootstrap }
%if %{WITH_GTK2 }
%package ui
Summary: Gtk user interface library for Avahi (Gtk+ 2 version)
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
@ -224,7 +252,9 @@ Requires: gtk2
%description ui
This library contains a Gtk 2.x widget for browsing services.
%endif
%if %{WITH_GTK3}
%package ui-gtk3
Summary: Gtk user interface library for Avahi (Gtk+ 3 version)
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
@ -233,13 +263,18 @@ Requires: gtk3
%description ui-gtk3
This library contains a Gtk 3.x widget for browsing services.
%endif
%if %{WITH_GTK2} || %{WITH_GTK3}
%package ui-devel
Summary: Libraries and header files for Avahi UI development
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%if %{WITH_GTK2}
Requires: %{name}-ui%{?_isa} = %{version}-%{release}
%endif
%if %{WITH_GTK3}
Requires: %{name}-ui-gtk3%{?_isa} = %{version}-%{release}
#Requires: %{name}-glib-devel = %{version}-%{release}
%endif
%description ui-devel
The avahi-ui-devel package contains the header files and libraries
@ -354,8 +389,8 @@ necessary for developing programs using avahi.
%package compat-howl
Summary: Libraries for howl compatibility
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Obsoletes: howl-libs
Provides: howl-libs
Obsoletes: howl-libs < 0.6-16
Provides: howl-libs = %{version}-%{release}
%description compat-howl
Libraries that are compatible with those provided by the howl package.
@ -364,8 +399,8 @@ Libraries that are compatible with those provided by the howl package.
Summary: Header files for development with the howl compatibility libraries
Requires: %{name}-compat-howl%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Obsoletes: howl-devel
Provides: howl-devel
Obsoletes: howl-devel < 0.6-16
Provides: howl-devel = %{version}-%{release}
%description compat-howl-devel
Header files for development with the howl compatibility libraries.
@ -440,9 +475,10 @@ rm -fv docs/INSTALL
%build
# patch100/101/102 requires autogen
# and kills rpaths a bonus
rm -fv missing
## why autogen?
## * kills rpaths
## * fixes -stack-protector flags (once gcc_stack_protect.m4 is removed)
rm -fv missing common/gcc_stack_protect.m4
NOCONFIGURE=1 ./autogen.sh
%configure \
@ -458,11 +494,17 @@ NOCONFIGURE=1 ./autogen.sh
--enable-shared=yes \
--enable-static=no \
--disable-silent-rules \
--disable-stack-protector \
%if %{without bootstrap}
%if %{with check}
--enable-tests \
%endif
%if %{WITH_GTK2}
--enable-gtk \
%else
--disable-gtk \
%endif
%if %{WITH_GTK3}
--enable-gtk3 \
%else
--disable-gtk3 \
%endif
%if ! %{WITH_PYTHON}
@ -510,8 +552,8 @@ mkdir -p %{buildroot}%{_localstatedir}/lib/avahi-autoipd
rm -rfv %{buildroot}%{_datadir}/%{name}-%{version}
# Make /etc/avahi/etc/localtime owned by avahi:
mkdir -p %{buildroot}/etc /avahi/etc
touch %{buildroot}/etc /avahi/etc/localtime
mkdir -p %{buildroot}%{_sysconfdir} /avahi/etc
touch %{buildroot}%{_sysconfdir} /avahi/etc/localtime
# fix bug 197414 - add missing symlinks for avahi-compat-howl and avahi-compat-dns-sd
%if %{WITH_COMPAT_HOWL}
@ -535,10 +577,6 @@ if [ -n "$(grep '^GenericName=$' $i)" ]; then
desktop-file-edit --copy-name-to-generic-name $i
fi
done
%else
# unpackaged files
rm -fv %{buildroot}%{_datadir}/applications/{bssh,bvnc}.desktop
rm -fv %{buildroot}%{_datadir}/avahi/interfaces/avahi-discover.ui
%endif
rm -fv %{buildroot}%{_sysconfdir}/rc.d/init.d/avahi-daemon
@ -548,11 +586,17 @@ rm -fv %{buildroot}%{_sysconfdir}/rc.d/init.d/avahi-dnsconfd
%check
%if %{WITH_PYTHON}
for i in %{buildroot}%{_datadir}/applications/*.desktop ; do
%if %{with check}
%make_build check
%endif
%if %{without bootstrap}
for i in %{buildroot}%{_datadir}/applications/b*.desktop ; do
desktop-file-validate $i
done
%endif
%if %{WITH_PYTHON}
desktop-file-validate %{buildroot}%{_datadir}/applications/avahi-discover.desktop
%endif
%pre
@ -570,7 +614,7 @@ exit 0
%{?ldconfig}
/usr/bin/dbus-send --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig >/dev/null 2>&1 || :
if [ "$1" -eq 1 -a -s /etc/localtime ]; then
/usr/bin/cp -cfp /etc/localtime /etc /avahi/etc/localtime >/dev/null 2>&1 || :
/usr/bin/cp -cfp /etc/localtime %{_sysconfdir} /avahi/etc/localtime >/dev/null 2>&1 || :
fi
%systemd_post avahi-daemon.socket avahi-daemon.service
@ -622,7 +666,7 @@ exit 0
%ghost %{_sysconfdir}/avahi/etc/localtime
%config(noreplace) %{_sysconfdir}/avahi/hosts
%dir %{_sysconfdir}/avahi/services
%ghost %dir %{_localstatedir}/run/avahi-daemon
%ghost %attr(0755, avahi, avahi) % dir %{_localstatedir}/run/avahi-daemon
%config(noreplace) %{_sysconfdir}/avahi/avahi-daemon.conf
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/avahi-dbus.conf
%{_sbindir}/avahi-daemon
@ -673,6 +717,7 @@ exit 0
%{_mandir}/man1/avahi-resolve-host-name.1*
%{_mandir}/man1/avahi-set-host-name.1*
%if %{without bootstrap}
%files ui-tools
%{_bindir}/bshell
%{_bindir}/bssh
@ -681,16 +726,17 @@ exit 0
%{_mandir}/man1/bshell.1*
%{_mandir}/man1/bssh.1*
%{_mandir}/man1/bvnc.1*
%{_datadir}/applications/b*.desktop
%{_datadir}/avahi/interfaces/
%if %{WITH_PYTHON}
# avahi-bookmarks is not really a UI tool, but I won't create a seperate package for it...
%{_bindir}/avahi-bookmarks
%{_mandir}/man1/avahi-discover*
%{_mandir}/man1/avahi-bookmarks*
%{_datadir}/applications/b*.desktop
%{_datadir}/applications/avahi-discover.desktop
%{_datadir}/avahi/interfaces/
%{python2_sitelib}/avahi_discover/
%endif
%endif
%files devel
%{_libdir}/libavahi-common.so
@ -722,30 +768,38 @@ exit 0
%files gobject
%{_libdir}/libavahi-gobject.so.*
#%{_libdir}/girepository-1.0/Avahi-0.6.typelib
#%{_libdir}/girepository-1.0/AvahiCore-0.6.typelib
#%% {_libdir}/girepository-1.0/Avahi-0.6.typelib
#%% {_libdir}/girepository-1.0/AvahiCore-0.6.typelib
%files gobject-devel
%{_libdir}/libavahi-gobject.so
%{_includedir}/avahi-gobject
%{_libdir}/pkgconfig/avahi-gobject.pc
#%{_datadir}/gir-1.0/Avahi-0.6.gir
#%{_datadir}/gir-1.0/AvahiCore-0.6.gir
#%% {_datadir}/gir-1.0/Avahi-0.6.gir
#%% {_datadir}/gir-1.0/AvahiCore-0.6.gir
%if %{without bootstrap }
%if %{WITH_GTK2 }
%files ui
%{_libdir}/libavahi-ui.so.*
%endif
%if %{WITH_GTK3}
%files ui-gtk3
%{_libdir}/libavahi-ui-gtk3.so.*
%endif
%if %{WITH_GTK2} || %{WITH_GTK3}
%files ui-devel
%{_libdir}/libavahi-ui.so
%{_libdir}/libavahi-ui-gtk3.so
%{_includedir}/avahi-ui
%if %{WITH_GTK2}
%{_libdir}/libavahi-ui.so
%{_libdir}/pkgconfig/avahi-ui.pc
%endif
%if %{WITH_GTK3}
%{_libdir}/libavahi-ui-gtk3.so
%{_libdir}/pkgconfig/avahi-ui-gtk3.pc
%endif
%endif
%if %{WITH_QT3}
%ldconfig_scriptlets qt3
@ -830,24 +884,80 @@ exit 0
%changelog
* Wed Aug 23 2023 Michal Sekletar <msekleta@redhat.com> - 0.8-15
- Fix CVE-2023-1981 (#2186689)
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 0.8-30
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Fri Oct 25 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 0.8-29
- Rebuilt for MSVSphere 10
* Thu Aug 22 2024 Michal Sekletar <msekleta@redhat.com> - 0.8-29
- fix file attributes of /run/avahi-daemon (RHEL-55762)
- fix SAST issues (RHEL-40016)
* Thu Jun 27 2024 Tomas Popela <tpopela@redhat.com> - 0.8-28
- TigerVNC won't be shipped in RHEL 10, prefer GNOME Connections instead
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 0.8-27
- Bump release for June 2024 mass rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Jul 26 2023 Lukáš Zaoral <lzaoral@redhat.com> - 0.8-25
- migrate to SPDX license format
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed May 10 2023 Tomas Popela <tpopela@redhat.com> - 0.8-23
- Drop BR on dbus-glib as the project is not using it at all
* Sun Mar 19 2023 Petr Menšík <pemensik@redhat.com> - 0.8-22
- Enable unit tests during check
- Prevent crashes on some invalid DBus calls
- Provide versioned howl compatibility package
- Correct bootstrap option
* Sun Mar 19 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 0.8-21
- Disable GTK2 in ELN/RHEL10 builds
* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Nov 11 2022 Petr Menšík <pemensik@redhat.com> - 0.8-19
- Add upstream PR links to patches
* Tue Nov 01 2022 Christian Krause <chkr@fedoraproject.org> - 0.8-18
- Install glade file for avahi-discover-standalone unconditionally
(fixes #2036073 and #2126721)
- Install desktop files for bssh and bvnc unconditionally
* Fri Aug 05 2022 Kalev Lember <klember@redhat.com> - 0.8-17
- Avoid systemd_requires as per updated packaging guidelines
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Aug 23 2023 Michal Sekletar <msekleta@redhat.com> - 0.8-14
- Fix CVE-2021-3502 (#1949949)
* Tue Aug 03 2021 Rex Dieter <rdieter@fedoraproject.org> - 0.8-14
- pull in upstream fix for CVE-2021-36217 (#1989381,#1989382)
- revert "Re-enable LTO" on f34 (still needed)
* Thu Aug 17 2023 Michal Sekletar <msekleta@redhat.com> - 0.8-13
- Fix CVE-2021-3468 (#1944092)
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org > - 0.8-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon Feb 21 2022 Michal Sekletár <msekleta@redhat.com> - 0.8-12
- make sure we get compiled with -fstack-protector-strong (#2044643)
* Mon May 10 2021 Jeff Law <jlaw@tachyum .com> - 0.8-12
- Re-enable LTO
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.8-11
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Apr 29 2021 Rex Dieter <rdieter@fedoraproject.org> - 0.8-11
- avahi libraries missing -fstack-protector-strong (#1817737)
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 0.8-10
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.8-10
- Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.
* Tue Feb 16 2021 Rex Dieter <rdieter@fedoraproject.org> - 0.8-9
- cleanup/fix conditionals (#1751484)