]>
Commit | Line | Data |
---|---|---|
390184bb ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
a20b2092 | 4 | %bcond_with php # PHP bindings |
c866a2f0 ER |
5 | %bcond_without python # Python bindings |
6 | ||
d2b82142 | 7 | %define php_name php55 |
f0ba6589 AM |
8 | Summary: Kolab XML format collection parser library |
9 | Name: libkolabxml | |
9b3fc279 | 10 | Version: 1.1.6 |
eeb728d6 | 11 | Release: 9 |
390184bb | 12 | License: LGPL v3+ |
f0ba6589 | 13 | Group: Libraries |
7d487fd2 | 14 | Source0: http://mirror.kolabsys.com/pub/releases/%{name}-%{version}.tar.gz |
9b3fc279 | 15 | # Source0-md5: eec4b8bf117a6e263eed9ee800ae3aa6 |
c866a2f0 | 16 | URL: http://www.kolab.org/ |
7d487fd2 | 17 | BuildRequires: QtCore-devel |
f0ba6589 | 18 | BuildRequires: boost-devel |
f0ba6589 | 19 | BuildRequires: cmake >= 2.6 |
7d487fd2 | 20 | BuildRequires: curl-devel |
f0ba6589 AM |
21 | BuildRequires: e2fsprogs-devel |
22 | BuildRequires: libstdc++-devel | |
7d487fd2 | 23 | BuildRequires: libuuid-devel |
7d487fd2 | 24 | BuildRequires: qt4-build |
390184bb | 25 | BuildRequires: rpmbuild(macros) >= 1.600 |
f0ba6589 | 26 | BuildRequires: swig |
f0ba6589 AM |
27 | BuildRequires: xerces-c-devel |
28 | BuildRequires: xsd | |
c866a2f0 ER |
29 | %if %{with python} |
30 | BuildRequires: python-devel | |
31 | BuildRequires: swig-python | |
32 | %endif | |
33 | %if %{with php} | |
2b9dc121 | 34 | BuildRequires: %{php_name}-cli |
46352b52 WF |
35 | %if %{with tests} |
36 | BuildRequires: %{php_name}-pcre | |
37 | %endif | |
bfe7ce4e | 38 | BuildRequires: %{php_name}-program |
c866a2f0 ER |
39 | BuildRequires: %{php_name}-devel |
40 | BuildRequires: swig-php | |
41 | %endif | |
7d487fd2 | 42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
f0ba6589 AM |
43 | |
44 | %description | |
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. | |
48 | ||
49 | %package devel | |
50 | Summary: Kolab XML library development headers | |
51 | Group: Development/Libraries | |
7d487fd2 AM |
52 | Requires: %{name} = %{version}-%{release} |
53 | Requires: QtCore-devel | |
f0ba6589 | 54 | Requires: boost-devel |
f0ba6589 | 55 | Requires: cmake >= 2.6 |
7d487fd2 | 56 | Requires: curl-devel |
f0ba6589 AM |
57 | Requires: e2fsprogs-devel |
58 | Requires: libstdc++-devel | |
7d487fd2 | 59 | Requires: libuuid-devel |
f0ba6589 | 60 | Requires: swig |
f0ba6589 AM |
61 | Requires: xerces-c-devel |
62 | Requires: xsd | |
63 | ||
f0ba6589 AM |
64 | %description devel |
65 | Development headers for the Kolab XML libraries. | |
66 | ||
82ea52bf | 67 | %package -n %{php_name}-kolabformat |
f0ba6589 | 68 | Summary: PHP bindings for libkolabxml |
390184bb | 69 | Group: Development/Languages/PHP |
7d487fd2 AM |
70 | Requires: %{name} = %{version}-%{release} |
71 | %{?requires_php_extension} | |
f0ba6589 | 72 | |
82ea52bf | 73 | %description -n %{php_name}-kolabformat |
f0ba6589 AM |
74 | The PHP kolabformat package offers a comprehensible PHP library using |
75 | the bindings provided through libkolabxml. | |
76 | ||
77 | %package -n python-kolabformat | |
78 | Summary: Python bindings for libkolabxml | |
79 | Group: Libraries | |
7d487fd2 | 80 | Requires: %{name} = %{version}-%{release} |
f0ba6589 AM |
81 | |
82 | %description -n python-kolabformat | |
83 | The PyKolab format package offers a comprehensive Python library using | |
84 | the bindings provided through libkolabxml. | |
85 | ||
86 | %prep | |
87 | %setup -q | |
f0ba6589 AM |
88 | |
89 | %build | |
7d487fd2 AM |
90 | install -d build |
91 | cd build | |
390184bb ER |
92 | %cmake \ |
93 | -Wno-fatal-errors -Wno-errors \ | |
f0ba6589 AM |
94 | -DCMAKE_SKIP_RPATH=ON \ |
95 | -DCMAKE_PREFIX_PATH=%{_libdir} \ | |
f0ba6589 | 96 | -DINCLUDE_INSTALL_DIR=%{_includedir}/kolabxml \ |
d8bd1264 | 97 | -DLIB_INSTALL_DIR:PATH=%{_libdir} \ |
c866a2f0 | 98 | %if %{with php} |
2b9dc121 | 99 | -DPHP_EXECUTABLE=%{__php} \ |
f0ba6589 | 100 | -DPHP_BINDINGS=ON \ |
7d487fd2 | 101 | -DPHP_INSTALL_DIR=%{php_extensiondir} \ |
c866a2f0 ER |
102 | %endif |
103 | %if %{with python} | |
f0ba6589 | 104 | -DPYTHON_BINDINGS=ON \ |
c866a2f0 | 105 | -DPYTHON_INCLUDE_DIRS=%{python_include} \ |
f0ba6589 | 106 | -DPYTHON_INSTALL_DIR=%{py_sitedir} \ |
c866a2f0 | 107 | %endif |
f0ba6589 AM |
108 | .. |
109 | %{__make} | |
7d487fd2 | 110 | cd .. |
f0ba6589 | 111 | |
7d487fd2 AM |
112 | %if %{with tests} |
113 | cd build | |
f0ba6589 | 114 | # Make sure libkolabxml.so.* is found, otherwise the tests fail |
390184bb | 115 | export LD_LIBRARY_PATH=$(pwd)/src |
7d487fd2 | 116 | cd tests |
82ea52bf AM |
117 | ./bindingstest |
118 | ./conversiontest | |
119 | ./parsingtest | |
c866a2f0 ER |
120 | cd .. |
121 | %if %{with php} | |
122 | cd src/php | |
82ea52bf | 123 | php -d 'enable_dl=On' '-dextension=../../src/php/kolabformat.so' test.php |
9b3fc279 | 124 | cd ../.. |
c866a2f0 ER |
125 | %endif |
126 | %if %{with python} | |
9b3fc279 | 127 | cd src/python |
82ea52bf AM |
128 | # FIXME |
129 | %{__python} test.py || | |
9b3fc279 | 130 | cd ../.. |
c866a2f0 | 131 | %endif |
7d487fd2 AM |
132 | %endif |
133 | ||
134 | %install | |
135 | rm -rf $RPM_BUILD_ROOT | |
7d487fd2 | 136 | %{__make} -C build install \ |
390184bb ER |
137 | INSTALL='install -p' \ |
138 | DESTDIR=$RPM_BUILD_ROOT | |
7d487fd2 | 139 | |
c866a2f0 ER |
140 | %if %{with php} |
141 | install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_data_dir}} | |
390184bb | 142 | mv $RPM_BUILD_ROOT%{php_extensiondir}/kolabformat.php $RPM_BUILD_ROOT%{php_data_dir}/kolabformat.php |
c866a2f0 | 143 | cat > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/kolabformat.ini <<EOF |
05d503b6 | 144 | ; Enable kolabformat extension module |
7d487fd2 AM |
145 | extension=kolabformat.so |
146 | EOF | |
c866a2f0 | 147 | %endif |
f0ba6589 | 148 | |
c866a2f0 | 149 | %if %{with python} |
05d503b6 ER |
150 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} |
151 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
152 | %py_postclean | |
c866a2f0 | 153 | %endif |
05d503b6 | 154 | |
f0ba6589 AM |
155 | %clean |
156 | rm -rf $RPM_BUILD_ROOT | |
157 | ||
05d503b6 ER |
158 | %post -p /sbin/ldconfig |
159 | %postun -p /sbin/ldconfig | |
f0ba6589 AM |
160 | |
161 | %files | |
162 | %defattr(644,root,root,755) | |
163 | %doc DEVELOPMENT NEWS README | |
7d487fd2 | 164 | %attr(755,root,root) %{_libdir}/libkolabxml.so.*.* |
37d8e7e0 | 165 | %attr(755,root,root) %ghost %{_libdir}/libkolabxml.so.1 |
f0ba6589 AM |
166 | |
167 | %files devel | |
168 | %defattr(644,root,root,755) | |
169 | %{_includedir}/kolabxml | |
c866a2f0 | 170 | %{_libdir}/libkolabxml.so |
f0ba6589 AM |
171 | %{_libdir}/cmake/Libkolabxml |
172 | ||
c866a2f0 | 173 | %if %{with php} |
82ea52bf | 174 | %files -n %{php_name}-kolabformat |
f0ba6589 | 175 | %defattr(644,root,root,755) |
c866a2f0 | 176 | %config(noreplace) %{php_sysconfdir}/conf.d/kolabformat.ini |
05d503b6 | 177 | %attr(755,root,root) %{php_extensiondir}/kolabformat.so |
390184bb | 178 | %{php_data_dir}/kolabformat.php |
c866a2f0 | 179 | %endif |
f0ba6589 | 180 | |
c866a2f0 | 181 | %if %{with python} |
f0ba6589 AM |
182 | %files -n python-kolabformat |
183 | %defattr(644,root,root,755) | |
05d503b6 | 184 | %attr(755,root,root) %{py_sitedir}/_kolabformat.so |
390184bb | 185 | %{py_sitedir}/kolabformat.py[co] |
c866a2f0 | 186 | %endif |