From a1cffd9f3f9d48e6a8448be61bdb38445d87f86ca29f804f4b1edc5fbd67ece9 Mon Sep 17 00:00:00 2001 From: Marguerite Su Date: Mon, 4 Dec 2017 04:12:23 +0000 Subject: [PATCH] Accepting request 547013 from home:cbosdonnat:branches:server:dns - Use python3 instead of python2 (fate#323526) OBS-URL: https://build.opensuse.org/request/show/547013 OBS-URL: https://build.opensuse.org/package/show/server:dns/unbound?expand=0&rev=68 --- unbound.changes | 5 +++++ unbound.spec | 21 +++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/unbound.changes b/unbound.changes index f70f43e..320fa74 100644 --- a/unbound.changes +++ b/unbound.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Dec 1 09:31:03 UTC 2017 - cbosdonnat@suse.com + +- Use python3 instead of python2 (fate#323526) + ------------------------------------------------------------------- Thu Nov 23 13:49:02 UTC 2017 - rbrown@suse.com diff --git a/unbound.spec b/unbound.spec index 9d66b31..da56b1d 100644 --- a/unbound.spec +++ b/unbound.spec @@ -52,7 +52,7 @@ %define piddir %{_localstatedir}/run %endif -%if %{with python} +%if 0%{?suse_version} < 1330 && %{with python} %{!?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 @@ -69,7 +69,12 @@ BuildRequires: libevent-devel BuildRequires: libexpat-devel BuildRequires: libsodium-devel BuildRequires: openssl-devel +%if 0%{?suse_version} < 1330 BuildRequires: python-devel +%else +BuildRequires: python-rpm-macros +BuildRequires: python3-devel +%endif %if %{with dnstap} BuildRequires: libfstrm-devel BuildRequires: libprotobuf-c-devel >= 1.0.0 @@ -212,7 +217,11 @@ export CXXFLAGS="%{optflags}" --with-conf-file=%{_sysconfdir}/%{name}/unbound.conf \ --with-pidfile=%{piddir}%{name}/%{name}.pid \ %if %{with python} - --with-pythonmodule --with-pyunbound \ +%if 0%{?suse_version} < 1330 + --with-pythonmodule --with-pyunbound\ +%else + --with-pythonmodule --with-pyunbound PYTHON=%{__python3}\ +%endif %endif --with-rootkey-file=%{_sharedstatedir}/unbound/root.key @@ -267,7 +276,11 @@ install -m 0644 %{SOURCE13} %{buildroot}%{_sharedstatedir}/unbound/roo # remove static library from install (fedora packaging guidelines) rm %{buildroot}%{_libdir}/*.la %if %{with python} +%if 0%{?suse_version} < 1330 rm %{buildroot}%{python_sitearch}/*.la +%else +rm %{buildroot}%{python3_sitearch}/*.la +%endif %endif # create softlink for all functions of libunbound man pages @@ -370,7 +383,11 @@ systemd-tmpfiles --create %{_tmpfilesdir}/unbound.conf || : %if %{with python} %files python %defattr(-,root,root,-) +%if 0%{?suse_version} < 1330 %{python_sitearch}/* +%else +%{python3_sitearch}/* +%endif %doc libunbound/python/examples/* %doc pythonmod/examples/* %endif