From b8af4e376597d71511b4ec15f0bdeabf52c0e09abc1a36872763e94713c6cb48 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 8 Feb 2018 08:43:54 +0000 Subject: [PATCH] Accepting request 572439 from home:jsjhb:branches:devel:languages:python - fix building bindings for Python 2 for suse_version < 1500 OBS-URL: https://build.opensuse.org/request/show/572439 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/rrdtool?expand=0&rev=84 --- rrdtool.changes | 5 +++++ rrdtool.spec | 24 ++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/rrdtool.changes b/rrdtool.changes index 28d4690..63e026a 100644 --- a/rrdtool.changes +++ b/rrdtool.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Feb 4 08:56:33 UTC 2018 - obs@botter.cc + +- fix building bindings for Python 2 for suse_version < 1500 + ------------------------------------------------------------------- Thu Nov 23 13:53:48 UTC 2017 - rbrown@suse.com diff --git a/rrdtool.spec b/rrdtool.spec index 7ec28f8..a6e46bf 100644 --- a/rrdtool.spec +++ b/rrdtool.spec @@ -28,6 +28,10 @@ %bcond_without libdbi %bcond_without libwrap %bcond_with rados +%define python python +%if 0%{?suse_version} >= 1500 + %define python python3 +%endif Name: rrdtool Version: 1.7.0 Release: 0 @@ -44,7 +48,9 @@ Source99: %{name}.changes Patch3: rrdtool-tclsegfault.patch # PATCH-FIX-UPSTREAM -- bnc#793636 Patch12: rrdtool-zero_vs_nothing.patch +%if 0%{?suse_version} >= 1500 Patch13: python3.patch +%endif # Needed for tests BuildRequires: bc BuildRequires: cairo-devel >= 1.2 @@ -63,8 +69,8 @@ BuildRequires: systemd-rpm-macros BuildRequires: zlib-devel Requires: dejavu %if %{with python} -BuildRequires: python3-devel -BuildRequires: python3-setuptools +BuildRequires: %{python}-devel +BuildRequires: %{python}-setuptools %endif %if %{with lua} BuildRequires: lua-devel @@ -150,13 +156,13 @@ This package contains the Lua bindings. %endif %if %{with python} -%package -n python3-%{name} +%package -n %{python}-%{name} Summary: Python bindings for RRDtool Group: Development/Languages/Python Requires: %{name} = %{version}-%{release} -Requires: python3 +Requires: %{python} -%description -n python3-%{name} +%description -n %{python}-%{name} Python RRDtool bindings. %endif @@ -210,7 +216,9 @@ daemon was written to alleviate these problems. %setup -q %patch3 %patch12 -p1 +%if 0%{?suse_version} >= 1500 %patch13 -p1 +%endif # rrd_tool/rrd_cgi: use the date of the last change modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")" @@ -368,9 +376,13 @@ getent passwd %{rrdcached_user} >/dev/null || useradd -s /sbin/nologin -g %{rrdc %endif %if %{with python} -%files -n python3-%{name} +%files -n %{python}-%{name} %doc bindings/python/COPYING bindings/python/README.md +%if 0%{?suse_version} >= 1500 %{python3_sitearch}/* +%else +%{python_sitearch}/* +%endif %endif %if %{with ruby}