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