%define major 0 %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 1 %global with_python 1 %if 0%{?with_php} > 0 %{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d/} %endif %if 0%{?with_python} > 0 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?python_sitearch: %global python_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 %{python_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 %{python_sitearch}/.*\.so$ %filter_setup } %endif %endif Name: libkolabxml Version: 0.8.4 Release: %mkrel 1 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 BuildRequires: boost-devel BuildRequires: cmake >= 2.6 BuildRequires: libcurl-devel BuildRequires: swig BuildRequires: libxerces-c-devel BuildRequires: xsd BuildRequires: qt4-devel # Mageia needs this BuildRequires: xsd-devel %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 python-kolabformat Summary: Python bindings for libkolabxml Group: System/Libraries BuildRequires: python-devel %description -n python-kolabformat The PyKolab format package offers a comprehensive Python library using the bindings provided through libkolabxml. %endif %prep %setup -q %patch0 -p1 -b .libkolabxml-link %build %cmake \ %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=%{python_include} \ -DPYTHON_INSTALL_DIR=%{python_sitearch} \ %endif %make %install %makeinstall_std -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 python 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 python-kolabformat %{python_sitearch}/kolabformat.py* %{python_sitearch}/_kolabformat.so %endif %changelog * 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