From 9d343edf62bd7dedb5321b1be476144010402a13844b9847247793d3eec5a0d3 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Wed, 25 Apr 2018 08:12:30 +0000 Subject: [PATCH] Accepting request 600813 from GNOME:Next OBS-URL: https://build.opensuse.org/request/show/600813 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/avahi?expand=0&rev=148 --- avahi-0.7-python3.patch | 36 ++++++++++++++++++++++++ avahi-glib2.spec | 62 +++++++++++++++++++++++------------------ avahi-mono.spec | 62 +++++++++++++++++++++++------------------ avahi-qt4.spec | 62 +++++++++++++++++++++++------------------ avahi.changes | 11 ++++++++ avahi.spec | 62 +++++++++++++++++++++++------------------ 6 files changed, 187 insertions(+), 108 deletions(-) create mode 100644 avahi-0.7-python3.patch diff --git a/avahi-0.7-python3.patch b/avahi-0.7-python3.patch new file mode 100644 index 0000000..033b2d6 --- /dev/null +++ b/avahi-0.7-python3.patch @@ -0,0 +1,36 @@ +diff -urp avahi-0.7.orig/configure.ac avahi-0.7/configure.ac +--- avahi-0.7.orig/configure.ac 2017-07-10 05:14:59.131370037 -0500 ++++ avahi-0.7/configure.ac 2018-01-18 16:51:43.817275133 -0600 +@@ -825,7 +825,7 @@ if test "x$HAVE_PYTHON" = "xyes" ; then + + AM_CHECK_PYMOD(socket,,,[AC_MSG_ERROR(Could not find Python module socket)]) + if test "x$HAVE_GDBM" = "xyes"; then +- AM_CHECK_PYMOD(gdbm,,,[AC_MSG_ERROR(Could not find Python module gdbm)]) ++ AM_CHECK_PYMOD(dbm.gnu,,,[AC_MSG_ERROR(Could not find Python module dbm.gnu)]) + fi + if test "x$HAVE_DBM" = "xyes"; then + AM_CHECK_PYMOD(dbm,,,[AC_MSG_ERROR(Could not find Python module dbm)]) +diff -urp avahi-0.7.orig/service-type-database/build-db.in avahi-0.7/service-type-database/build-db.in +--- avahi-0.7.orig/service-type-database/build-db.in 2017-07-10 05:14:59.147369677 -0500 ++++ avahi-0.7/service-type-database/build-db.in 2018-01-19 12:06:27.261215050 -0600 +@@ -31,7 +31,7 @@ else: + + db = @DBM@.open(outfn, "n") + +-for ln in file(infn, "r"): ++for ln in open(infn, "r"): + ln = ln.strip(" \r\n\t") + + if ln == "" or ln.startswith("#"): +diff -urp avahi-0.7.orig/service-type-database/Makefile.am avahi-0.7/service-type-database/Makefile.am +--- avahi-0.7.orig/service-type-database/Makefile.am 2017-07-10 05:14:59.147369677 -0500 ++++ avahi-0.7/service-type-database/Makefile.am 2018-01-18 16:53:19.133474971 -0600 +@@ -29,7 +29,7 @@ pkglibdata_DATA+=service-types.db + + build-db: build-db.in + $(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \ +- -e 's,@DBM\@,gdbm,g' $< > $@ && \ ++ -e 's,@DBM\@,dbm.gnu,g' $< > $@ && \ + chmod +x $@ + + service-types.db: service-types build-db diff --git a/avahi-glib2.spec b/avahi-glib2.spec index 0ad59be..46a40a9 100644 --- a/avahi-glib2.spec +++ b/avahi-glib2.spec @@ -22,7 +22,7 @@ # For build all at once, set all to 1. # If you set build_core to 0, you cannot set more than one other option to 1. %define build_core 0 -# NOTE: build_glib2 also controls build of gobject, gtk2, gtk3 code. +# NOTE: build_glib2 also controls build of gobject, gtk2, gtk3 and pygobject code. %define build_glib2 1 %define build_mono 0 %define build_qt4 0 @@ -71,19 +71,21 @@ Patch4: avahi-daemon-check-dns-suse.patch Patch18: avahi-0.6.31-invalid-packet.patch # PATCH-FIX-UPSTREAM avahi-0.6.32-suppress-resolv-conf-warning.patch bsc#982317 mgorse@suse.com -- only warn on missing resolv.conf if it is being used. Patch19: avahi-0.6.32-suppress-resolv-conf-warning.patch -BuildRequires: dbus-1-python + # PATCH-FIX-UPSTREAM avahi-0.7-python3.patch bsc#1076402 mgorse@suse.com -- port to Python 3. +Patch20: avahi-0.7-python3.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: gdbm-devel BuildRequires: intltool BuildRequires: libdaemon-devel BuildRequires: libexpat-devel +BuildRequires: python3-dbus-python # libtool is needed to build all variants: bootstrap is unconditional in the build section BuildRequires: libtool BuildRequires: pkgconfig # Even if we are not building python bindings, we need python to build service types database: -BuildRequires: python-devel -BuildRequires: python-gdbm +BuildRequires: python3-dbm +BuildRequires: python3-devel BuildRequires: translation-update-upstream # FIXME: on upgrade, ensure to verify if -DGTK_DISABLE_DEPRECATED=1 can remain in avahi=ui/Makefile.am (GtkStock deprecated with GTK+ 3.9.10). %if !%{build_glib2} && !%{build_mono} && !%{build_qt4} @@ -97,7 +99,7 @@ BuildRequires: strip-nondeterminism BuildRequires: dbus-1-devel BuildRequires: doxygen BuildRequires: graphviz -BuildRequires: python-gdbm +BuildRequires: python3-dbm BuildRequires: zlib-devel BuildRequires: pkgconfig(systemd) # For python bindings and utilities: @@ -262,21 +264,21 @@ tests in the Apple Bonjour conformance test suite. In addition it supports some nifty things that have never been seen elsewhere like correct mDNS reflection across LAN segments. -%package -n python-avahi +%package -n python3-avahi Summary: A set of Avahi utilities written in Python Group: Development/Languages/Python Requires: %{name} = %{version} Requires: dbus-1-python -Requires: python-gdbm -Requires: python-twisted -Requires: python-twisted-web +Requires: python3-Twisted +Requires: python3-dbm # FIXME: use proper Requires(pre/post/preun/...) PreReq: coreutils # Old name used for <= 10.3: Provides: avahi-python = %{version} Obsoletes: avahi-python < %{version} +Obsoletes: python-avahi -%description -n python-avahi +%description -n python3-avahi Avahi is an implementation of the DNS Service Discovery and Multicast DNS specifications for Zeroconf Computing. It uses D-BUS for communication between user applications and a system daemon. The daemon @@ -516,20 +518,22 @@ It passes all tests in the Apple Bonjour conformance test suite. In addition, it supports some nifty things, like correct mDNS reflection across LAN segments. -%package -n python-avahi-gtk +%package -n python3-avahi-gtk Summary: A set of Avahi utilities written in Python Using python-gtk Group: Development/Languages/Python -Requires: python-avahi = %{version} -Requires: python-gtk +Requires: python3-avahi = %{version} +Requires: python3-gobject # FIXME: use proper Requires(pre/post/preun/...) PreReq: coreutils # Old name used for <= 10.3: Provides: avahi-python = %{version} Obsoletes: avahi-python < %{version} +Obsoletes: python-avahi-gtk # Provide split-provides for update from <= 11.0: Provides: python-avahi:%{_bindir}/avahi-bookmarks +Obsoletes: python-avahi < %{version} -%description -n python-avahi-gtk +%description -n python3-avahi-gtk Avahi is an implementation of the DNS Service Discovery and Multicast DNS specifications for Zeroconf Computing. It uses D-BUS for communication between user applications and a system daemon. The daemon @@ -682,6 +686,7 @@ translation-update-upstream %patch4 %patch18 -p1 %patch19 -p1 +%patch20 -p1 %if !%{build_core} # Replace all .la references from local .la files to installed versions @@ -706,6 +711,7 @@ sed -i "s:-DGTK_DISABLE_DEPRECATED=1::" avahi-ui/Makefile.am %build autoreconf -f -i intltoolize -f +export PYTHON=/usr/bin/python3 %configure\ --libexecdir=%{_prefix}/lib\ --disable-static\ @@ -815,7 +821,7 @@ install -d %{buildroot}/%{_datadir}/pixmaps install -d %{buildroot}%{_fillupdir} install -m 644 sysconfig.avahi* %{buildroot}%{_fillupdir}/ %if ! %{build_glib2} -# Note: This file is intentionally installed here. It is needed for avahi-utils-gtk and python-avahi-gtk: +# Note: This file is intentionally installed here. It is needed for avahi-utils-gtk and python3-avahi-gtk: install -d %{buildroot}/%{_datadir}/avahi/interfaces install -m 644 avahi-discover-standalone/avahi-discover.ui %{buildroot}/%{_datadir}/avahi/interfaces %endif @@ -827,7 +833,7 @@ rm %{buildroot}/%{_libdir}/pkgconfig/avahi-client.pc rm %{buildroot}/%{_libdir}/pkgconfig/avahi-core.pc %if %{build_glib2} rm %{buildroot}/%{_bindir}/avahi-bookmarks -rm -r %{buildroot}/%{python_sitelib}/avahi +rm -r %{buildroot}/%{python3_sitelib}/avahi rm %{buildroot}/%{_mandir}/man1/avahi-bookmarks.1* rm %{buildroot}/%{_mandir}/man1/avahi-browse-domains.1* rm %{buildroot}/%{_mandir}/man1/avahi-browse.1* @@ -846,7 +852,7 @@ rm %{buildroot}/%{_mandir}/man8/avahi-autoipd.action.8* rm %{buildroot}/%{_mandir}/man8/avahi-daemon.8* rm %{buildroot}/%{_mandir}/man8/avahi-dnsconfd.8* rm %{buildroot}/%{_mandir}/man8/avahi-dnsconfd.action.8* -# Note: This file was intentionally moved to avahi. It is needed for avahi-utils-gtk and python-avahi-gtk: +# Note: This file was intentionally moved to avahi. It is needed for avahi-utils-gtk and python3-avahi-gtk: rm %{buildroot}/%{_datadir}/avahi/interfaces/avahi-discover.ui rmdir %{buildroot}/%{_datadir}/avahi/interfaces rmdir %{buildroot}/%{_datadir}/avahi @@ -927,10 +933,10 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %postun -n libavahi-gobject0 -p /sbin/ldconfig %post -n libavahi-glib1 -p /sbin/ldconfig %postun -n libavahi-glib1 -p /sbin/ldconfig -%post -n python-avahi-gtk +%post -n python3-avahi-gtk %desktop_database_post -%postun -n python-avahi-gtk +%postun -n python3-avahi-gtk %desktop_database_post %post -n avahi-utils-gtk @@ -950,7 +956,7 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %license LICENSE %doc docs/* %dir %{_libdir}/avahi/ -# Note: This file is intentionally packaged here. It is needed for python-avahi and avahi-utils: +# Note: This file is intentionally packaged here. It is needed for python3-avahi and avahi-utils: %{_libdir}/avahi/service-types.db # avahi creates the directory itself, we do not package it # since it might be on tmpfs @@ -977,7 +983,7 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %{_unitdir}/avahi-daemon.service %{_unitdir}/avahi-daemon.socket %{_unitdir}/avahi-dnsconfd.service -# Common file for avahi-utils-gtk and python-avahi-gtk: +# Common file for avahi-utils-gtk and python3-avahi-gtk: %dir %{_datadir}/avahi/ %{_datadir}/avahi/interfaces %{_sysconfdir}/sysconfig/network/*/avahi-daemon @@ -1002,12 +1008,14 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %files -n libhowl0 %{_libdir}/libhowl.so.* -%files -n python-avahi +%files -n python3-avahi %{_bindir}/avahi-bookmarks %{_mandir}/man1/avahi-bookmarks.1%{ext_man} -%dir %{python_sitelib}/avahi -%{python_sitelib}/avahi/__init__.py* -%{python_sitelib}/avahi/ServiceTypeDatabase.py +%dir %{python3_sitelib}/avahi +%{python3_sitelib}/avahi/__init__.py* +%dir %{python3_sitelib}/avahi/__pycache__ +%{python3_sitelib}/avahi/__pycache__/__init__* +%{python3_sitelib}/avahi/ServiceTypeDatabase.py %files autoipd %doc avahi-autoipd/README.SUSE @@ -1080,11 +1088,11 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %{_libdir}/girepository-1.0/Avahi-0.6.typelib %{_libdir}/girepository-1.0/AvahiCore-0.6.typelib -%files -n python-avahi-gtk +%files -n python3-avahi-gtk %{_bindir}/avahi-discover %{_datadir}/applications/avahi-discover.desktop %{_mandir}/man1/avahi-discover.1* -%{python_sitelib}/avahi_discover +%{python3_sitelib}/avahi_discover %files -n avahi-utils-gtk %{_bindir}/bshell diff --git a/avahi-mono.spec b/avahi-mono.spec index c918d63..50d6c24 100644 --- a/avahi-mono.spec +++ b/avahi-mono.spec @@ -22,7 +22,7 @@ # For build all at once, set all to 1. # If you set build_core to 0, you cannot set more than one other option to 1. %define build_core 0 -# NOTE: build_glib2 also controls build of gobject, gtk2, gtk3 code. +# NOTE: build_glib2 also controls build of gobject, gtk2, gtk3 and pygobject code. %define build_glib2 0 %define build_mono 1 %define build_qt4 0 @@ -71,19 +71,21 @@ Patch4: avahi-daemon-check-dns-suse.patch Patch18: avahi-0.6.31-invalid-packet.patch # PATCH-FIX-UPSTREAM avahi-0.6.32-suppress-resolv-conf-warning.patch bsc#982317 mgorse@suse.com -- only warn on missing resolv.conf if it is being used. Patch19: avahi-0.6.32-suppress-resolv-conf-warning.patch -BuildRequires: dbus-1-python + # PATCH-FIX-UPSTREAM avahi-0.7-python3.patch bsc#1076402 mgorse@suse.com -- port to Python 3. +Patch20: avahi-0.7-python3.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: gdbm-devel BuildRequires: intltool BuildRequires: libdaemon-devel BuildRequires: libexpat-devel +BuildRequires: python3-dbus-python # libtool is needed to build all variants: bootstrap is unconditional in the build section BuildRequires: libtool BuildRequires: pkgconfig # Even if we are not building python bindings, we need python to build service types database: -BuildRequires: python-devel -BuildRequires: python-gdbm +BuildRequires: python3-dbm +BuildRequires: python3-devel BuildRequires: translation-update-upstream # FIXME: on upgrade, ensure to verify if -DGTK_DISABLE_DEPRECATED=1 can remain in avahi=ui/Makefile.am (GtkStock deprecated with GTK+ 3.9.10). %if !%{build_glib2} && !%{build_mono} && !%{build_qt4} @@ -97,7 +99,7 @@ BuildRequires: strip-nondeterminism BuildRequires: dbus-1-devel BuildRequires: doxygen BuildRequires: graphviz -BuildRequires: python-gdbm +BuildRequires: python3-dbm BuildRequires: zlib-devel BuildRequires: pkgconfig(systemd) # For python bindings and utilities: @@ -261,21 +263,21 @@ tests in the Apple Bonjour conformance test suite. In addition it supports some nifty things that have never been seen elsewhere like correct mDNS reflection across LAN segments. -%package -n python-avahi +%package -n python3-avahi Summary: A set of Avahi utilities written in Python Group: Development/Languages/Python Requires: %{name} = %{version} Requires: dbus-1-python -Requires: python-gdbm -Requires: python-twisted -Requires: python-twisted-web +Requires: python3-Twisted +Requires: python3-dbm # FIXME: use proper Requires(pre/post/preun/...) PreReq: coreutils # Old name used for <= 10.3: Provides: avahi-python = %{version} Obsoletes: avahi-python < %{version} +Obsoletes: python-avahi -%description -n python-avahi +%description -n python3-avahi Avahi is an implementation of the DNS Service Discovery and Multicast DNS specifications for Zeroconf Computing. It uses D-BUS for communication between user applications and a system daemon. The daemon @@ -515,20 +517,22 @@ It passes all tests in the Apple Bonjour conformance test suite. In addition, it supports some nifty things, like correct mDNS reflection across LAN segments. -%package -n python-avahi-gtk +%package -n python3-avahi-gtk Summary: A set of Avahi utilities written in Python Using python-gtk Group: Development/Languages/Python -Requires: python-avahi = %{version} -Requires: python-gtk +Requires: python3-avahi = %{version} +Requires: python3-gobject # FIXME: use proper Requires(pre/post/preun/...) PreReq: coreutils # Old name used for <= 10.3: Provides: avahi-python = %{version} Obsoletes: avahi-python < %{version} +Obsoletes: python-avahi-gtk # Provide split-provides for update from <= 11.0: Provides: python-avahi:%{_bindir}/avahi-bookmarks +Obsoletes: python-avahi < %{version} -%description -n python-avahi-gtk +%description -n python3-avahi-gtk Avahi is an implementation of the DNS Service Discovery and Multicast DNS specifications for Zeroconf Computing. It uses D-BUS for communication between user applications and a system daemon. The daemon @@ -682,6 +686,7 @@ translation-update-upstream %patch4 %patch18 -p1 %patch19 -p1 +%patch20 -p1 %if !%{build_core} # Replace all .la references from local .la files to installed versions @@ -706,6 +711,7 @@ sed -i "s:-DGTK_DISABLE_DEPRECATED=1::" avahi-ui/Makefile.am %build autoreconf -f -i intltoolize -f +export PYTHON=/usr/bin/python3 %configure\ --libexecdir=%{_prefix}/lib\ --disable-static\ @@ -815,7 +821,7 @@ install -d %{buildroot}/%{_datadir}/pixmaps install -d %{buildroot}%{_fillupdir} install -m 644 sysconfig.avahi* %{buildroot}%{_fillupdir}/ %if ! %{build_glib2} -# Note: This file is intentionally installed here. It is needed for avahi-utils-gtk and python-avahi-gtk: +# Note: This file is intentionally installed here. It is needed for avahi-utils-gtk and python3-avahi-gtk: install -d %{buildroot}/%{_datadir}/avahi/interfaces install -m 644 avahi-discover-standalone/avahi-discover.ui %{buildroot}/%{_datadir}/avahi/interfaces %endif @@ -827,7 +833,7 @@ rm %{buildroot}/%{_libdir}/pkgconfig/avahi-client.pc rm %{buildroot}/%{_libdir}/pkgconfig/avahi-core.pc %if %{build_glib2} rm %{buildroot}/%{_bindir}/avahi-bookmarks -rm -r %{buildroot}/%{python_sitelib}/avahi +rm -r %{buildroot}/%{python3_sitelib}/avahi rm %{buildroot}/%{_mandir}/man1/avahi-bookmarks.1* rm %{buildroot}/%{_mandir}/man1/avahi-browse-domains.1* rm %{buildroot}/%{_mandir}/man1/avahi-browse.1* @@ -846,7 +852,7 @@ rm %{buildroot}/%{_mandir}/man8/avahi-autoipd.action.8* rm %{buildroot}/%{_mandir}/man8/avahi-daemon.8* rm %{buildroot}/%{_mandir}/man8/avahi-dnsconfd.8* rm %{buildroot}/%{_mandir}/man8/avahi-dnsconfd.action.8* -# Note: This file was intentionally moved to avahi. It is needed for avahi-utils-gtk and python-avahi-gtk: +# Note: This file was intentionally moved to avahi. It is needed for avahi-utils-gtk and python3-avahi-gtk: rm %{buildroot}/%{_datadir}/avahi/interfaces/avahi-discover.ui rmdir %{buildroot}/%{_datadir}/avahi/interfaces rmdir %{buildroot}/%{_datadir}/avahi @@ -927,10 +933,10 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %postun -n libavahi-gobject0 -p /sbin/ldconfig %post -n libavahi-glib1 -p /sbin/ldconfig %postun -n libavahi-glib1 -p /sbin/ldconfig -%post -n python-avahi-gtk +%post -n python3-avahi-gtk %desktop_database_post -%postun -n python-avahi-gtk +%postun -n python3-avahi-gtk %desktop_database_post %post -n avahi-utils-gtk @@ -950,7 +956,7 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %license LICENSE %doc docs/* %dir %{_libdir}/avahi/ -# Note: This file is intentionally packaged here. It is needed for python-avahi and avahi-utils: +# Note: This file is intentionally packaged here. It is needed for python3-avahi and avahi-utils: %{_libdir}/avahi/service-types.db # avahi creates the directory itself, we do not package it # since it might be on tmpfs @@ -977,7 +983,7 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %{_unitdir}/avahi-daemon.service %{_unitdir}/avahi-daemon.socket %{_unitdir}/avahi-dnsconfd.service -# Common file for avahi-utils-gtk and python-avahi-gtk: +# Common file for avahi-utils-gtk and python3-avahi-gtk: %dir %{_datadir}/avahi/ %{_datadir}/avahi/interfaces %{_sysconfdir}/sysconfig/network/*/avahi-daemon @@ -1002,12 +1008,14 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %files -n libhowl0 %{_libdir}/libhowl.so.* -%files -n python-avahi +%files -n python3-avahi %{_bindir}/avahi-bookmarks %{_mandir}/man1/avahi-bookmarks.1%{ext_man} -%dir %{python_sitelib}/avahi -%{python_sitelib}/avahi/__init__.py* -%{python_sitelib}/avahi/ServiceTypeDatabase.py +%dir %{python3_sitelib}/avahi +%{python3_sitelib}/avahi/__init__.py* +%dir %{python3_sitelib}/avahi/__pycache__ +%{python3_sitelib}/avahi/__pycache__/__init__* +%{python3_sitelib}/avahi/ServiceTypeDatabase.py %files autoipd %doc avahi-autoipd/README.SUSE @@ -1080,11 +1088,11 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %{_libdir}/girepository-1.0/Avahi-0.6.typelib %{_libdir}/girepository-1.0/AvahiCore-0.6.typelib -%files -n python-avahi-gtk +%files -n python3-avahi-gtk %{_bindir}/avahi-discover %{_datadir}/applications/avahi-discover.desktop %{_mandir}/man1/avahi-discover.1* -%{python_sitelib}/avahi_discover +%{python3_sitelib}/avahi_discover %files -n avahi-utils-gtk %{_bindir}/bshell diff --git a/avahi-qt4.spec b/avahi-qt4.spec index b643444..989d322 100644 --- a/avahi-qt4.spec +++ b/avahi-qt4.spec @@ -22,7 +22,7 @@ # For build all at once, set all to 1. # If you set build_core to 0, you cannot set more than one other option to 1. %define build_core 0 -# NOTE: build_glib2 also controls build of gobject, gtk2, gtk3 code. +# NOTE: build_glib2 also controls build of gobject, gtk2, gtk3 and pygobject code. %define build_glib2 0 %define build_mono 0 %define build_qt4 1 @@ -71,19 +71,21 @@ Patch4: avahi-daemon-check-dns-suse.patch Patch18: avahi-0.6.31-invalid-packet.patch # PATCH-FIX-UPSTREAM avahi-0.6.32-suppress-resolv-conf-warning.patch bsc#982317 mgorse@suse.com -- only warn on missing resolv.conf if it is being used. Patch19: avahi-0.6.32-suppress-resolv-conf-warning.patch -BuildRequires: dbus-1-python + # PATCH-FIX-UPSTREAM avahi-0.7-python3.patch bsc#1076402 mgorse@suse.com -- port to Python 3. +Patch20: avahi-0.7-python3.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: gdbm-devel BuildRequires: intltool BuildRequires: libdaemon-devel BuildRequires: libexpat-devel +BuildRequires: python3-dbus-python # libtool is needed to build all variants: bootstrap is unconditional in the build section BuildRequires: libtool BuildRequires: pkgconfig # Even if we are not building python bindings, we need python to build service types database: -BuildRequires: python-devel -BuildRequires: python-gdbm +BuildRequires: python3-dbm +BuildRequires: python3-devel BuildRequires: translation-update-upstream # FIXME: on upgrade, ensure to verify if -DGTK_DISABLE_DEPRECATED=1 can remain in avahi=ui/Makefile.am (GtkStock deprecated with GTK+ 3.9.10). %if !%{build_glib2} && !%{build_mono} && !%{build_qt4} @@ -97,7 +99,7 @@ BuildRequires: strip-nondeterminism BuildRequires: dbus-1-devel BuildRequires: doxygen BuildRequires: graphviz -BuildRequires: python-gdbm +BuildRequires: python3-dbm BuildRequires: zlib-devel BuildRequires: pkgconfig(systemd) # For python bindings and utilities: @@ -264,21 +266,21 @@ tests in the Apple Bonjour conformance test suite. In addition it supports some nifty things that have never been seen elsewhere like correct mDNS reflection across LAN segments. -%package -n python-avahi +%package -n python3-avahi Summary: A set of Avahi utilities written in Python Group: Development/Languages/Python Requires: %{name} = %{version} Requires: dbus-1-python -Requires: python-gdbm -Requires: python-twisted -Requires: python-twisted-web +Requires: python3-Twisted +Requires: python3-dbm # FIXME: use proper Requires(pre/post/preun/...) PreReq: coreutils # Old name used for <= 10.3: Provides: avahi-python = %{version} Obsoletes: avahi-python < %{version} +Obsoletes: python-avahi -%description -n python-avahi +%description -n python3-avahi Avahi is an implementation of the DNS Service Discovery and Multicast DNS specifications for Zeroconf Computing. It uses D-BUS for communication between user applications and a system daemon. The daemon @@ -518,20 +520,22 @@ It passes all tests in the Apple Bonjour conformance test suite. In addition, it supports some nifty things, like correct mDNS reflection across LAN segments. -%package -n python-avahi-gtk +%package -n python3-avahi-gtk Summary: A set of Avahi utilities written in Python Using python-gtk Group: Development/Languages/Python -Requires: python-avahi = %{version} -Requires: python-gtk +Requires: python3-avahi = %{version} +Requires: python3-gobject # FIXME: use proper Requires(pre/post/preun/...) PreReq: coreutils # Old name used for <= 10.3: Provides: avahi-python = %{version} Obsoletes: avahi-python < %{version} +Obsoletes: python-avahi-gtk # Provide split-provides for update from <= 11.0: Provides: python-avahi:%{_bindir}/avahi-bookmarks +Obsoletes: python-avahi < %{version} -%description -n python-avahi-gtk +%description -n python3-avahi-gtk Avahi is an implementation of the DNS Service Discovery and Multicast DNS specifications for Zeroconf Computing. It uses D-BUS for communication between user applications and a system daemon. The daemon @@ -684,6 +688,7 @@ translation-update-upstream %patch4 %patch18 -p1 %patch19 -p1 +%patch20 -p1 %if !%{build_core} # Replace all .la references from local .la files to installed versions @@ -708,6 +713,7 @@ sed -i "s:-DGTK_DISABLE_DEPRECATED=1::" avahi-ui/Makefile.am %build autoreconf -f -i intltoolize -f +export PYTHON=/usr/bin/python3 %configure\ --libexecdir=%{_prefix}/lib\ --disable-static\ @@ -817,7 +823,7 @@ install -d %{buildroot}/%{_datadir}/pixmaps install -d %{buildroot}%{_fillupdir} install -m 644 sysconfig.avahi* %{buildroot}%{_fillupdir}/ %if ! %{build_glib2} -# Note: This file is intentionally installed here. It is needed for avahi-utils-gtk and python-avahi-gtk: +# Note: This file is intentionally installed here. It is needed for avahi-utils-gtk and python3-avahi-gtk: install -d %{buildroot}/%{_datadir}/avahi/interfaces install -m 644 avahi-discover-standalone/avahi-discover.ui %{buildroot}/%{_datadir}/avahi/interfaces %endif @@ -829,7 +835,7 @@ rm %{buildroot}/%{_libdir}/pkgconfig/avahi-client.pc rm %{buildroot}/%{_libdir}/pkgconfig/avahi-core.pc %if %{build_glib2} rm %{buildroot}/%{_bindir}/avahi-bookmarks -rm -r %{buildroot}/%{python_sitelib}/avahi +rm -r %{buildroot}/%{python3_sitelib}/avahi rm %{buildroot}/%{_mandir}/man1/avahi-bookmarks.1* rm %{buildroot}/%{_mandir}/man1/avahi-browse-domains.1* rm %{buildroot}/%{_mandir}/man1/avahi-browse.1* @@ -848,7 +854,7 @@ rm %{buildroot}/%{_mandir}/man8/avahi-autoipd.action.8* rm %{buildroot}/%{_mandir}/man8/avahi-daemon.8* rm %{buildroot}/%{_mandir}/man8/avahi-dnsconfd.8* rm %{buildroot}/%{_mandir}/man8/avahi-dnsconfd.action.8* -# Note: This file was intentionally moved to avahi. It is needed for avahi-utils-gtk and python-avahi-gtk: +# Note: This file was intentionally moved to avahi. It is needed for avahi-utils-gtk and python3-avahi-gtk: rm %{buildroot}/%{_datadir}/avahi/interfaces/avahi-discover.ui rmdir %{buildroot}/%{_datadir}/avahi/interfaces rmdir %{buildroot}/%{_datadir}/avahi @@ -929,10 +935,10 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %postun -n libavahi-gobject0 -p /sbin/ldconfig %post -n libavahi-glib1 -p /sbin/ldconfig %postun -n libavahi-glib1 -p /sbin/ldconfig -%post -n python-avahi-gtk +%post -n python3-avahi-gtk %desktop_database_post -%postun -n python-avahi-gtk +%postun -n python3-avahi-gtk %desktop_database_post %post -n avahi-utils-gtk @@ -952,7 +958,7 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %license LICENSE %doc docs/* %dir %{_libdir}/avahi/ -# Note: This file is intentionally packaged here. It is needed for python-avahi and avahi-utils: +# Note: This file is intentionally packaged here. It is needed for python3-avahi and avahi-utils: %{_libdir}/avahi/service-types.db # avahi creates the directory itself, we do not package it # since it might be on tmpfs @@ -979,7 +985,7 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %{_unitdir}/avahi-daemon.service %{_unitdir}/avahi-daemon.socket %{_unitdir}/avahi-dnsconfd.service -# Common file for avahi-utils-gtk and python-avahi-gtk: +# Common file for avahi-utils-gtk and python3-avahi-gtk: %dir %{_datadir}/avahi/ %{_datadir}/avahi/interfaces %{_sysconfdir}/sysconfig/network/*/avahi-daemon @@ -1004,12 +1010,14 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %files -n libhowl0 %{_libdir}/libhowl.so.* -%files -n python-avahi +%files -n python3-avahi %{_bindir}/avahi-bookmarks %{_mandir}/man1/avahi-bookmarks.1%{ext_man} -%dir %{python_sitelib}/avahi -%{python_sitelib}/avahi/__init__.py* -%{python_sitelib}/avahi/ServiceTypeDatabase.py +%dir %{python3_sitelib}/avahi +%{python3_sitelib}/avahi/__init__.py* +%dir %{python3_sitelib}/avahi/__pycache__ +%{python3_sitelib}/avahi/__pycache__/__init__* +%{python3_sitelib}/avahi/ServiceTypeDatabase.py %files autoipd %doc avahi-autoipd/README.SUSE @@ -1082,11 +1090,11 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %{_libdir}/girepository-1.0/Avahi-0.6.typelib %{_libdir}/girepository-1.0/AvahiCore-0.6.typelib -%files -n python-avahi-gtk +%files -n python3-avahi-gtk %{_bindir}/avahi-discover %{_datadir}/applications/avahi-discover.desktop %{_mandir}/man1/avahi-discover.1* -%{python_sitelib}/avahi_discover +%{python3_sitelib}/avahi_discover %files -n avahi-utils-gtk %{_bindir}/bshell diff --git a/avahi.changes b/avahi.changes index a40fa76..9f7f94e 100644 --- a/avahi.changes +++ b/avahi.changes @@ -3,6 +3,17 @@ Thu Mar 22 12:50:43 UTC 2018 - tchvatal@suse.com - Drop the qt3 parts +------------------------------------------------------------------- +Wed Mar 14 02:09:53 UTC 2018 - mgorse@suse.com + +- Add avahi-0.7-python3.patch: Port to python 3 (bsc#1076402). +- Build python bindings against python 3, rather than python 2; +- Python-avahi is now python3-avahi, and python-avahi-gtk is now + python3-avahi-gtk +- Obsolete the python 2 packages +- Replace python_sitelib with python3_sitelib in %files, and add + __pycache__. + ------------------------------------------------------------------- Sat Mar 10 08:39:00 UTC 2018 - jengelh@inai.de diff --git a/avahi.spec b/avahi.spec index 73233b2..6976abf 100644 --- a/avahi.spec +++ b/avahi.spec @@ -24,7 +24,7 @@ # For build all at once, set all to 1. # If you set build_core to 0, you cannot set more than one other option to 1. %define build_core 1 -# NOTE: build_glib2 also controls build of gobject, gtk2, gtk3 code. +# NOTE: build_glib2 also controls build of gobject, gtk2, gtk3 and pygobject code. %define build_glib2 0 %define build_mono 0 %define build_qt4 0 @@ -73,19 +73,21 @@ Patch4: avahi-daemon-check-dns-suse.patch Patch18: avahi-0.6.31-invalid-packet.patch # PATCH-FIX-UPSTREAM avahi-0.6.32-suppress-resolv-conf-warning.patch bsc#982317 mgorse@suse.com -- only warn on missing resolv.conf if it is being used. Patch19: avahi-0.6.32-suppress-resolv-conf-warning.patch -BuildRequires: dbus-1-python + # PATCH-FIX-UPSTREAM avahi-0.7-python3.patch bsc#1076402 mgorse@suse.com -- port to Python 3. +Patch20: avahi-0.7-python3.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: gdbm-devel BuildRequires: intltool BuildRequires: libdaemon-devel BuildRequires: libexpat-devel +BuildRequires: python3-dbus-python # libtool is needed to build all variants: bootstrap is unconditional in the build section BuildRequires: libtool BuildRequires: pkgconfig # Even if we are not building python bindings, we need python to build service types database: -BuildRequires: python-devel -BuildRequires: python-gdbm +BuildRequires: python3-dbm +BuildRequires: python3-devel BuildRequires: translation-update-upstream # FIXME: on upgrade, ensure to verify if -DGTK_DISABLE_DEPRECATED=1 can remain in avahi=ui/Makefile.am (GtkStock deprecated with GTK+ 3.9.10). %if !%{build_glib2} && !%{build_mono} && !%{build_qt4} @@ -99,7 +101,7 @@ BuildRequires: strip-nondeterminism BuildRequires: dbus-1-devel BuildRequires: doxygen BuildRequires: graphviz -BuildRequires: python-gdbm +BuildRequires: python3-dbm BuildRequires: zlib-devel BuildRequires: pkgconfig(systemd) # For python bindings and utilities: @@ -264,21 +266,21 @@ tests in the Apple Bonjour conformance test suite. In addition it supports some nifty things that have never been seen elsewhere like correct mDNS reflection across LAN segments. -%package -n python-avahi +%package -n python3-avahi Summary: A set of Avahi utilities written in Python Group: Development/Languages/Python Requires: %{name} = %{version} Requires: dbus-1-python -Requires: python-gdbm -Requires: python-twisted -Requires: python-twisted-web +Requires: python3-Twisted +Requires: python3-dbm # FIXME: use proper Requires(pre/post/preun/...) PreReq: coreutils # Old name used for <= 10.3: Provides: avahi-python = %{version} Obsoletes: avahi-python < %{version} +Obsoletes: python-avahi -%description -n python-avahi +%description -n python3-avahi Avahi is an implementation of the DNS Service Discovery and Multicast DNS specifications for Zeroconf Computing. It uses D-BUS for communication between user applications and a system daemon. The daemon @@ -518,20 +520,22 @@ It passes all tests in the Apple Bonjour conformance test suite. In addition, it supports some nifty things, like correct mDNS reflection across LAN segments. -%package -n python-avahi-gtk +%package -n python3-avahi-gtk Summary: A set of Avahi utilities written in Python Using python-gtk Group: Development/Languages/Python -Requires: python-avahi = %{version} -Requires: python-gtk +Requires: python3-avahi = %{version} +Requires: python3-gobject # FIXME: use proper Requires(pre/post/preun/...) PreReq: coreutils # Old name used for <= 10.3: Provides: avahi-python = %{version} Obsoletes: avahi-python < %{version} +Obsoletes: python-avahi-gtk # Provide split-provides for update from <= 11.0: Provides: python-avahi:%{_bindir}/avahi-bookmarks +Obsoletes: python-avahi < %{version} -%description -n python-avahi-gtk +%description -n python3-avahi-gtk Avahi is an implementation of the DNS Service Discovery and Multicast DNS specifications for Zeroconf Computing. It uses D-BUS for communication between user applications and a system daemon. The daemon @@ -684,6 +688,7 @@ translation-update-upstream %patch4 %patch18 -p1 %patch19 -p1 +%patch20 -p1 %if !%{build_core} # Replace all .la references from local .la files to installed versions @@ -708,6 +713,7 @@ sed -i "s:-DGTK_DISABLE_DEPRECATED=1::" avahi-ui/Makefile.am %build autoreconf -f -i intltoolize -f +export PYTHON=/usr/bin/python3 %configure\ --libexecdir=%{_prefix}/lib\ --disable-static\ @@ -817,7 +823,7 @@ install -d %{buildroot}/%{_datadir}/pixmaps install -d %{buildroot}%{_fillupdir} install -m 644 sysconfig.avahi* %{buildroot}%{_fillupdir}/ %if ! %{build_glib2} -# Note: This file is intentionally installed here. It is needed for avahi-utils-gtk and python-avahi-gtk: +# Note: This file is intentionally installed here. It is needed for avahi-utils-gtk and python3-avahi-gtk: install -d %{buildroot}/%{_datadir}/avahi/interfaces install -m 644 avahi-discover-standalone/avahi-discover.ui %{buildroot}/%{_datadir}/avahi/interfaces %endif @@ -829,7 +835,7 @@ rm %{buildroot}/%{_libdir}/pkgconfig/avahi-client.pc rm %{buildroot}/%{_libdir}/pkgconfig/avahi-core.pc %if %{build_glib2} rm %{buildroot}/%{_bindir}/avahi-bookmarks -rm -r %{buildroot}/%{python_sitelib}/avahi +rm -r %{buildroot}/%{python3_sitelib}/avahi rm %{buildroot}/%{_mandir}/man1/avahi-bookmarks.1* rm %{buildroot}/%{_mandir}/man1/avahi-browse-domains.1* rm %{buildroot}/%{_mandir}/man1/avahi-browse.1* @@ -848,7 +854,7 @@ rm %{buildroot}/%{_mandir}/man8/avahi-autoipd.action.8* rm %{buildroot}/%{_mandir}/man8/avahi-daemon.8* rm %{buildroot}/%{_mandir}/man8/avahi-dnsconfd.8* rm %{buildroot}/%{_mandir}/man8/avahi-dnsconfd.action.8* -# Note: This file was intentionally moved to avahi. It is needed for avahi-utils-gtk and python-avahi-gtk: +# Note: This file was intentionally moved to avahi. It is needed for avahi-utils-gtk and python3-avahi-gtk: rm %{buildroot}/%{_datadir}/avahi/interfaces/avahi-discover.ui rmdir %{buildroot}/%{_datadir}/avahi/interfaces rmdir %{buildroot}/%{_datadir}/avahi @@ -929,10 +935,10 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %postun -n libavahi-gobject0 -p /sbin/ldconfig %post -n libavahi-glib1 -p /sbin/ldconfig %postun -n libavahi-glib1 -p /sbin/ldconfig -%post -n python-avahi-gtk +%post -n python3-avahi-gtk %desktop_database_post -%postun -n python-avahi-gtk +%postun -n python3-avahi-gtk %desktop_database_post %post -n avahi-utils-gtk @@ -952,7 +958,7 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %license LICENSE %doc docs/* %dir %{_libdir}/avahi/ -# Note: This file is intentionally packaged here. It is needed for python-avahi and avahi-utils: +# Note: This file is intentionally packaged here. It is needed for python3-avahi and avahi-utils: %{_libdir}/avahi/service-types.db # avahi creates the directory itself, we do not package it # since it might be on tmpfs @@ -979,7 +985,7 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %{_unitdir}/avahi-daemon.service %{_unitdir}/avahi-daemon.socket %{_unitdir}/avahi-dnsconfd.service -# Common file for avahi-utils-gtk and python-avahi-gtk: +# Common file for avahi-utils-gtk and python3-avahi-gtk: %dir %{_datadir}/avahi/ %{_datadir}/avahi/interfaces %{_sysconfdir}/sysconfig/network/*/avahi-daemon @@ -1004,12 +1010,14 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %files -n libhowl0 %{_libdir}/libhowl.so.* -%files -n python-avahi +%files -n python3-avahi %{_bindir}/avahi-bookmarks %{_mandir}/man1/avahi-bookmarks.1%{ext_man} -%dir %{python_sitelib}/avahi -%{python_sitelib}/avahi/__init__.py* -%{python_sitelib}/avahi/ServiceTypeDatabase.py +%dir %{python3_sitelib}/avahi +%{python3_sitelib}/avahi/__init__.py* +%dir %{python3_sitelib}/avahi/__pycache__ +%{python3_sitelib}/avahi/__pycache__/__init__* +%{python3_sitelib}/avahi/ServiceTypeDatabase.py %files autoipd %doc avahi-autoipd/README.SUSE @@ -1082,11 +1090,11 @@ chown -R avahi-autoipd:avahi-autoipd %{_localstatedir}/lib/avahi-autoipd %{_libdir}/girepository-1.0/Avahi-0.6.typelib %{_libdir}/girepository-1.0/AvahiCore-0.6.typelib -%files -n python-avahi-gtk +%files -n python3-avahi-gtk %{_bindir}/avahi-discover %{_datadir}/applications/avahi-discover.desktop %{_mandir}/man1/avahi-discover.1* -%{python_sitelib}/avahi_discover +%{python3_sitelib}/avahi_discover %files -n avahi-utils-gtk %{_bindir}/bshell