From f4088326d78ffa74d9e89879762ec9d6bf9e61c1 Mon Sep 17 00:00:00 2001 From: Timotheus Pokorra Date: Jan 21 2019 21:45:08 +0000 Subject: enable Python again, supporting Python 3 --- diff --git a/libkolabxml.spec b/libkolabxml.spec index 68544ba..c84553b 100644 --- a/libkolabxml.spec +++ b/libkolabxml.spec @@ -12,7 +12,7 @@ %else %global with_php 1 %endif -%global with_python 0 +%global with_python 1 %if 0%{?with_php} > 0 %{!?php_extdir: %global php_extdir %{_libdir}/php/modules} @@ -25,18 +25,33 @@ %endif %endif -# Filter out private php libs. Does not work on EPEL5, +# Filter out private python and php libs. Does not work on EPEL5, # therefor we use it conditionally %if 0%{?with_php} > 0 +%if 0%{?with_python} > 0 %{?filter_setup: +%filter_provides_in %{python3_sitearch}/.*\.so$ %filter_provides_in %{php_extdir}/.*\.so$ %filter_setup } +%else +%{?filter_setup: +%filter_provides_in %{php_extdir}/.*\.so$ +%filter_setup +} +%endif +%else +%if 0%{?with_python} > 0 +%{?filter_setup: +%filter_provides_in %{python3_sitearch}/.*\.so$ +%filter_setup +} +%endif %endif Name: libkolabxml Version: 1.1.6 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Kolab XML format collection parser library License: LGPLv3+ @@ -135,6 +150,19 @@ The PHP kolabformat package offers a comprehensible PHP library using the bindings provided through libkolabxml. %endif +%if 0%{?with_python} > 0 +%package -n python3-kolabformat +Summary: Python bindings for libkolabxml +Obsoletes: python-kolabformat < 1.1.4 +Provides: python-kolabformat = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} +BuildRequires: python3-devel +%description -n python3-kolabformat +The PyKolab format package offers a comprehensive Python library using the +bindings provided through libkolabxml. +%endif + + %prep %setup -q -n libkolabxml-%{version} @@ -155,6 +183,10 @@ pushd build -DPHP_BINDINGS=ON \ -DPHP_INSTALL_DIR=%{php_extdir} \ %endif +%if 0%{?with_python} > 0 + -DPYTHON_BINDINGS=ON \ + -DPYTHON_INSTALL_DIR=%{python3_sitearch} +%endif popd @@ -186,6 +218,9 @@ popd %if 0%{?with_php} > 0 php -d enable_dl=On -dextension=src/php/kolabformat.so src/php/test.php ||: %endif +%if 0%{?with_python} > 0 +python3 src/python/test.py ||: +%endif popd @@ -220,8 +255,18 @@ popd %config(noreplace) %{php_inidir}/%{ini_name} %endif +%if 0%{?with_python} > 0 +%files -n python3-kolabformat +%{python3_sitearch}/kolabformat.py +%{python3_sitearch}/_kolabformat.so +%{python3_sitearch}/__pycache__/* +%endif + %changelog +* Mon Jan 21 2019 Timotheus Pokorra - 1.1.6-8 +- enable Python again, supporting Python 3 + * Mon Jan 21 2019 Timotheus Pokorra - 1.1.6-7 - Drop python2-kolabformat for mass Python 2 package removal