]>
Commit | Line | Data |
---|---|---|
390184bb ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
a5386bad AM |
4 | # |
5 | %define min_php 4:5.3 | |
f0ba6589 AM |
6 | Summary: Kolab XML format collection parser library |
7 | Name: libkolabxml | |
37d8e7e0 | 8 | Version: 1.0.1 |
a5386bad | 9 | Release: 5 |
390184bb | 10 | License: LGPL v3+ |
f0ba6589 | 11 | Group: Libraries |
390184bb | 12 | URL: http://www.kolab.org/ |
7d487fd2 | 13 | Source0: http://mirror.kolabsys.com/pub/releases/%{name}-%{version}.tar.gz |
37d8e7e0 | 14 | # Source0-md5: 7adccfa0ed91ac954c815e8d13f334ee |
7d487fd2 | 15 | BuildRequires: QtCore-devel |
f0ba6589 | 16 | BuildRequires: boost-devel |
f0ba6589 | 17 | BuildRequires: cmake >= 2.6 |
7d487fd2 | 18 | BuildRequires: curl-devel |
f0ba6589 | 19 | BuildRequires: e2fsprogs-devel |
7d487fd2 AM |
20 | BuildRequires: kde4-kdelibs-devel |
21 | BuildRequires: kde4-kdepimlibs-devel | |
f0ba6589 | 22 | BuildRequires: libstdc++-devel |
7d487fd2 | 23 | BuildRequires: libuuid-devel |
a5386bad AM |
24 | #BuildRequires: %{php_name}-devel >= %{min_php} |
25 | BuildRequires: %{php_name}-devel | |
f0ba6589 | 26 | BuildRequires: python-devel |
7d487fd2 | 27 | BuildRequires: qt4-build |
390184bb | 28 | BuildRequires: rpmbuild(macros) >= 1.600 |
f0ba6589 | 29 | BuildRequires: swig |
7d487fd2 | 30 | BuildRequires: swig-php |
37d8e7e0 | 31 | BuildRequires: swig-python |
f0ba6589 AM |
32 | BuildRequires: xerces-c-devel |
33 | BuildRequires: xsd | |
7d487fd2 | 34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
f0ba6589 AM |
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 | |
7d487fd2 AM |
44 | Requires: %{name} = %{version}-%{release} |
45 | Requires: QtCore-devel | |
f0ba6589 | 46 | Requires: boost-devel |
f0ba6589 | 47 | Requires: cmake >= 2.6 |
7d487fd2 | 48 | Requires: curl-devel |
f0ba6589 | 49 | Requires: e2fsprogs-devel |
7d487fd2 AM |
50 | Requires: kde4-kdelibs-devel |
51 | Requires: kde4-kdepimlibs-devel | |
f0ba6589 | 52 | Requires: libstdc++-devel |
7d487fd2 | 53 | Requires: libuuid-devel |
a5386bad AM |
54 | #Requires: %{php_name}-devel >= %{min_php} |
55 | Requires: %{php_name}-devel | |
f0ba6589 | 56 | Requires: python-devel |
f0ba6589 | 57 | Requires: swig |
f0ba6589 AM |
58 | Requires: xerces-c-devel |
59 | Requires: xsd | |
60 | ||
f0ba6589 AM |
61 | %description devel |
62 | Development headers for the Kolab XML libraries. | |
63 | ||
82ea52bf | 64 | %package -n %{php_name}-kolabformat |
f0ba6589 | 65 | Summary: PHP bindings for libkolabxml |
390184bb | 66 | Group: Development/Languages/PHP |
7d487fd2 AM |
67 | Requires: %{name} = %{version}-%{release} |
68 | %{?requires_php_extension} | |
f0ba6589 | 69 | |
82ea52bf | 70 | %description -n %{php_name}-kolabformat |
f0ba6589 AM |
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 | |
7d487fd2 | 77 | Requires: %{name} = %{version}-%{release} |
f0ba6589 AM |
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 | |
f0ba6589 AM |
85 | |
86 | %build | |
7d487fd2 AM |
87 | install -d build |
88 | cd build | |
390184bb ER |
89 | %cmake \ |
90 | -Wno-fatal-errors -Wno-errors \ | |
37d8e7e0 | 91 | -DPHP_EXECUTABLE=%{_bindir}/php \ |
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} \ |
f0ba6589 AM |
96 | -DPYTHON_INCLUDE_DIRS=%{python_include} \ |
97 | -DPHP_BINDINGS=ON \ | |
7d487fd2 | 98 | -DPHP_INSTALL_DIR=%{php_extensiondir} \ |
f0ba6589 AM |
99 | -DPYTHON_BINDINGS=ON \ |
100 | -DPYTHON_INSTALL_DIR=%{py_sitedir} \ | |
101 | .. | |
102 | %{__make} | |
7d487fd2 | 103 | cd .. |
f0ba6589 | 104 | |
7d487fd2 AM |
105 | %if %{with tests} |
106 | cd build | |
f0ba6589 | 107 | # Make sure libkolabxml.so.* is found, otherwise the tests fail |
390184bb | 108 | export LD_LIBRARY_PATH=$(pwd)/src |
7d487fd2 | 109 | cd tests |
82ea52bf AM |
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 || | |
7d487fd2 AM |
118 | %endif |
119 | ||
120 | %install | |
121 | rm -rf $RPM_BUILD_ROOT | |
7d487fd2 | 122 | %{__make} -C build install \ |
390184bb ER |
123 | INSTALL='install -p' \ |
124 | DESTDIR=$RPM_BUILD_ROOT | |
7d487fd2 | 125 | |
390184bb ER |
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 | |
7d487fd2 | 128 | |
390184bb ER |
129 | install -d $RPM_BUILD_ROOT%{php_sysconfdir} |
130 | cat > $RPM_BUILD_ROOT%{php_sysconfdir}/kolabformat.ini <<EOF | |
05d503b6 | 131 | ; Enable kolabformat extension module |
7d487fd2 AM |
132 | extension=kolabformat.so |
133 | EOF | |
f0ba6589 | 134 | |
05d503b6 ER |
135 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} |
136 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
137 | %py_postclean | |
138 | ||
f0ba6589 AM |
139 | %clean |
140 | rm -rf $RPM_BUILD_ROOT | |
141 | ||
05d503b6 ER |
142 | %post -p /sbin/ldconfig |
143 | %postun -p /sbin/ldconfig | |
f0ba6589 AM |
144 | |
145 | %files | |
146 | %defattr(644,root,root,755) | |
147 | %doc DEVELOPMENT NEWS README | |
7d487fd2 | 148 | %attr(755,root,root) %{_libdir}/libkolabxml.so.*.* |
37d8e7e0 | 149 | %attr(755,root,root) %ghost %{_libdir}/libkolabxml.so.1 |
f0ba6589 AM |
150 | |
151 | %files devel | |
152 | %defattr(644,root,root,755) | |
153 | %{_includedir}/kolabxml | |
154 | %{_libdir}/*.so | |
155 | %{_libdir}/cmake/Libkolabxml | |
156 | ||
82ea52bf | 157 | %files -n %{php_name}-kolabformat |
f0ba6589 | 158 | %defattr(644,root,root,755) |
7d487fd2 | 159 | %config(noreplace) %{php_sysconfdir}/kolabformat.ini |
05d503b6 | 160 | %attr(755,root,root) %{php_extensiondir}/kolabformat.so |
390184bb | 161 | %{php_data_dir}/kolabformat.php |
f0ba6589 AM |
162 | |
163 | %files -n python-kolabformat | |
164 | %defattr(644,root,root,755) | |
05d503b6 | 165 | %attr(755,root,root) %{py_sitedir}/_kolabformat.so |
390184bb | 166 | %{py_sitedir}/kolabformat.py[co] |