3 %bcond_without tests # build without tests
6 Summary: Kolab XML format collection parser library
12 URL: http://www.kolab.org/
13 Source0: http://mirror.kolabsys.com/pub/releases/%{name}-%{version}.tar.gz
14 # Source0-md5: 7adccfa0ed91ac954c815e8d13f334ee
15 BuildRequires: QtCore-devel
16 BuildRequires: boost-devel
17 BuildRequires: cmake >= 2.6
18 BuildRequires: curl-devel
19 BuildRequires: e2fsprogs-devel
20 BuildRequires: kde4-kdelibs-devel
21 BuildRequires: kde4-kdepimlibs-devel
22 BuildRequires: libstdc++-devel
23 BuildRequires: libuuid-devel
24 #BuildRequires: %{php_name}-devel >= %{min_php}
25 BuildRequires: %{php_name}-devel
26 BuildRequires: python-devel
27 BuildRequires: qt4-build
28 BuildRequires: rpmbuild(macros) >= 1.600
30 BuildRequires: swig-php
31 BuildRequires: swig-python
32 BuildRequires: xerces-c-devel
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 The libkolabxml parsing library interprets Kolab XML formats (xCal,
38 xCard) with bindings for Python, PHP and other languages. The language
39 bindings are available through sub-packages.
42 Summary: Kolab XML library development headers
43 Group: Development/Libraries
44 Requires: %{name} = %{version}-%{release}
45 Requires: QtCore-devel
47 Requires: cmake >= 2.6
49 Requires: e2fsprogs-devel
50 Requires: kde4-kdelibs-devel
51 Requires: kde4-kdepimlibs-devel
52 Requires: libstdc++-devel
53 Requires: libuuid-devel
54 #Requires: %{php_name}-devel >= %{min_php}
55 Requires: %{php_name}-devel
56 Requires: python-devel
58 Requires: xerces-c-devel
62 Development headers for the Kolab XML libraries.
64 %package -n %{php_name}-kolabformat
65 Summary: PHP bindings for libkolabxml
66 Group: Development/Languages/PHP
67 Requires: %{name} = %{version}-%{release}
68 %{?requires_php_extension}
70 %description -n %{php_name}-kolabformat
71 The PHP kolabformat package offers a comprehensible PHP library using
72 the bindings provided through libkolabxml.
74 %package -n python-kolabformat
75 Summary: Python bindings for libkolabxml
77 Requires: %{name} = %{version}-%{release}
79 %description -n python-kolabformat
80 The PyKolab format package offers a comprehensive Python library using
81 the bindings provided through libkolabxml.
90 -Wno-fatal-errors -Wno-errors \
91 -DPHP_EXECUTABLE=%{_bindir}/php \
92 -DCMAKE_SKIP_RPATH=ON \
93 -DCMAKE_PREFIX_PATH=%{_libdir} \
94 -DINCLUDE_INSTALL_DIR=%{_includedir}/kolabxml \
95 -DLIB_INSTALL_DIR:PATH=%{_libdir} \
96 -DPYTHON_INCLUDE_DIRS=%{python_include} \
98 -DPHP_INSTALL_DIR=%{php_extensiondir} \
99 -DPYTHON_BINDINGS=ON \
100 -DPYTHON_INSTALL_DIR=%{py_sitedir} \
107 # Make sure libkolabxml.so.* is found, otherwise the tests fail
108 export LD_LIBRARY_PATH=$(pwd)/src
114 php -d 'enable_dl=On' '-dextension=../../src/php/kolabformat.so' test.php
117 %{__python} test.py ||
121 rm -rf $RPM_BUILD_ROOT
122 %{__make} -C build install \
123 INSTALL='install -p' \
124 DESTDIR=$RPM_BUILD_ROOT
126 install -d $RPM_BUILD_ROOT%{php_data_dir}
127 mv $RPM_BUILD_ROOT%{php_extensiondir}/kolabformat.php $RPM_BUILD_ROOT%{php_data_dir}/kolabformat.php
129 install -d $RPM_BUILD_ROOT%{php_sysconfdir}
130 cat > $RPM_BUILD_ROOT%{php_sysconfdir}/kolabformat.ini <<EOF
131 ; Enable kolabformat extension module
132 extension=kolabformat.so
135 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
136 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
140 rm -rf $RPM_BUILD_ROOT
142 %post -p /sbin/ldconfig
143 %postun -p /sbin/ldconfig
146 %defattr(644,root,root,755)
147 %doc DEVELOPMENT NEWS README
148 %attr(755,root,root) %{_libdir}/libkolabxml.so.*.*
149 %attr(755,root,root) %ghost %{_libdir}/libkolabxml.so.1
152 %defattr(644,root,root,755)
153 %{_includedir}/kolabxml
155 %{_libdir}/cmake/Libkolabxml
157 %files -n %{php_name}-kolabformat
158 %defattr(644,root,root,755)
159 %config(noreplace) %{php_sysconfdir}/kolabformat.ini
160 %attr(755,root,root) %{php_extensiondir}/kolabformat.so
161 %{php_data_dir}/kolabformat.php
163 %files -n python-kolabformat
164 %defattr(644,root,root,755)
165 %attr(755,root,root) %{py_sitedir}/_kolabformat.so
166 %{py_sitedir}/kolabformat.py[co]