diff --git a/python3.patch b/python3.patch new file mode 100644 index 0000000..c1c3b1c --- /dev/null +++ b/python3.patch @@ -0,0 +1,18 @@ +Index: rrdtool-1.7.0/m4/acinclude.m4 +=================================================================== +--- rrdtool-1.7.0.orig/m4/acinclude.m4 ++++ rrdtool-1.7.0/m4/acinclude.m4 +@@ -426,12 +426,7 @@ AC_DEFUN([AM_CHECK_PYTHON_HEADERS], + [AC_REQUIRE([AM_PATH_PYTHON]) + AC_MSG_CHECKING(for headers required to compile python extensions) + dnl deduce PYTHON_INCLUDES +-py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"` +-py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"` +-PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" +-if test "$py_prefix" != "$py_exec_prefix"; then +- PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" +-fi ++PYTHON_INCLUDES="-I"`$PYTHON -c "import sysconfig; print(sysconfig.get_path('include'))"` + AC_SUBST(PYTHON_INCLUDES) + dnl check if the headers exist: + save_CPPFLAGS="$CPPFLAGS" diff --git a/rrdtool.changes b/rrdtool.changes index 96e3add..5af6341 100644 --- a/rrdtool.changes +++ b/rrdtool.changes @@ -4,6 +4,11 @@ Thu Nov 23 13:53:48 UTC 2017 - rbrown@suse.com - Replace references to /var/adm/fillup-templates with new %_fillupdir macro (boo#1069468) +------------------------------------------------------------------- +Fri Nov 10 18:20:19 UTC 2017 - jmatejek@suse.com + +- build bindings for Python 3 instead of Python 2 + ------------------------------------------------------------------- Mon Jul 24 12:14:04 UTC 2017 - dimstar@opensuse.org diff --git a/rrdtool.spec b/rrdtool.spec index 9ff4f76..ae51cf6 100644 --- a/rrdtool.spec +++ b/rrdtool.spec @@ -44,6 +44,7 @@ Source99: %{name}.changes Patch3: rrdtool-tclsegfault.patch # PATCH-FIX-UPSTREAM -- bnc#793636 Patch12: rrdtool-zero_vs_nothing.patch +Patch13: python3.patch # Needed for tests BuildRequires: bc BuildRequires: cairo-devel >= 1.2 @@ -62,8 +63,8 @@ BuildRequires: systemd-rpm-macros BuildRequires: zlib-devel Requires: dejavu %if %{with python} -BuildRequires: python-devel -BuildRequires: python-setuptools +BuildRequires: python3-devel +BuildRequires: python3-setuptools %endif %if %{with lua} BuildRequires: lua-devel @@ -149,13 +150,13 @@ This package contains the Lua bindings. %endif %if %{with python} -%package -n python-%{name} +%package -n python3-%{name} Summary: Python bindings for RRDtool Group: Development/Languages/Python Requires: %{name} = %{version}-%{release} -Requires: python +Requires: python3 -%description -n python-%{name} +%description -n python3-%{name} Python RRDtool bindings. %endif @@ -209,6 +210,7 @@ daemon was written to alleviate these problems. %setup -q %patch3 %patch12 -p1 +%patch13 -p1 # rrd_tool/rrd_cgi: use the date of the last change modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")" @@ -217,6 +219,9 @@ TIME="\"$(date -d "${modified}" "+%%R")\"" find . -name '*.c' -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" "{}" "+" %build +# we are patching configure, we need to reconf +autoreconf -fi + # --disable-nls: there is only partial hungarian translation, does not make %{?_smp_mflags} # much sense to ship package for it %configure \ @@ -363,9 +368,9 @@ getent passwd %{rrdcached_user} >/dev/null || useradd -s /sbin/nologin -g %{rrdc %endif %if %{with python} -%files -n python-%{name} +%files -n python3-%{name} %doc bindings/python/COPYING bindings/python/README.md -%{py_sitedir}/* +%{python3_sitearch}/* %endif %if %{with ruby}