SHA256
1
0
forked from pool/rrdtool

Accepting request 561663 from devel:languages:python

- build bindings for Python 3 instead of Python 2
  * python3.patch

OBS-URL: https://build.opensuse.org/request/show/561663
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rrdtool?expand=0&rev=67
This commit is contained in:
Dominique Leuenberger 2018-01-16 08:35:16 +00:00 committed by Git OBS Bridge
commit dc964910ae
3 changed files with 37 additions and 8 deletions

18
python3.patch Normal file
View File

@ -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"

View File

@ -4,6 +4,12 @@ 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
* python3.patch
-------------------------------------------------------------------
Mon Jul 24 12:14:04 UTC 2017 - dimstar@opensuse.org

View File

@ -1,7 +1,7 @@
#
# spec file for package rrdtool
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -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}