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