Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 938995 Details for
Bug 1115489
Please port unbound to Python 3
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
fedora dist-git patch to build against python3
unbound-fedora-python3.patch (text/plain), 10.93 KB, created by
Pavel Šimerda (pavlix)
on 2014-09-18 17:14:33 UTC
(
hide
)
Description:
fedora dist-git patch to build against python3
Filename:
MIME Type:
Creator:
Pavel Šimerda (pavlix)
Created:
2014-09-18 17:14:33 UTC
Size:
10.93 KB
patch
obsolete
>commit 145b9cfe3eb3f897248ca0d6f3fdddff24de868f >Author: Pavel Å imerda <psimerda@redhat.com> >Date: Thu Sep 18 17:11:44 2014 +0200 > > Resolves: #1115489 - build with python 3.x for fedora >= 22 > >diff --git a/unbound-1.4.22-python3.patch b/unbound-1.4.22-python3.patch >new file mode 100644 >index 0000000..4ffc01a >--- /dev/null >+++ b/unbound-1.4.22-python3.patch >@@ -0,0 +1,177 @@ >+diff --git a/acx_python.m4 b/acx_python.m4 >+index 99ffa25..8945401 100644 >+--- a/acx_python.m4 >++++ b/acx_python.m4 >+@@ -14,17 +14,17 @@ AC_DEFUN([AC_PYTHON_DEVEL],[ >+ fi >+ >+ if test -z "$PYTHON_VERSION"; then >+- PYTHON_VERSION=`$PYTHON -c "import sys, string; \ >+- print string.split(sys.version)[[0]]"` >++ PYTHON_VERSION=`$PYTHON -c "import sys; \ >++ print(sys.version.split()[[0]])"` >+ fi >+ >+ # >+ # Check for a version of Python >= 2.1.0 >+ # >+ AC_MSG_CHECKING([for a version of Python >= '2.1.0']) >+- ac_supports_python_ver=`$PYTHON -c "import sys, string; \ >+- ver = string.split(sys.version)[[0]]; \ >+- print ver >= '2.1.0'"` >++ ac_supports_python_ver=`$PYTHON -c "import sys; \ >++ ver = sys.version.split()[[0]]; \ >++ print(ver >= '2.1.0')"` >+ if test "$ac_supports_python_ver" != "True"; then >+ if test -z "$PYTHON_NOVERSIONCHECK"; then >+ AC_MSG_RESULT([no]) >+@@ -49,9 +49,9 @@ to something else than an empty string. >+ # >+ if test -n "$1"; then >+ AC_MSG_CHECKING([for a version of Python $1]) >+- ac_supports_python_ver=`$PYTHON -c "import sys, string; \ >+- ver = string.split(sys.version)[[0]]; \ >+- print ver $1"` >++ ac_supports_python_ver=`$PYTHON -c "import sys; \ >++ ver = sys.version.split()[[0]]; \ >++ print(ver $1)"` >+ if test "$ac_supports_python_ver" = "True"; then >+ AC_MSG_RESULT([yes]) >+ else >+@@ -86,7 +86,7 @@ $ac_distutils_result]) >+ AC_MSG_CHECKING([for Python include path]) >+ if test -z "$PYTHON_CPPFLAGS"; then >+ python_path=`$PYTHON -c "import distutils.sysconfig; \ >+- print distutils.sysconfig.get_python_inc();"` >++ print(distutils.sysconfig.get_python_inc());"` >+ if test -n "${python_path}"; then >+ python_path="-I$python_path" >+ fi >+@@ -103,22 +103,20 @@ $ac_distutils_result]) >+ # (makes two attempts to ensure we've got a version number >+ # from the interpreter) >+ py_version=`$PYTHON -c "from distutils.sysconfig import *; \ >+- from string import join; \ >+- print join(get_config_vars('VERSION'))"` >++ print(''.join(get_config_vars('VERSION')))"` >+ if test "$py_version" = "[None]"; then >+ if test -n "$PYTHON_VERSION"; then >+ py_version=$PYTHON_VERSION >+ else >+ py_version=`$PYTHON -c "import sys; \ >+- print sys.version[[:3]]"` >++ print(sys.version[[:3]])"` >+ fi >+ fi >+ >+ PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \ >+- from string import join; \ >+- print '-L' + get_python_lib(0,1), \ >+- '-L' + os.path.dirname(get_python_lib(0,1)), \ >+- '-lpython';"`$py_version >++ print('-L' + get_python_lib(0,1) \ >++ + ' -L' + os.path.dirname(get_python_lib(0,1)) \ >++ + ' -lpython');"`$py_version >+ fi >+ AC_MSG_RESULT([$PYTHON_LDFLAGS]) >+ AC_SUBST([PYTHON_LDFLAGS]) >+@@ -129,7 +127,7 @@ $ac_distutils_result]) >+ AC_MSG_CHECKING([for Python site-packages path]) >+ if test -z "$PYTHON_SITE_PKG"; then >+ PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ >+- print distutils.sysconfig.get_python_lib(1,0);"` >++ print(distutils.sysconfig.get_python_lib(1,0));"` >+ fi >+ AC_MSG_RESULT([$PYTHON_SITE_PKG]) >+ AC_SUBST([PYTHON_SITE_PKG]) >+@@ -141,7 +139,7 @@ $ac_distutils_result]) >+ if test -z "$PYTHON_EXTRA_LIBS"; then >+ PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ >+ conf = distutils.sysconfig.get_config_var; \ >+- print conf('LOCALMODLIBS'), conf('LIBS')"` >++ print(conf('LOCALMODLIBS'), conf('LIBS'))"` >+ fi >+ AC_MSG_RESULT([$PYTHON_EXTRA_LIBS]) >+ AC_SUBST(PYTHON_EXTRA_LIBS) >+@@ -153,7 +151,7 @@ $ac_distutils_result]) >+ if test -z "$PYTHON_EXTRA_LDFLAGS"; then >+ PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ >+ conf = distutils.sysconfig.get_config_var; \ >+- print conf('LINKFORSHARED')"` >++ print(conf('LINKFORSHARED'))"` >+ fi >+ AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS]) >+ AC_SUBST(PYTHON_EXTRA_LDFLAGS) >+diff --git a/configure.ac b/configure.ac >+index 26e8abc..a22ddc9 100644 >+--- a/configure.ac >++++ b/configure.ac >+@@ -465,7 +465,7 @@ if test x_$ub_test_python != x_no; then >+ ac_save_LIBS="$LIBS" dnl otherwise AC_PYTHON_DEVEL thrashes $LIBS >+ AC_PYTHON_DEVEL >+ if test ! -z "$PYTHON_VERSION"; then >+- if test `$PYTHON -c "print '$PYTHON_VERSION' >= '2.4.0'"` = "False"; then >++ if test `$PYTHON -c "print('$PYTHON_VERSION' >= '2.4.0')"` = "False"; then >+ AC_ERROR([Python version >= 2.4.0 is required]) >+ fi >+ >+diff --git a/libunbound/python/libunbound.i b/libunbound/python/libunbound.i >+index 4f92799..78a0ed6 100644 >+--- a/libunbound/python/libunbound.i >++++ b/libunbound/python/libunbound.i >+@@ -764,13 +764,13 @@ Result: ['74.125.43.147', '74.125.43.99', '74.125.43.103', '74.125.43.104'] >+ >+ list = PyList_New(cnt); >+ for (i=0;i<cnt;i++) >+- PyList_SetItem(list, i, PyString_FromStringAndSize(result->data[i],result->len[i])); >++ PyList_SetItem(list, i, PyBytes_FromStringAndSize(result->data[i],result->len[i])); >+ >+ return list; >+ } >+ >+ PyObject* _packet() { >+- return PyString_FromStringAndSize($self->answer_packet, $self->answer_len); >++ return PyBytes_FromStringAndSize($self->answer_packet, $self->answer_len); >+ } >+ >+ %pythoncode %{ >+diff --git a/pythonmod/interface.i b/pythonmod/interface.i >+index 606d85f..4f1a25f 100644 >+--- a/pythonmod/interface.i >++++ b/pythonmod/interface.i >+@@ -48,7 +48,7 @@ >+ list = PyList_New(cnt); >+ i = 0; cnt = 0; >+ while (i < len) { >+- PyList_SetItem(list, cnt, PyString_FromStringAndSize(name + i + 1, name[i])); >++ PyList_SetItem(list, cnt, PyBytes_FromStringAndSize(name + i + 1, name[i])); >+ i += name[i] + 1; >+ cnt++; >+ } >+@@ -148,7 +148,7 @@ struct query_info { >+ }; >+ >+ PyObject* _get_qname(struct query_info* q) { >+- return PyString_FromStringAndSize((char*)q->qname, q->qname_len); >++ return PyBytes_FromStringAndSize((char*)q->qname, q->qname_len); >+ } >+ >+ PyObject* _get_qname_components(struct query_info* q) { >+@@ -210,7 +210,7 @@ uint16_t ntohs(uint16_t netshort); >+ >+ %inline %{ >+ PyObject* _get_dname(struct packed_rrset_key* k) { >+- return PyString_FromStringAndSize((char*)k->dname, k->dname_len); >++ return PyBytes_FromStringAndSize((char*)k->dname, k->dname_len); >+ } >+ PyObject* _get_dname_components(struct packed_rrset_key* k) { >+ return GetNameAsLabelList((char*)k->dname, k->dname_len); >+@@ -317,7 +317,7 @@ struct packed_rrset_data { >+ PyObject* _get_data_rr_data(struct packed_rrset_data* d, int idx) { >+ if ((d != NULL) && (idx >= 0) && >+ ((size_t)idx < (d->count+d->rrsig_count))) >+- return PyString_FromStringAndSize((char*)d->rr_data[idx], >++ return PyBytes_FromStringAndSize((char*)d->rr_data[idx], >+ d->rr_len[idx]); >+ return Py_None; >+ } >diff --git a/unbound.spec b/unbound.spec >index e6328f2..65b00dc 100644 >--- a/unbound.spec >+++ b/unbound.spec >@@ -2,6 +2,14 @@ > %{?!with_munin: %global with_munin 1} > > %if %{with_python} >+%if 0%{?fedora} >= 22 >+%global python python3 >+%global __python %{__python3} >+%else >+%global python python2 >+%global __python %{__python2} >+%endif >+ > %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} > %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} > %endif >@@ -11,7 +19,7 @@ > Summary: Validating, recursive, and caching DNS(SEC) resolver > Name: unbound > Version: 1.4.22 >-Release: 1%{?dist} >+Release: 2%{?dist} > License: BSD > Url: http://www.nlnetlabs.nl/unbound/ > Source: http://www.unbound.net/downloads/%{name}-%{version}.tar.gz >@@ -33,15 +41,20 @@ Source14: unbound.sysconfig > Source15: unbound.cron > Source16: unbound-munin.README > >+# Support building with Python 3.x >+# https://bugzilla.redhat.com/show_bug.cgi?id=1115489 >+Patch0: unbound-1.4.22-python3.patch >+ > Group: System Environment/Daemons > BuildRequires: flex, openssl-devel > BuildRequires: libevent-devel expat-devel > %if %{with_python} >-BuildRequires: python-devel swig >+BuildRequires: %{python}-devel swig > %endif > BuildRequires: systemd-units > # Required for SVN versions > # BuildRequires: bison >+BuildRequires: automake autoconf > > Requires(post): systemd-units > Requires(preun): systemd-units >@@ -103,9 +116,12 @@ Python modules and extensions for unbound > %endif > > %prep >-%setup -q >+%setup -q >+%patch0 -p1 > > %build >+# This is needed to rebuild the configure script to support Python 3.x >+autoreconf > export LDFLAGS="-Wl,-z,relro,-z,now -pie -specs=/usr/lib/rpm/redhat/redhat-hardened-ld" > export CFLAGS="$RPM_OPT_FLAGS -fPIE -pie" > export CXXFLAGS="$RPM_OPT_FLAGS -fPIE -pie" >@@ -114,7 +130,7 @@ export CXXFLAGS="$RPM_OPT_FLAGS -fPIE -pie" > --with-conf-file=%{_sysconfdir}/%{name}/unbound.conf \ > --with-pidfile=%{_localstatedir}/run/%{name}/%{name}.pid \ > %if %{with_python} >- --with-pythonmodule --with-pyunbound \ >+ --with-pythonmodule --with-pyunbound PYTHON=%{__python} \ > %endif > --enable-sha2 --disable-gost --disable-ecdsa \ > --with-rootkey-file=%{_sharedstatedir}/unbound/root.key >@@ -279,6 +295,9 @@ exit 0 > /bin/systemctl try-restart unbound-keygen.service >/dev/null 2>&1 || : > > %changelog >+* Thu Sep 18 2014 Pavel Å imerda <psimerda@redhat.com> - 1.4.22-2 >+- Resolves: #1115489 - build with python 3.x for fedora >= 22 >+ > * Thu Sep 18 2014 Pavel Å imerda <psimerda@redhat.com> - 1.4.22-1 > - new version 1.4.22, removed obsolete patch >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1115489
:
938042
|
938094
|
938995
|
939159