diff --git a/ccnet.spec b/ccnet.spec index c394dd5..1d281d0 100644 --- a/ccnet.spec +++ b/ccnet.spec @@ -2,12 +2,14 @@ Name: ccnet Version: 6.1.8 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A framework for writing networked applications in C License: GPLv3 URL: https://github.com/haiwen/%{name} Source0: https://github.com/haiwen/%{name}/archive/v%{version}.tar.gz +Patch0: fix-async-client-py3.patch +Patch1: fix-packet-py3.patch BuildRequires: autoconf BuildRequires: automake @@ -19,7 +21,7 @@ BuildRequires: libevent-devel BuildRequires: libuuid-devel BuildRequires: libsearpc-devel BuildRequires: libzdb-devel -BuildRequires: python2-devel +BuildRequires: python3-devel BuildRequires: vala Requires: sqlite @@ -57,12 +59,14 @@ developing applications that use %{name}. %prep %setup -qn %{name}-%{version} +%patch0 -p1 +%patch1 -p1 sed -i -e /\(DESTDIR\)/d libccnet.pc.in %build ./autogen.sh --enable-server --enable-client -%configure --disable-static --disable-compile-demo +%configure --disable-static --disable-compile-demo PYTHON=/usr/bin/python3 sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool %{__make} %{?_smp_mflags} CFLAGS="%{optflags}" @@ -84,7 +88,7 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';' %license LICENSE.txt %{_libdir}/libccnet.so.* %{_bindir}/%{name}* -%{python2_sitearch}/%{name} +%{python3_sitearch}/%{name} %files devel @@ -95,6 +99,9 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';' %changelog +* Sun Nov 03 2019 Julien Enselme - 6.1.8-4 +- Make this package compatible with Python 3 + * Wed Jul 24 2019 Fedora Release Engineering - 6.1.8-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild diff --git a/fix-async-client-py3.patch b/fix-async-client-py3.patch new file mode 100644 index 0000000..bbebfe0 --- /dev/null +++ b/fix-async-client-py3.patch @@ -0,0 +1,11 @@ +--- a/python/ccnet/async/async_client.py 2020-01-04 17:50:23.681092598 +0100 ++++ b/python/ccnet/async/async_client.py 2020-01-04 17:52:59.152455433 +0100 +@@ -26,7 +26,7 @@ + ] + + def debug_print(msg): +- print msg ++ print(msg) + + class AsyncClient(Client): + '''Async mode client''' diff --git a/fix-packet-py3.patch b/fix-packet-py3.patch new file mode 100644 index 0000000..a3877e5 --- /dev/null +++ b/fix-packet-py3.patch @@ -0,0 +1,11 @@ +--- a/python/ccnet/packet.py 2020-01-04 17:50:37.897308652 +0100 ++++ b/python/ccnet/packet.py 2020-01-04 17:53:27.244882381 +0100 +@@ -72,7 +72,7 @@ + def parse_header(buf): + try: + ver, ptype, length, id = struct.unpack(CCNET_HEADER_FORMAT, buf) +- except struct.error, e: ++ except struct.error as e: + raise NetworkError('error when unpack packet header: %s' % e) + + return PacketHeader(ver, ptype, length, id)