]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | # | |
5 | %define min_php 4:5.3 | |
6 | Summary: Kolab XML format collection parser library | |
7 | Name: libkolabxml | |
8 | Version: 1.0.1 | |
9 | Release: 5 | |
10 | License: LGPL v3+ | |
11 | Group: Libraries | |
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 | |
29 | BuildRequires: swig | |
30 | BuildRequires: swig-php | |
31 | BuildRequires: swig-python | |
32 | BuildRequires: xerces-c-devel | |
33 | BuildRequires: xsd | |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
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. | |
40 | ||
41 | %package devel | |
42 | Summary: Kolab XML library development headers | |
43 | Group: Development/Libraries | |
44 | Requires: %{name} = %{version}-%{release} | |
45 | Requires: QtCore-devel | |
46 | Requires: boost-devel | |
47 | Requires: cmake >= 2.6 | |
48 | Requires: curl-devel | |
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 | |
57 | Requires: swig | |
58 | Requires: xerces-c-devel | |
59 | Requires: xsd | |
60 | ||
61 | %description devel | |
62 | Development headers for the Kolab XML libraries. | |
63 | ||
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} | |
69 | ||
70 | %description -n %{php_name}-kolabformat | |
71 | The PHP kolabformat package offers a comprehensible PHP library using | |
72 | the bindings provided through libkolabxml. | |
73 | ||
74 | %package -n python-kolabformat | |
75 | Summary: Python bindings for libkolabxml | |
76 | Group: Libraries | |
77 | Requires: %{name} = %{version}-%{release} | |
78 | ||
79 | %description -n python-kolabformat | |
80 | The PyKolab format package offers a comprehensive Python library using | |
81 | the bindings provided through libkolabxml. | |
82 | ||
83 | %prep | |
84 | %setup -q | |
85 | ||
86 | %build | |
87 | install -d build | |
88 | cd build | |
89 | %cmake \ | |
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} \ | |
97 | -DPHP_BINDINGS=ON \ | |
98 | -DPHP_INSTALL_DIR=%{php_extensiondir} \ | |
99 | -DPYTHON_BINDINGS=ON \ | |
100 | -DPYTHON_INSTALL_DIR=%{py_sitedir} \ | |
101 | .. | |
102 | %{__make} | |
103 | cd .. | |
104 | ||
105 | %if %{with tests} | |
106 | cd build | |
107 | # Make sure libkolabxml.so.* is found, otherwise the tests fail | |
108 | export LD_LIBRARY_PATH=$(pwd)/src | |
109 | cd tests | |
110 | ./bindingstest | |
111 | ./conversiontest | |
112 | ./parsingtest | |
113 | cd ../src/php | |
114 | php -d 'enable_dl=On' '-dextension=../../src/php/kolabformat.so' test.php | |
115 | cd ../python | |
116 | # FIXME | |
117 | %{__python} test.py || | |
118 | %endif | |
119 | ||
120 | %install | |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | %{__make} -C build install \ | |
123 | INSTALL='install -p' \ | |
124 | DESTDIR=$RPM_BUILD_ROOT | |
125 | ||
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 | |
128 | ||
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 | |
133 | EOF | |
134 | ||
135 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
136 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
137 | %py_postclean | |
138 | ||
139 | %clean | |
140 | rm -rf $RPM_BUILD_ROOT | |
141 | ||
142 | %post -p /sbin/ldconfig | |
143 | %postun -p /sbin/ldconfig | |
144 | ||
145 | %files | |
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 | |
150 | ||
151 | %files devel | |
152 | %defattr(644,root,root,755) | |
153 | %{_includedir}/kolabxml | |
154 | %{_libdir}/*.so | |
155 | %{_libdir}/cmake/Libkolabxml | |
156 | ||
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 | |
162 | ||
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] |