3 %bcond_without tests # build without tests
4 %bcond_without 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: 7adccfa0ed91ac954c815e8d13f334ee
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: kde4-kdelibs-devel
23 BuildRequires: kde4-kdepimlibs-devel
24 BuildRequires: libstdc++-devel
25 BuildRequires: libuuid-devel
26 BuildRequires: qt4-build
27 BuildRequires: rpmbuild(macros) >= 1.600
29 BuildRequires: xerces-c-devel
32 BuildRequires: python-devel
33 BuildRequires: swig-python
36 BuildRequires: %{php_name}-cli
37 BuildRequires: %{php_name}-program
38 BuildRequires: %{php_name}-devel
39 BuildRequires: swig-php
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 The libkolabxml parsing library interprets Kolab XML formats (xCal,
45 xCard) with bindings for Python, PHP and other languages. The language
46 bindings are available through sub-packages.
49 Summary: Kolab XML library development headers
50 Group: Development/Libraries
51 Requires: %{name} = %{version}-%{release}
52 Requires: QtCore-devel
54 Requires: cmake >= 2.6
56 Requires: e2fsprogs-devel
57 Requires: kde4-kdelibs-devel
58 Requires: kde4-kdepimlibs-devel
59 Requires: libstdc++-devel
60 Requires: libuuid-devel
62 Requires: xerces-c-devel
66 Development headers for the Kolab XML libraries.
68 %package -n %{php_name}-kolabformat
69 Summary: PHP bindings for libkolabxml
70 Group: Development/Languages/PHP
71 Requires: %{name} = %{version}-%{release}
72 %{?requires_php_extension}
74 %description -n %{php_name}-kolabformat
75 The PHP kolabformat package offers a comprehensible PHP library using
76 the bindings provided through libkolabxml.
78 %package -n python-kolabformat
79 Summary: Python bindings for libkolabxml
81 Requires: %{name} = %{version}-%{release}
83 %description -n python-kolabformat
84 The PyKolab format package offers a comprehensive Python library using
85 the bindings provided through libkolabxml.
94 -Wno-fatal-errors -Wno-errors \
95 -DCMAKE_SKIP_RPATH=ON \
96 -DCMAKE_PREFIX_PATH=%{_libdir} \
97 -DINCLUDE_INSTALL_DIR=%{_includedir}/kolabxml \
98 -DLIB_INSTALL_DIR:PATH=%{_libdir} \
100 -DPHP_EXECUTABLE=%{__php} \
102 -DPHP_INSTALL_DIR=%{php_extensiondir} \
105 -DPYTHON_BINDINGS=ON \
106 -DPYTHON_INCLUDE_DIRS=%{python_include} \
107 -DPYTHON_INSTALL_DIR=%{py_sitedir} \
115 # Make sure libkolabxml.so.* is found, otherwise the tests fail
116 export LD_LIBRARY_PATH=$(pwd)/src
124 php -d 'enable_dl=On' '-dextension=../../src/php/kolabformat.so' test.php
130 %{__python} test.py ||
136 rm -rf $RPM_BUILD_ROOT
137 %{__make} -C build install \
138 INSTALL='install -p' \
139 DESTDIR=$RPM_BUILD_ROOT
142 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_data_dir}}
143 mv $RPM_BUILD_ROOT%{php_extensiondir}/kolabformat.php $RPM_BUILD_ROOT%{php_data_dir}/kolabformat.php
144 cat > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/kolabformat.ini <<EOF
145 ; Enable kolabformat extension module
146 extension=kolabformat.so
151 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
152 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
157 rm -rf $RPM_BUILD_ROOT
159 %post -p /sbin/ldconfig
160 %postun -p /sbin/ldconfig
163 %defattr(644,root,root,755)
164 %doc DEVELOPMENT NEWS README
165 %attr(755,root,root) %{_libdir}/libkolabxml.so.*.*
166 %attr(755,root,root) %ghost %{_libdir}/libkolabxml.so.1
169 %defattr(644,root,root,755)
170 %{_includedir}/kolabxml
171 %{_libdir}/libkolabxml.so
172 %{_libdir}/cmake/Libkolabxml
175 %files -n %{php_name}-kolabformat
176 %defattr(644,root,root,755)
177 %config(noreplace) %{php_sysconfdir}/conf.d/kolabformat.ini
178 %attr(755,root,root) %{php_extensiondir}/kolabformat.so
179 %{php_data_dir}/kolabformat.php
183 %files -n python-kolabformat
184 %defattr(644,root,root,755)
185 %attr(755,root,root) %{py_sitedir}/_kolabformat.so
186 %{py_sitedir}/kolabformat.py[co]