#
# Conditional build:
%bcond_without tests # build without tests
+%bcond_with php # PHP bindings
+%bcond_without python # Python bindings
+%define php_name php56
Summary: Kolab Object Handling Library
Name: libkolab
-Version: 0.5.0
-Release: 1
+Version: 0.6.0
+Release: 14
License: LGPL v3+
Group: Libraries
-URL: http://git.kolab.org/libkolab
Source0: http://mirror.kolabsys.com/pub/releases/%{name}-%{version}.tar.gz
-# Source0-md5: 38da4b0918e8585ab935ae02bc321aa0
+# Source0-md5: 3c4fc1fec2dfcc0841f29de8f6ff0cd3
+Patch0: 0002-Make-libkolab-compile-with-upstream-kdepimlibs.patch
+URL: http://git.kolab.org/libkolab
BuildRequires: QtCore-devel
BuildRequires: curl-devel
BuildRequires: kde4-kdepimlibs-devel >= 4.8
-BuildRequires: libkolabxml-devel >= 1.0
-BuildRequires: php-devel >= 4:5.0.4
-BuildRequires: python-devel
+BuildRequires: libkolabxml-devel >= 1.1
BuildRequires: qt4-build
BuildRequires: rpmbuild(macros) >= 1.600
BuildRequires: swig
+%if %{with php}
+BuildRequires: %{php_name}-devel
+BuildRequires: %{php_name}-cli
+%if %{with tests}
+BuildRequires: %{php_name}-pcre
+%endif
+BuildRequires: %{php_name}-program
BuildRequires: swig-php
+%endif
+%if %{with python}
+BuildRequires: python-devel
BuildRequires: swig-python
+%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Group: Development/Languages/PHP
Requires: %{name} = %{version}-%{release}
Requires: libkolabxml-devel >= 1.0
-Requires: php-devel
-Requires: pkgconfig
-Requires: python-devel
%description devel
Development headers for the Kolab object libraries.
-%package -n php-kolab
+%package -n %{php_name}-kolab
Summary: PHP Bindings for libkolab
Group: Libraries
Requires: %{name} = %{version}-%{release}
%{?requires_php_extension}
-%description -n php-kolab
+%description -n %{php_name}-kolab
PHP Bindings for libkolab.
%package -n python-kolab
%prep
%setup -q
+%patch0 -p1
%build
-rm -rf build
install -d build
cd build
%cmake \
-Wno-fatal-errors -Wno-errors \
- -DPHP_EXECUTABLE=%{_bindir}/php \
-DINCLUDE_INSTALL_DIR=%{_includedir} \
+ -DLIB_INSTALL_DIR=%{_libdir} \
+%if %{with php}
-DPHP_BINDINGS=ON \
-DPHP_INSTALL_DIR=%{php_extensiondir} \
+ -DPHP_EXECUTABLE=%{__php} \
+%endif
+%if %{with python}
-DPYTHON_BINDINGS=ON \
-DPYTHON_INSTALL_DIR=%{py_sitedir} \
+%endif
..
%{__make}
-cd -
%if %{with tests}
-cd build/tests
+cd tests
./benchmarktest || :
./calendaringtest || :
./formattest || :
%{__make} -C build install \
DESTDIR=$RPM_BUILD_ROOT
+%if %{with php}
install -d $RPM_BUILD_ROOT%{php_data_dir}
mv $RPM_BUILD_ROOT{%{php_extensiondir}/*.php,%{php_data_dir}}
+%endif
+%if %{with python}
%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
%py_comp $RPM_BUILD_ROOT%{py_sitedir}
%py_postclean
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
%{_libdir}/cmake/Libkolab
%{_includedir}/kolab
-%files -n php-kolab
+%if %{with php}
+%files -n %{php_name}-kolab
%defattr(644,root,root,755)
%attr(755,root,root) %{php_extensiondir}/kolabcalendaring.so
%attr(755,root,root) %{php_extensiondir}/kolabicalendar.so
+%attr(755,root,root) %{php_extensiondir}/kolabobject.so
%attr(755,root,root) %{php_extensiondir}/kolabshared.so
%{php_data_dir}/kolabcalendaring.php
%{php_data_dir}/kolabicalendar.php
+%{php_data_dir}/kolabobject.php
%{php_data_dir}/kolabshared.php
+%endif
+%if %{with python}
%files -n python-kolab
%defattr(644,root,root,755)
%dir %{py_sitedir}/kolab
%attr(755,root,root) %{py_sitedir}/kolab/_calendaring.so
-%{py_sitedir}/kolab/calendaring.py[co]
%attr(755,root,root) %{py_sitedir}/kolab/_icalendar.so
-%{py_sitedir}/kolab/icalendar.py[co]
+%attr(755,root,root) %{py_sitedir}/kolab/_kolabobject.so
%attr(755,root,root) %{py_sitedir}/kolab/_shared.so
+%{py_sitedir}/kolab/calendaring.py[co]
+%{py_sitedir}/kolab/icalendar.py[co]
+%{py_sitedir}/kolab/kolabobject.py[co]
%{py_sitedir}/kolab/shared.py[co]
+%endif