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