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