From 6f0c66c3a4b193cb9cb4bc6a29705e7be9bdb464 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Nov 28 2018 11:23:36 +0000 Subject: [PATCH 1/3] Switch to Python 3 --- diff --git a/zookeeper.spec b/zookeeper.spec index 57986c3..8de10dc 100644 --- a/zookeeper.spec +++ b/zookeeper.spec @@ -3,7 +3,7 @@ Name: zookeeper Version: 3.4.9 -Release: 11%{?dist} +Release: 12%{?dist} Summary: A high-performance coordination service for distributed applications License: ASL 2.0 and BSD URL: https://zookeeper.apache.org/ @@ -34,7 +34,7 @@ BuildRequires: java-javadoc BuildRequires: jpackage-utils BuildRequires: libtool BuildRequires: libxml2-devel -BuildRequires: python2-devel +BuildRequires: python3-devel BuildRequires: ant BuildRequires: ant-junit @@ -112,15 +112,14 @@ BuildArch: noarch %description javadoc This package contains javadoc for %{name}. -%package -n python2-%{name} -%{?python_provide:%python_provide python2-%{name}} +%package -n python3-%{name} +%{?python_provide:%python_provide python3-%{name}} Summary: Python support for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} -Provides: zkpython%{?_isa} = %{version}-%{release} -Requires: python2 +Requires: python3 -%description -n python2-%{name} -The python-%{name} package contains Python bindings for %{name}. +%description -n python3-%{name} +Python bindings for %{name}. %prep %autosetup -p1 @@ -215,9 +214,9 @@ mkdir -p %{buildroot}%{_javadocdir}/%{name} cp -pr build/docs/api/* %{buildroot}%{_javadocdir}/%{name}/ pushd src/contrib/zkpython -%{__python} src/python/setup.py build --build-base=$PWD/build \ +%{__python3} src/python/setup.py build --build-base=$PWD/build \ install --root=%{buildroot} ;\ -chmod 0755 %{buildroot}%{python_sitearch}/zookeeper.so +chmod 0755 %{buildroot}%{python3_sitearch}/zookeeper.cpython-*.so popd find %{buildroot} -name '*.la' -exec rm -f {} ';' @@ -298,12 +297,16 @@ getent passwd zookeeper >/dev/null || \ %{_javadocdir}/%{name} %doc LICENSE.txt NOTICE.txt -%files -n python2-%{name} -%{python2_sitearch}/ZooKeeper-?.?-py%{python_version}.egg-info -%{python2_sitearch}/zookeeper.so +%files -n python3-%{name} +%{python3_sitearch}/ZooKeeper-?.?-py%{python3_version}.egg-info +%{python3_sitearch}/zookeeper.cpython-*.so %doc LICENSE.txt NOTICE.txt src/contrib/zkpython/README %changelog +* Wed Nov 28 2018 Fedora Release Engineering - 3.4.9-12 +- Switch to Python 3 + https://bugzilla.redhat.com/show_bug.cgi?id=1630088 + * Sat Jul 14 2018 Fedora Release Engineering - 3.4.9-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 4f22cf54ba57e6a3c03940cf791921ff8a80fea8 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Nov 28 2018 11:23:36 +0000 Subject: [PATCH 2/3] Disable -Werror for the C++ part --- diff --git a/zookeeper-3.4.9-no-werror.patch b/zookeeper-3.4.9-no-werror.patch new file mode 100644 index 0000000..6e6bb3a --- /dev/null +++ b/zookeeper-3.4.9-no-werror.patch @@ -0,0 +1,12 @@ +diff -U3 -r zookeeper-3.4.9-orig/src/c/Makefile.am zookeeper-3.4.9/src/c/Makefile.am +--- zookeeper-3.4.9-orig/src/c/Makefile.am 2016-08-23 09:39:24.000000000 +0200 ++++ zookeeper-3.4.9/src/c/Makefile.am 2018-11-28 12:11:08.361412829 +0100 +@@ -6,7 +6,7 @@ + SOLARIS_LIB_LDFLAGS = -lnsl -lsocket + endif + AM_CPPFLAGS = -I${srcdir}/include -I${srcdir}/tests -I${srcdir}/generated $(SOLARIS_CPPFLAGS) +-AM_CFLAGS = -Wall -Werror ++AM_CFLAGS = -Wall + AM_CXXFLAGS = -Wall $(USEIPV6) + + LIB_LDFLAGS = -no-undefined -version-info 2 $(SOLARIS_LIB_LDFLAGS) diff --git a/zookeeper.spec b/zookeeper.spec index 8de10dc..c1ef2ea 100644 --- a/zookeeper.spec +++ b/zookeeper.spec @@ -19,6 +19,7 @@ Patch3: %{name}-3.4.9-server.patch Patch4: mt_adaptor.c.patch Patch5: 0001-cppunit-config-no-longer-exists-use-pkg-config.patch Patch6: missing-pom.template.patch +Patch7: %{name}-3.4.9-no-werror.patch BuildRequires: autoconf From f9429ff8050d4b2239c9b19b8434da5e22927f2d Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Nov 28 2018 12:04:39 +0000 Subject: [PATCH 3/3] Address review comments - Use sed instead of patch to remove -Werror - Remove unneeded Requires (python3-libs is brought in automatically) - Use my name in the changelog --- diff --git a/zookeeper-3.4.9-no-werror.patch b/zookeeper-3.4.9-no-werror.patch deleted file mode 100644 index 6e6bb3a..0000000 --- a/zookeeper-3.4.9-no-werror.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -U3 -r zookeeper-3.4.9-orig/src/c/Makefile.am zookeeper-3.4.9/src/c/Makefile.am ---- zookeeper-3.4.9-orig/src/c/Makefile.am 2016-08-23 09:39:24.000000000 +0200 -+++ zookeeper-3.4.9/src/c/Makefile.am 2018-11-28 12:11:08.361412829 +0100 -@@ -6,7 +6,7 @@ - SOLARIS_LIB_LDFLAGS = -lnsl -lsocket - endif - AM_CPPFLAGS = -I${srcdir}/include -I${srcdir}/tests -I${srcdir}/generated $(SOLARIS_CPPFLAGS) --AM_CFLAGS = -Wall -Werror -+AM_CFLAGS = -Wall - AM_CXXFLAGS = -Wall $(USEIPV6) - - LIB_LDFLAGS = -no-undefined -version-info 2 $(SOLARIS_LIB_LDFLAGS) diff --git a/zookeeper.spec b/zookeeper.spec index c1ef2ea..88b8b2a 100644 --- a/zookeeper.spec +++ b/zookeeper.spec @@ -19,7 +19,6 @@ Patch3: %{name}-3.4.9-server.patch Patch4: mt_adaptor.c.patch Patch5: 0001-cppunit-config-no-longer-exists-use-pkg-config.patch Patch6: missing-pom.template.patch -Patch7: %{name}-3.4.9-no-werror.patch BuildRequires: autoconf @@ -117,7 +116,6 @@ This package contains javadoc for %{name}. %{?python_provide:%python_provide python3-%{name}} Summary: Python support for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: python3 %description -n python3-%{name} Python bindings for %{name}. @@ -125,6 +123,9 @@ Python bindings for %{name}. %prep %autosetup -p1 +# Do not treat C compile-time warnings as errors +sed -i -e's/-Werror//' src/c/Makefile.am + iconv -f iso8859-1 -t utf-8 src/c/ChangeLog > src/c/ChangeLog.conv && mv -f src/c/ChangeLog.conv src/c/ChangeLog sed -i 's/\r//' src/c/ChangeLog @@ -304,7 +305,7 @@ getent passwd zookeeper >/dev/null || \ %doc LICENSE.txt NOTICE.txt src/contrib/zkpython/README %changelog -* Wed Nov 28 2018 Fedora Release Engineering - 3.4.9-12 +* Wed Nov 28 2018 Petr Viktorin - 3.4.9-12 - Switch to Python 3 https://bugzilla.redhat.com/show_bug.cgi?id=1630088