From e882c424e3f27782b9ab4cf166d648a201ee3a42c0a31d6351cdd5c561312a99 Mon Sep 17 00:00:00 2001 From: Aurelien Aptel Date: Mon, 19 Mar 2018 15:28:20 +0000 Subject: [PATCH] Accepting request 557473 from home:dmulder:branches:network:samba:STABLE Changes required for adding Python3 support to the samba package. OBS-URL: https://build.opensuse.org/request/show/557473 OBS-URL: https://build.opensuse.org/package/show/network:samba:STABLE/talloc?expand=0&rev=102 --- talloc.spec | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/talloc.spec b/talloc.spec index af8f03e..600ceb4 100644 --- a/talloc.spec +++ b/talloc.spec @@ -18,6 +18,8 @@ %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %{!?py3_soflags: %global py3_soflags cpython-%{python3_version_nodots}m} +%{!?py3_soflags_dash: %global py3_soflags_dash %(echo %{py3_soflags} | sed "s/_/-/g")} +%{!?py3_incdir: %global py3_incdir %(%{__python3} -c "import sysconfig as s; print(s.get_path('include'))")} %if 0%{?suse_version} > 1310 || 0%{?fedora_version} > 20 %define with_python3 1 %else @@ -36,6 +38,7 @@ BuildRequires: libxslt BuildRequires: pkg-config BuildRequires: python-devel %if %{with_python3} +BuildRequires: python3-base BuildRequires: python3-devel %endif #!BuildIgnore: python @@ -112,7 +115,6 @@ Requires: pkg-config Requires: python-talloc = %{version} Provides: pytalloc-devel = %{version} Obsoletes: pytalloc-devel < %{version} -Conflicts: python3-talloc-devel %description -n python-talloc-devel Libraries and Header Files to Develop Programs with python-talloc Support @@ -130,7 +132,6 @@ Summary: Developer tools for the Talloc library Group: Development/Libraries/Python Requires: pkg-config Requires: python3-talloc = %{version} -Conflicts: python-talloc-devel %description -n python3-talloc-devel Libraries and Header Files to Develop Programs with python3-talloc Support @@ -183,7 +184,12 @@ LD_LIBRARY_PATH=bin/shared make test %if ! %{build_man} %make_install rm -r "%{buildroot}/%{_mandir}" - +%if %{with_python3} +%{__mkdir_p} %{buildroot}/%{py3_incdir} +%{__cp} %{buildroot}/%{_includedir}/pytalloc.h %{buildroot}/%{py3_incdir}/pytalloc.h +sed -i 's;${prefix}/include;%{py3_incdir};g' %{buildroot}/%{_libdir}/pkgconfig/pytalloc-util.%{py3_soflags}.pc +sed -i 's;-lpytalloc-util.%{py3_soflags_dash};-lpytalloc-util.%{py3_soflags};g' %{buildroot}/%{_libdir}/pkgconfig/pytalloc-util.%{py3_soflags}.pc +%endif %else # Install API documentation @@ -234,8 +240,7 @@ cp -a doc/man/* "%{buildroot}/%{_mandir}/" %files -n python3-talloc-devel %defattr(-,root,root) -%{_includedir}/pytalloc.h -%{_libdir}/pkgconfig/pytalloc-util.pc +%{py3_incdir}/pytalloc.h %{_libdir}/pkgconfig/pytalloc-util.%{py3_soflags}.pc %{_libdir}/libpytalloc-util.%{py3_soflags}.so %endif