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 939159 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
py3.patch (text/plain), 11.04 KB, created by
Pavel Šimerda (pavlix)
on 2014-09-19 09:42:52 UTC
(
hide
)
Description:
fedora dist-git patch to build against python3
Filename:
MIME Type:
Creator:
Pavel Šimerda (pavlix)
Created:
2014-09-19 09:42:52 UTC
Size:
11.04 KB
patch
obsolete
>diff --git a/unbound-1.4.22-python3.patch b/unbound-1.4.22-python3.patch >new file mode 100644 >index 0000000..0e5a3f7 >--- /dev/null >+++ b/unbound-1.4.22-python3.patch >@@ -0,0 +1,212 @@ >+diff --git a/acx_python.m4 b/acx_python.m4 >+index 99ffa25..254ff20 100644 >+--- a/acx_python.m4 >++++ b/acx_python.m4 >+@@ -14,58 +14,11 @@ 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'"` >+- if test "$ac_supports_python_ver" != "True"; then >+- if test -z "$PYTHON_NOVERSIONCHECK"; then >+- AC_MSG_RESULT([no]) >+- AC_MSG_FAILURE([ >+-This version of the AC@&t@_PYTHON_DEVEL macro >+-doesn't work properly with versions of Python before >+-2.1.0. You may need to re-run configure, setting the >+-variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, >+-PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. >+-Moreover, to disable this check, set PYTHON_NOVERSIONCHECK >+-to something else than an empty string. >+-]) >+- else >+- AC_MSG_RESULT([skip at user request]) >+- fi >+- else >+- AC_MSG_RESULT([yes]) >+- fi >+- >+- # >+- # if the macro parameter ``version'' is set, honour it >+- # >+- 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"` >+- if test "$ac_supports_python_ver" = "True"; then >+- AC_MSG_RESULT([yes]) >+- else >+- AC_MSG_RESULT([no]) >+- AC_MSG_ERROR([this package requires Python $1. >+-If you have it installed, but it isn't the default Python >+-interpreter in your system path, please pass the PYTHON_VERSION >+-variable to configure. See ``configure --help'' for reference. >+-]) >+- PYTHON_VERSION="" >+- fi >+- fi >+- >+- # >+ # Check if you have distutils, else fail >+ # >+ AC_MSG_CHECKING([for the distutils Python package]) >+@@ -86,7 +39,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 >+@@ -100,25 +53,8 @@ $ac_distutils_result]) >+ # >+ AC_MSG_CHECKING([for Python library path]) >+ if test -z "$PYTHON_LDFLAGS"; then >+- # (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'))"` >+- 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]]"` >+- 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(get_config_var('BLDLIBRARY'));"` >+ fi >+ AC_MSG_RESULT([$PYTHON_LDFLAGS]) >+ AC_SUBST([PYTHON_LDFLAGS]) >+@@ -129,36 +65,12 @@ $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]) >+ >+ # >+- # libraries which must be linked in when embedding >+- # >+- AC_MSG_CHECKING(python extra libraries) >+- 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')"` >+- fi >+- AC_MSG_RESULT([$PYTHON_EXTRA_LIBS]) >+- AC_SUBST(PYTHON_EXTRA_LIBS) >+- >+- # >+- # linking flags needed when embedding >+- # >+- AC_MSG_CHECKING(python extra linking flags) >+- if test -z "$PYTHON_EXTRA_LDFLAGS"; then >+- PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ >+- conf = distutils.sysconfig.get_config_var; \ >+- print conf('LINKFORSHARED')"` >+- fi >+- AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS]) >+- AC_SUBST(PYTHON_EXTRA_LDFLAGS) >+- >+- # >+ # final check to see if everything compiles alright >+ # >+ AC_MSG_CHECKING([consistency of all components of python development environment]) >+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 0ee0fc6..0e23c53 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 >@@ -33,16 +41,20 @@ Source14: unbound.sysconfig > Source15: unbound.cron > Source16: unbound-munin.README > Patch1: unbound-1.4.22-flushcache.patch >+# Support building with Python 3.x >+# https://bugzilla.redhat.com/show_bug.cgi?id=1115489 >+Patch2: 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 >@@ -106,8 +118,11 @@ Python modules and extensions for unbound > %prep > %setup -q > %patch1 -p1 >+%patch2 -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" >@@ -116,7 +131,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
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