Projects
Kolab:Winterfell
libkolabxml
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 63
View file
libkolabxml.spec
Changed
@@ -13,6 +13,7 @@ %global with_java 1 %global with_php 1 %global with_python 1 +%global with_python3 1 %{expand: %(if `php-config --vernum` -gt 70000 ; then echo %%global with_php7 1; else echo %%global with_php7 0; fi)} @@ -34,12 +35,15 @@ %{!?python2_sitearch: %global python2_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %endif -# 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 +%if 0%{?with_python3} > 0 +%{!?python3_sitelib: %global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%{!?python3_sitearch: %global python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%endif + +%if 0%{?with_python3} > 0 %{?filter_setup: %filter_provides_in %{python2_sitearch}/.*\.so$ +%filter_provides_in %{python3_sitearch}/.*\.so$ %filter_provides_in %{php_extdir}/.*\.so$ %filter_setup } @@ -49,14 +53,6 @@ %filter_setup } %endif -%else -%if 0%{?with_python} > 0 -%{?filter_setup: -%filter_provides_in %{python2_sitearch}/.*\.so$ -%filter_setup -} -%endif -%endif %if 0%{?suse_version} Name: libkolabxml1 @@ -86,6 +82,7 @@ BuildRequires: gcc-c++ BuildRequires: libcurl-devel BuildRequires: make + %if 0%{?suse_version} BuildRequires: qt-devel %else @@ -105,6 +102,13 @@ BuildRequires: xerces-c-devel %endif +%if 0%{?rhel} >= 8 || 0%{?fedora} +BuildRequires: python3-devel +BuildRequires: python36 +%else +BuildRequires: python +%endif + Provides: libkolabxml%{?_isa} = %{version} %if 0%{?with_csharp} < 1 @@ -127,6 +131,11 @@ Provides: python-kolabformat = %{version}-%{release} %endif +%if 0%{?with_python3} < 1 +Obsoletes: python3-kolabformat < %{version}-%{release} +Provides: python3-kolabformat = %{version}-%{release} +%endif + %description The libkolabxml parsing library interprets Kolab XML formats (xCal, xCard) with bindings for Python, PHP and other languages. The language bindings @@ -168,6 +177,9 @@ Requires: python-devel %endif %endif +%if 0%{?with_python3} > 0 +Requires: python3-devel +%endif %if 0%{?suse_version} Requires: qt-devel %else @@ -342,6 +354,22 @@ bindings provided through libkolabxml. %endif +%if 0%{?with_python3} > 0 +%package -n python3-kolabformat +Summary: Python3 bindings for libkolabxml +Group: System Environment/Libraries +Requires: libkolabxml%{?_isa} = %{version} +%if 0%{?suse_version} +Obsoletes: python3-%{name} < %{version} +Provides: python3-%{name} = %{version} +%endif +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 -c -n libkolabxml-%{version} pwd @@ -378,9 +406,17 @@ popd %endif +%if 0%{?with_python3} > 0 +cp -a libkolabxml-%{version} libkolabxml-%{version}-python3 +%endif + %build pushd %{name}-%{version} -python utils/zonetabconversion.py +%if 0%{?rhel} >= 8 || 0%{?fedora} +%{python3} utils/zonetabconversion.py +%else +%{__python2} utils/zonetabconversion.py +%endif popd %if 0%{?plesk} @@ -393,6 +429,9 @@ cp %{name}-%{version}/tztable.h %{name}-%{version}-7.3/. cp %{name}-%{version}/tztable.h %{name}-%{version}-7.4/. %endif +%if 0%{?with_python3} > 0 +cp %{name}-%{version}/tztable.h %{name}-%{version}-python3/. +%endif pushd %{name}-%{version} rm -rf build @@ -451,6 +490,30 @@ popd popd +%if 0%{?with_python3} > 0 + pushd %{name}-%{version}-python3 + rm -rf build + mkdir -p build + pushd build + %cmake \ + -DBoost_NO_BOOST_CMAKE=TRUE \ + -Wno-fatal-errors -Wno-errors \ + -DCMAKE_SKIP_RPATH=ON \ + -DCMAKE_PREFIX_PATH=%{_libdir} \ +%if 0%{?rhel} >= 8 || 0%{?fedora} + -DQT5_BUILD=ON \ +%endif + -DINCLUDE_INSTALL_DIR=%{_includedir} \ + -DPYTHON_BINDINGS=ON \ + -DPYTHON_INCLUDE_DIRS=%{python3_include} \ + -DPYTHON_INSTALL_DIR=%{python3_sitearch} \ + .. + make + popd + popd +%endif + + %if 0%{?plesk} %if 0%{?rhel} < 8 || 0%{?fedora} for version in 5.6 7.0 7.1 7.2 7.3 7.4; do @@ -501,6 +564,13 @@ %endif popd +%if 0%{?with_python3} > 0 + pushd %{name}-%{version}-python3 + pushd build + make install DESTDIR=%{buildroot} INSTALL='install -p' + popd +%endif + %if 0%{?plesk} %if 0%{?rhel} < 8 || 0%{?fedora} for version in 5.6 7.0 7.1 7.2 7.3 7.4; do @@ -533,9 +603,9 @@ # Make sure libkolabxml.so.* is found, otherwise the tests fail export LD_LIBRARY_PATH=$( pwd )/src/ pushd tests -./bindingstest ||: -./conversiontest ||: -./parsingtest ||: +./bindingstest +./conversiontest +./parsingtest popd %if 0%{?with_php} > 0 php -d enable_dl=On -dextension=src/php/kolabformat.so src/php/test.php ||: @@ -545,6 +615,13 @@ %endif popd +%if 0%{?with_python3} > 0 + pushd %{name}-%{version}-python3/build/ + export LD_LIBRARY_PATH=$( pwd )/src/ + python3 src/python/test.py ||: + popd +%endif + %if 0%{?plesk} %if 0%{?rhel} < 8 || 0%{?fedora} for version in 5.6 7.0 7.1 7.2 7.3 7.4; do @@ -657,6 +734,19 @@ %{python2_sitearch}/_kolabformat.so %endif +%if 0%{?with_python3} > 0 +%files -n python3-kolabformat +%defattr(-,root,root,-) +%{python3_sitearch}/kolabformat.py* +%{python3_sitearch}/_kolabformat.so +%if 0%{?rhel} >= 8 +%pycached %{python3_sitearch}/kolabformat.py +%else +/usr/lib64/python3.6/site-packages/__pycache__/kolabformat.cpython-36.opt-1.pyc +/usr/lib64/python3.6/site-packages/__pycache__/kolabformat.cpython-36.pyc +%endif +%endif + %changelog * Tue Feb 15 2022 Christian Mollekopf <mollekopf@kolabsys.com> - 1.2.1 - Release of version 1.2.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.