%define major 1 %define libname %mklibname kolabxml %major %define php_extdir %(php-config --extension-dir 2>/dev/null || echo %{_libdir}/php) %global with_java 1 %global with_php 0 %global with_python 1 %if 0%{?with_php} > 0 %{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d/} %endif %if 0%{?with_python} > 0 %{!?python2_sitelib: %global python2_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?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 %{?filter_setup: %filter_provides_in %{python2_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 %{python2_sitearch}/.*\.so$ %filter_setup } %endif %endif Name: libkolabxml Version: 1.1.6 Release: %mkrel 10 Summary: Kolab XML format collection parser library Group: System/Libraries License: LGPLv3+ URL: http://www.kolab.org Source0: http://git.kolab.org/libkolabxml/snapshot/%{name}-%{version}.tar.gz Patch0: libkolabxml-0.8.4-link.patch Patch1: libkolabxml-1.1.6-pthread.patch # Debian patches: Patch10: libkolabxml-1.1.4-fix-race-condition.patch Patch11: libkolabxml-1.1.4-fix-parallel-build.patch BuildRequires: boost-devel BuildRequires: cmake >= 2.6 BuildRequires: pkgconfig(libcurl) BuildRequires: swig BuildRequires: pkgconfig(xerces-c) BuildRequires: xsd BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Test) # Mageia needs this BuildRequires: xsd-devel BuildRequires: extra-cmake-modules BuildRequires: cmake(KF5Mime) %description The libkolabxml parsing library interprets Kolab XML formats (xCal, xCard) with bindings for Python, PHP and other languages. The language bindings are available through sub-packages. %package -n %{libname} Summary: Kolab XML format collection parser library Group: System/Libraries Obsoletes: %{name} < 0.8.1-3 %description -n %{libname} The libkolabxml parsing library interprets Kolab XML formats (xCal, xCard) with bindings for Python, PHP and other languages. The language bindings are available through sub-packages. %package devel Summary: Kolab XML library development headers Group: System/Libraries Requires: %{libname} = %{version}-%{release} %description devel Development headers for the Kolab XML libraries. %if 0%{?with_java} > 0 %package -n java-kolabformat Summary: Java Bindings for libkolabxml Group: System/Libraries %description -n java-kolabformat Java bindings for libkolabxml. %endif %if 0%{?with_php} > 0 %package -n php-kolabformat Summary: PHP bindings for libkolabxml Group: System/Libraries BuildRequires: php-devel >= 5.4 BuildRequires: php-cli %description -n php-kolabformat The PHP kolabformat package offers a comprehensible PHP library using the bindings provided through libkolabxml. %endif %if 0%{?with_python} > 0 %package -n python2-kolabformat Summary: Python 2 bindings for libkolabxml Group: System/Libraries BuildRequires: pkgconfig(python2) Obsoletes: python-kolabformat < 1.1.6-4 Provides: python-kolabformat = %{version}-%{release} %description -n python2-kolabformat The PyKolab format package offers a comprehensive Python 2 library using the bindings provided through libkolabxml. %endif %prep %setup -q %autopatch -p1 %build %cmake_qt5 \ %if 0%{?with_java} > 0 -DJAVA_BINDINGS=ON \ -DJAVA_INSTALL_DIR=%{_datadir}/%{name}/java/ \ %endif %if 0%{?with_php} > 0 -DPHP_BINDINGS=ON \ -DPHP_INSTALL_DIR=%{php_extdir} \ %endif %if 0%{?with_python} > 0 -DPYTHON_BINDINGS=ON \ -DPYTHON_INCLUDE_DIRS=%{py2_incdir} \ -DPYTHON_LIBRARY=%{_libdir}/libpython%{python2_version}.so \ -DPYTHON_INSTALL_DIR=%{python2_sitearch} \ %endif -DQT5_BUILD=ON %make_build %install %make_install -C build %if 0%{?with_php} > 0 mkdir -p %{buildroot}/%{_datadir}/php mv %{buildroot}/%{php_extdir}/kolabformat.php %{buildroot}/%{_datadir}/php/kolabformat.php mkdir -p %{buildroot}/%{php_inidir}/ cat >%{buildroot}/%{php_inidir}/kolabformat.ini <<EOF extension=kolabformat.so EOF %endif %check pushd build # Make sure libkolabxml.so.* is found, otherwise the tests fail export LD_LIBRARY_PATH=$( pwd )/src/ pushd tests ./bindingstest ||: ./conversiontest ||: ./parsingtest ||: 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 %{__python2} src/python/test.py ||: %endif popd %files -n %{libname} %doc DEVELOPMENT NEWS README %{_libdir}/*.so.%{major} %{_libdir}/*.so.%{major}.* %files devel %{_includedir}/kolabxml %{_libdir}/*.so %{_libdir}/cmake/Libkolabxml %if 0%{?with_java} > 0 %files -n java-kolabformat %dir %{_datadir}/%{name} %{_datadir}/%{name}/java %endif %if 0%{?with_php} > 0 %files -n php-kolabformat %config(noreplace) %{php_inidir}/kolabformat.ini %{_datadir}/php/kolabformat.php %{php_extdir}/kolabformat.so %endif %if 0%{?with_python} > 0 %files -n python2-kolabformat %{python2_sitearch}/kolabformat.py* %{python2_sitearch}/_kolabformat.so %endif %changelog * Wed Oct 17 2018 wally <wally> 1.1.6-10.mga7 + Revision: 1321838 - add patch to fix linking - rebuild for new boost 1.68.0 * Sun Sep 23 2018 umeabot <umeabot> 1.1.6-9.mga7 + Revision: 1298950 - Mageia 7 Mass Rebuild * Sat Aug 18 2018 daviddavid <daviddavid> 1.1.6-8.mga7 + Revision: 1252463 - rebuild for new xerces-c 3.2.1 * Mon Dec 25 2017 wally <wally> 1.1.6-7.mga7 + Revision: 1184680 - rebuild for new boost * Wed Nov 22 2017 tv <tv> 1.1.6-6.mga7 + Revision: 1178559 - disable php b/c of php7 breakage - rebuild for boost 1.65 * Sat Sep 16 2017 tv <tv> 1.1.6-5.mga7 + Revision: 1154567 - rebuild with latest boost * Tue Aug 08 2017 daviddavid <daviddavid> 1.1.6-4.mga7 + Revision: 1138999 - fix python 2 library path - rename python-kolabformat to python2-kolabformat * Sat Jun 03 2017 akien <akien> 1.1.6-3.mga7 + Revision: 1105873 - Reenable php bindings, build is fine * Wed May 24 2017 neoclust <neoclust> 1.1.6-2.mga6 + Revision: 1104354 - Disable php binding, does not build currently * Sun Jan 01 2017 luigiwalser <luigiwalser> 1.1.6-1.mga6 + Revision: 1078967 - 1.1.6 * Sun Sep 25 2016 daviddavid <daviddavid> 1.1.4-2.mga6 + Revision: 1056117 - add Debian patches to fix a race condition and fix parallel build * autobuild sometimes fails with generated php_kolabformat.h * Wed Aug 10 2016 luigiwalser <luigiwalser> 1.1.4-1.mga6 + Revision: 1045278 - 1.1.4 * Wed Jan 20 2016 spuhler <spuhler> 1.1.2-4.mga6 + Revision: 926084 - revert last change. We need php-bindings. * we reverted to php-5 * Thu Dec 31 2015 tv <tv> 1.1.2-3.mga6 + Revision: 917166 - rebuild for new boost + daviddavid <daviddavid> - rebuild for new boost 1.60.0 + spuhler <spuhler> - removed obsoleted (now in src) QT5_build.patch - upgrade to ver. 1.1.2 * Wed Oct 07 2015 spuhler <spuhler> 1.1.1-6.mga6 + Revision: 887168 - rebuild with new python * Sat Sep 26 2015 daviddavid <daviddavid> 1.1.1-5.mga6 + Revision: 883826 - rebuild for new boost 1.59.0 * Sat Aug 22 2015 neoclust <neoclust> 1.1.1-4.mga6 + Revision: 868015 - Use less Qt5 build deps * Sat Aug 22 2015 spuhler <spuhler> 1.1.1-3.mga6 + Revision: 868002 - using macro for make. It builds - added QT5_build.patch from upstream in last commit * Sat Aug 22 2015 spuhler <spuhler> 1.1.1-2.mga6 + Revision: 867997 - added -DQT5_BUILD=ON to %%cmake - added BuildRequires: extra-cmake-modules - changed BuildRequires: to qt5-devel * Fri Aug 21 2015 spuhler <spuhler> 1.1.1-1.mga6 + Revision: 867151 - upgrade to vers. 1.1.1 * Sun Aug 02 2015 daviddavid <daviddavid> 1.1.0-2.mga6 + Revision: 860568 - rebuild for new boost-1.58.0 * Thu Jun 25 2015 spuhler <spuhler> 1.1.0-1.mga6 + Revision: 843431 - update to vers. 1.1.0 * Fri Nov 21 2014 spuhler <spuhler> 1.0.3-1.mga5 + Revision: 798138 - upgrade to ver. 1.0.3 * Wed Oct 15 2014 umeabot <umeabot> 1.0.2-4.mga5 + Revision: 742365 - Second Mageia 5 Mass Rebuild * Sat Sep 27 2014 tv <tv> 1.0.2-3.mga5 + Revision: 726729 - rebuild for missing pythoneggs deps * Tue Sep 16 2014 umeabot <umeabot> 1.0.2-2.mga5 + Revision: 681561 - Mageia 5 Mass Rebuild * Thu Aug 28 2014 spuhler <spuhler> 1.0.2-1.mga5 + Revision: 668920 - upgrade to version 1.0.2 * Sat May 31 2014 pterjan <pterjan> 1.0.1-3.mga5 + Revision: 628300 - Rebuild for new Python * Fri May 02 2014 spuhler <spuhler> 1.0.1-2.mga5 + Revision: 619377 - rebuild for php-5.6.0 * Tue Feb 11 2014 spuhler <spuhler> 1.0.1-1.mga5 + Revision: 589554 - upgrade to ver 1.0.1 * Sat Feb 08 2014 barjac <barjac> 0.8.4-6.mga5 + Revision: 586665 - rebuild against boost-1.55 * Sat Jan 25 2014 oden <oden> 0.8.4-5.mga4 + Revision: 568187 - revert version bump - don't use parallel make * Fri Jan 24 2014 oden <oden> 1.0.1-1.mga4 + Revision: 568063 - 1.0.1 + pterjan <pterjan> - Rebuild for new PHP * Mon Oct 21 2013 umeabot <umeabot> 0.8.4-4.mga4 + Revision: 538821 - Mageia 4 Mass Rebuild * Wed Oct 02 2013 spuhler <spuhler> 0.8.4-3.mga4 + Revision: 490231 - bumped rel for rebuild * Wed Jul 10 2013 fwang <fwang> 0.8.4-2.mga4 + Revision: 452358 - rebuild for new boost * Wed Apr 17 2013 spuhler <spuhler> 0.8.4-1.mga3 + Revision: 410237 - upgrade to 0.8.4 -bug fixes by upstream - replace 0.8.3-link.patch with 0.8.4 * Thu Apr 11 2013 spuhler <spuhler> 0.8.3-2.mga3 + Revision: 409571 - bumped rel for rebuild against boost-1.53 * Tue Apr 02 2013 spuhler <spuhler> 0.8.3-1.mga3 + Revision: 407313 - upgrade to 0.8.3 - bug fixes - replaced 0.8.1 with 0.8.3 link patch * Sat Jan 12 2013 umeabot <umeabot> 0.8.1-7.mga3 + Revision: 357618 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Tue Jan 08 2013 spuhler <spuhler> 0.8.1-6.mga3 + Revision: 341782 - bumped rel fro rebuild with new php-devel - build with threadsafe php-devel * Thu Dec 20 2012 fwang <fwang> 0.8.1-4.mga3 + Revision: 332953 - rebuild for new boost * Sun Sep 09 2012 fwang <fwang> 0.8.1-3.mga3 + Revision: 290791 - fix linkage of php module - cleanup spec file - migrate to more mageia style of package name * Fri Aug 24 2012 spuhler <spuhler> 0.8.1-2.mga3 + Revision: 283494 - added -DLIB_INSTALL_DIR=%%{_libdir} \ to the cmake section to get the correct lib arch * Mon Aug 20 2012 spuhler <spuhler> 0.8.1-1.mga3 + Revision: 282498 - imported package libkolabxml