3 %bcond_without tests # build without tests
4 %bcond_without php # PHP bindings
5 %bcond_without python # Python bindings
7 Summary: Kolab XML format collection parser library
13 Source0: http://mirror.kolabsys.com/pub/releases/%{name}-%{version}.tar.gz
14 # Source0-md5: 7adccfa0ed91ac954c815e8d13f334ee
15 URL: http://www.kolab.org/
16 BuildRequires: QtCore-devel
17 BuildRequires: boost-devel
18 BuildRequires: cmake >= 2.6
19 BuildRequires: curl-devel
20 BuildRequires: e2fsprogs-devel
21 BuildRequires: kde4-kdelibs-devel
22 BuildRequires: kde4-kdepimlibs-devel
23 BuildRequires: libstdc++-devel
24 BuildRequires: libuuid-devel
25 BuildRequires: qt4-build
26 BuildRequires: rpmbuild(macros) >= 1.600
28 BuildRequires: xerces-c-devel
31 BuildRequires: python-devel
32 BuildRequires: swig-python
35 BuildRequires: %{php_name}-devel
36 BuildRequires: swig-php
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 The libkolabxml parsing library interprets Kolab XML formats (xCal,
42 xCard) with bindings for Python, PHP and other languages. The language
43 bindings are available through sub-packages.
46 Summary: Kolab XML library development headers
47 Group: Development/Libraries
48 Requires: %{name} = %{version}-%{release}
49 Requires: QtCore-devel
51 Requires: cmake >= 2.6
53 Requires: e2fsprogs-devel
54 Requires: kde4-kdelibs-devel
55 Requires: kde4-kdepimlibs-devel
56 Requires: libstdc++-devel
57 Requires: libuuid-devel
59 Requires: xerces-c-devel
63 Development headers for the Kolab XML libraries.
65 %package -n %{php_name}-kolabformat
66 Summary: PHP bindings for libkolabxml
67 Group: Development/Languages/PHP
68 Requires: %{name} = %{version}-%{release}
69 %{?requires_php_extension}
71 %description -n %{php_name}-kolabformat
72 The PHP kolabformat package offers a comprehensible PHP library using
73 the bindings provided through libkolabxml.
75 %package -n python-kolabformat
76 Summary: Python bindings for libkolabxml
78 Requires: %{name} = %{version}-%{release}
80 %description -n python-kolabformat
81 The PyKolab format package offers a comprehensive Python library using
82 the bindings provided through libkolabxml.
91 -Wno-fatal-errors -Wno-errors \
92 -DCMAKE_SKIP_RPATH=ON \
93 -DCMAKE_PREFIX_PATH=%{_libdir} \
94 -DINCLUDE_INSTALL_DIR=%{_includedir}/kolabxml \
95 -DLIB_INSTALL_DIR:PATH=%{_libdir} \
97 -DPHP_EXECUTABLE=%{_bindir}/php \
99 -DPHP_INSTALL_DIR=%{php_extensiondir} \
102 -DPYTHON_BINDINGS=ON \
103 -DPYTHON_INCLUDE_DIRS=%{python_include} \
104 -DPYTHON_INSTALL_DIR=%{py_sitedir} \
112 # Make sure libkolabxml.so.* is found, otherwise the tests fail
113 export LD_LIBRARY_PATH=$(pwd)/src
121 php -d 'enable_dl=On' '-dextension=../../src/php/kolabformat.so' test.php
127 %{__python} test.py ||
133 rm -rf $RPM_BUILD_ROOT
134 %{__make} -C build install \
135 INSTALL='install -p' \
136 DESTDIR=$RPM_BUILD_ROOT
139 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_data_dir}}
140 mv $RPM_BUILD_ROOT%{php_extensiondir}/kolabformat.php $RPM_BUILD_ROOT%{php_data_dir}/kolabformat.php
141 cat > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/kolabformat.ini <<EOF
142 ; Enable kolabformat extension module
143 extension=kolabformat.so
148 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
149 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
154 rm -rf $RPM_BUILD_ROOT
156 %post -p /sbin/ldconfig
157 %postun -p /sbin/ldconfig
160 %defattr(644,root,root,755)
161 %doc DEVELOPMENT NEWS README
162 %attr(755,root,root) %{_libdir}/libkolabxml.so.*.*
163 %attr(755,root,root) %ghost %{_libdir}/libkolabxml.so.1
166 %defattr(644,root,root,755)
167 %{_includedir}/kolabxml
168 %{_libdir}/libkolabxml.so
169 %{_libdir}/cmake/Libkolabxml
172 %files -n %{php_name}-kolabformat
173 %defattr(644,root,root,755)
174 %config(noreplace) %{php_sysconfdir}/conf.d/kolabformat.ini
175 %attr(755,root,root) %{php_extensiondir}/kolabformat.so
176 %{php_data_dir}/kolabformat.php
180 %files -n python-kolabformat
181 %defattr(644,root,root,755)
182 %attr(755,root,root) %{py_sitedir}/_kolabformat.so
183 %{py_sitedir}/kolabformat.py[co]