X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=libkolabxml.spec;h=992990fdb59b13f8eb122ade81c5b2463f4f9051;hb=eeb728d;hp=1776cc93912b40586c7cf5b601267959c3ea53f0;hpb=390184bbe731edef9d8797fc8f5a4920b72e792f;p=packages%2Flibkolabxml.git diff --git a/libkolabxml.spec b/libkolabxml.spec index 1776cc9..992990f 100644 --- a/libkolabxml.spec +++ b/libkolabxml.spec @@ -1,33 +1,44 @@ # # Conditional build: %bcond_without tests # build without tests +%bcond_with php # PHP bindings +%bcond_without python # Python bindings +%define php_name php55 Summary: Kolab XML format collection parser library Name: libkolabxml -Version: 0.8.1 -Release: 1 +Version: 1.1.6 +Release: 9 License: LGPL v3+ Group: Libraries -URL: http://www.kolab.org/ Source0: http://mirror.kolabsys.com/pub/releases/%{name}-%{version}.tar.gz -# Source0-md5: a02541b35153334c69ee1845dfe464c6 +# Source0-md5: eec4b8bf117a6e263eed9ee800ae3aa6 +URL: http://www.kolab.org/ BuildRequires: QtCore-devel BuildRequires: boost-devel BuildRequires: cmake >= 2.6 BuildRequires: curl-devel BuildRequires: e2fsprogs-devel -BuildRequires: kde4-kdelibs-devel -BuildRequires: kde4-kdepimlibs-devel BuildRequires: libstdc++-devel BuildRequires: libuuid-devel -BuildRequires: php-devel >= 5.3 -BuildRequires: python-devel BuildRequires: qt4-build BuildRequires: rpmbuild(macros) >= 1.600 BuildRequires: swig -BuildRequires: swig-php BuildRequires: xerces-c-devel BuildRequires: xsd +%if %{with python} +BuildRequires: python-devel +BuildRequires: swig-python +%endif +%if %{with php} +BuildRequires: %{php_name}-cli +%if %{with tests} +BuildRequires: %{php_name}-pcre +%endif +BuildRequires: %{php_name}-program +BuildRequires: %{php_name}-devel +BuildRequires: swig-php +%endif BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -44,12 +55,8 @@ Requires: boost-devel Requires: cmake >= 2.6 Requires: curl-devel Requires: e2fsprogs-devel -Requires: kde4-kdelibs-devel -Requires: kde4-kdepimlibs-devel Requires: libstdc++-devel Requires: libuuid-devel -Requires: php-devel >= 5.3 -Requires: python-devel Requires: swig Requires: xerces-c-devel Requires: xsd @@ -57,13 +64,13 @@ Requires: xsd %description devel Development headers for the Kolab XML libraries. -%package -n php-kolabformat +%package -n %{php_name}-kolabformat Summary: PHP bindings for libkolabxml Group: Development/Languages/PHP Requires: %{name} = %{version}-%{release} %{?requires_php_extension} -%description -n php-kolabformat +%description -n %{php_name}-kolabformat The PHP kolabformat package offers a comprehensible PHP library using the bindings provided through libkolabxml. @@ -87,11 +94,17 @@ cd build -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_PREFIX_PATH=%{_libdir} \ -DINCLUDE_INSTALL_DIR=%{_includedir}/kolabxml \ - -DPYTHON_INCLUDE_DIRS=%{python_include} \ + -DLIB_INSTALL_DIR:PATH=%{_libdir} \ +%if %{with php} + -DPHP_EXECUTABLE=%{__php} \ -DPHP_BINDINGS=ON \ -DPHP_INSTALL_DIR=%{php_extensiondir} \ +%endif +%if %{with python} -DPYTHON_BINDINGS=ON \ + -DPYTHON_INCLUDE_DIRS=%{python_include} \ -DPYTHON_INSTALL_DIR=%{py_sitedir} \ +%endif .. %{__make} cd .. @@ -101,54 +114,73 @@ cd build # Make sure libkolabxml.so.* is found, otherwise the tests fail export LD_LIBRARY_PATH=$(pwd)/src cd tests -./bindingstest ||: -./conversiontest ||: -./parsingtest ||: +./bindingstest +./conversiontest +./parsingtest cd .. -php -d enable_dl=On -dextension=src/php/kolabformat.so src/php/test.php ||: -python src/python/test.py ||: +%if %{with php} +cd src/php +php -d 'enable_dl=On' '-dextension=../../src/php/kolabformat.so' test.php +cd ../.. +%endif +%if %{with python} +cd src/python +# FIXME +%{__python} test.py || +cd ../.. +%endif %endif %install rm -rf $RPM_BUILD_ROOT - %{__make} -C build install \ INSTALL='install -p' \ DESTDIR=$RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT%{php_data_dir} +%if %{with php} +install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_data_dir}} mv $RPM_BUILD_ROOT%{php_extensiondir}/kolabformat.php $RPM_BUILD_ROOT%{php_data_dir}/kolabformat.php - -install -d $RPM_BUILD_ROOT%{php_sysconfdir} -cat > $RPM_BUILD_ROOT%{php_sysconfdir}/kolabformat.ini < $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/kolabformat.ini <