3 %bcond_without tests # build without tests
4 %bcond_with php # PHP bindings
5 %bcond_without python # Python bindings
8 Summary: Kolab XML format collection parser library
14 Source0: http://mirror.kolabsys.com/pub/releases/%{name}-%{version}.tar.gz
15 # Source0-md5: eec4b8bf117a6e263eed9ee800ae3aa6
16 URL: http://www.kolab.org/
17 BuildRequires: QtCore-devel
18 BuildRequires: boost-devel
19 BuildRequires: cmake >= 2.6
20 BuildRequires: curl-devel
21 BuildRequires: e2fsprogs-devel
22 BuildRequires: libstdc++-devel
23 BuildRequires: libuuid-devel
24 BuildRequires: qt4-build
25 BuildRequires: rpmbuild(macros) >= 1.600
27 BuildRequires: xerces-c-devel
30 BuildRequires: python-devel
31 BuildRequires: swig-python
34 BuildRequires: %{php_name}-cli
36 BuildRequires: %{php_name}-pcre
38 BuildRequires: %{php_name}-program
39 BuildRequires: %{php_name}-devel
40 BuildRequires: swig-php
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 The libkolabxml parsing library interprets Kolab XML formats (xCal,
46 xCard) with bindings for Python, PHP and other languages. The language
47 bindings are available through sub-packages.
50 Summary: Kolab XML library development headers
51 Group: Development/Libraries
52 Requires: %{name} = %{version}-%{release}
53 Requires: QtCore-devel
55 Requires: cmake >= 2.6
57 Requires: e2fsprogs-devel
58 Requires: libstdc++-devel
59 Requires: libuuid-devel
61 Requires: xerces-c-devel
65 Development headers for the Kolab XML libraries.
67 %package -n %{php_name}-kolabformat
68 Summary: PHP bindings for libkolabxml
69 Group: Development/Languages/PHP
70 Requires: %{name} = %{version}-%{release}
71 %{?requires_php_extension}
73 %description -n %{php_name}-kolabformat
74 The PHP kolabformat package offers a comprehensible PHP library using
75 the bindings provided through libkolabxml.
77 %package -n python-kolabformat
78 Summary: Python bindings for libkolabxml
80 Requires: %{name} = %{version}-%{release}
82 %description -n python-kolabformat
83 The PyKolab format package offers a comprehensive Python library using
84 the bindings provided through libkolabxml.
93 -Wno-fatal-errors -Wno-errors \
94 -DCMAKE_SKIP_RPATH=ON \
95 -DCMAKE_PREFIX_PATH=%{_libdir} \
96 -DINCLUDE_INSTALL_DIR=%{_includedir}/kolabxml \
97 -DLIB_INSTALL_DIR:PATH=%{_libdir} \
99 -DPHP_EXECUTABLE=%{__php} \
101 -DPHP_INSTALL_DIR=%{php_extensiondir} \
104 -DPYTHON_BINDINGS=ON \
105 -DPYTHON_INCLUDE_DIRS=%{python_include} \
106 -DPYTHON_INSTALL_DIR=%{py_sitedir} \
114 # Make sure libkolabxml.so.* is found, otherwise the tests fail
115 export LD_LIBRARY_PATH=$(pwd)/src
123 php -d 'enable_dl=On' '-dextension=../../src/php/kolabformat.so' test.php
129 %{__python} test.py ||
135 rm -rf $RPM_BUILD_ROOT
136 %{__make} -C build install \
137 INSTALL='install -p' \
138 DESTDIR=$RPM_BUILD_ROOT
141 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_data_dir}}
142 mv $RPM_BUILD_ROOT%{php_extensiondir}/kolabformat.php $RPM_BUILD_ROOT%{php_data_dir}/kolabformat.php
143 cat > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/kolabformat.ini <<EOF
144 ; Enable kolabformat extension module
145 extension=kolabformat.so
150 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
151 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
156 rm -rf $RPM_BUILD_ROOT
158 %post -p /sbin/ldconfig
159 %postun -p /sbin/ldconfig
162 %defattr(644,root,root,755)
163 %doc DEVELOPMENT NEWS README
164 %attr(755,root,root) %{_libdir}/libkolabxml.so.*.*
165 %attr(755,root,root) %ghost %{_libdir}/libkolabxml.so.1
168 %defattr(644,root,root,755)
169 %{_includedir}/kolabxml
170 %{_libdir}/libkolabxml.so
171 %{_libdir}/cmake/Libkolabxml
174 %files -n %{php_name}-kolabformat
175 %defattr(644,root,root,755)
176 %config(noreplace) %{php_sysconfdir}/conf.d/kolabformat.ini
177 %attr(755,root,root) %{php_extensiondir}/kolabformat.so
178 %{php_data_dir}/kolabformat.php
182 %files -n python-kolabformat
183 %defattr(644,root,root,755)
184 %attr(755,root,root) %{py_sitedir}/_kolabformat.so
185 %{py_sitedir}/kolabformat.py[co]