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
This commit is contained in:
Aurelien Aptel 2018-03-19 15:28:20 +00:00 committed by Git OBS Bridge
parent b764520cbe
commit e882c424e3

View File

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