]>
Commit | Line | Data |
---|---|---|
e431bf77 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
dee9c391 ER |
4 | %bcond_without php # PHP bindings |
5 | %bcond_without python # Python bindings | |
e431bf77 | 6 | |
dee9c391 | 7 | %define php_name php55 |
7e633058 AM |
8 | Summary: Kolab Object Handling Library |
9 | Name: libkolab | |
bb97818a | 10 | Version: 0.6.0 |
4ea774f7 | 11 | Release: 8 |
6b014dfe | 12 | License: LGPL v3+ |
96842dd9 | 13 | Group: Libraries |
96842dd9 | 14 | Source0: http://mirror.kolabsys.com/pub/releases/%{name}-%{version}.tar.gz |
bb97818a WF |
15 | # Source0-md5: 3c4fc1fec2dfcc0841f29de8f6ff0cd3 |
16 | Patch0: 0002-Make-libkolab-compile-with-upstream-kdepimlibs.patch | |
dee9c391 | 17 | URL: http://git.kolab.org/libkolab |
039e7839 | 18 | BuildRequires: QtCore-devel |
7e633058 | 19 | BuildRequires: curl-devel |
6b014dfe | 20 | BuildRequires: kde4-kdepimlibs-devel >= 4.8 |
bb97818a | 21 | BuildRequires: libkolabxml-devel >= 1.1 |
039e7839 | 22 | BuildRequires: qt4-build |
e431bf77 | 23 | BuildRequires: rpmbuild(macros) >= 1.600 |
039e7839 | 24 | BuildRequires: swig |
dee9c391 ER |
25 | %if %{with php} |
26 | BuildRequires: %{php_name}-devel | |
27 | BuildRequires: %{php_name}-cli | |
bb97818a WF |
28 | %if %{with tests} |
29 | BuildRequires: %{php_name}-pcre | |
30 | %endif | |
dee9c391 | 31 | BuildRequires: %{php_name}-program |
039e7839 | 32 | BuildRequires: swig-php |
dee9c391 ER |
33 | %endif |
34 | %if %{with python} | |
35 | BuildRequires: python-devel | |
fdb8064d | 36 | BuildRequires: swig-python |
dee9c391 | 37 | %endif |
6b014dfe | 38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
7e633058 AM |
39 | |
40 | %description | |
41 | The libkolab library is an advanced library to handle Kolab objects. | |
42 | ||
43 | %package devel | |
44 | Summary: Kolab library development headers | |
e431bf77 | 45 | Group: Development/Languages/PHP |
7e633058 | 46 | Requires: %{name} = %{version}-%{release} |
fdb8064d | 47 | Requires: libkolabxml-devel >= 1.0 |
7e633058 AM |
48 | |
49 | %description devel | |
50 | Development headers for the Kolab object libraries. | |
51 | ||
acd36a01 | 52 | %package -n %{php_name}-kolab |
7e633058 AM |
53 | Summary: PHP Bindings for libkolab |
54 | Group: Libraries | |
55 | Requires: %{name} = %{version}-%{release} | |
badad8dd | 56 | %{?requires_php_extension} |
7e633058 | 57 | |
acd36a01 | 58 | %description -n %{php_name}-kolab |
badad8dd | 59 | PHP Bindings for libkolab. |
7e633058 AM |
60 | |
61 | %package -n python-kolab | |
62 | Summary: Python bindings for libkolab | |
63 | Group: Libraries | |
64 | Requires: %{name} = %{version}-%{release} | |
65 | ||
66 | %description -n python-kolab | |
badad8dd | 67 | Python bindings for libkolab. |
7e633058 AM |
68 | |
69 | %prep | |
70 | %setup -q | |
bb97818a | 71 | %patch0 -p1 |
7e633058 AM |
72 | |
73 | %build | |
6b014dfe ER |
74 | install -d build |
75 | cd build | |
76 | %cmake \ | |
77 | -Wno-fatal-errors -Wno-errors \ | |
7e633058 | 78 | -DINCLUDE_INSTALL_DIR=%{_includedir} \ |
dee9c391 ER |
79 | -DLIB_INSTALL_DIR=%{_libdir} \ |
80 | %if %{with php} | |
7e633058 | 81 | -DPHP_BINDINGS=ON \ |
badad8dd | 82 | -DPHP_INSTALL_DIR=%{php_extensiondir} \ |
dee9c391 ER |
83 | -DPHP_EXECUTABLE=%{__php} \ |
84 | %endif | |
85 | %if %{with python} | |
7e633058 AM |
86 | -DPYTHON_BINDINGS=ON \ |
87 | -DPYTHON_INSTALL_DIR=%{py_sitedir} \ | |
dee9c391 | 88 | %endif |
7e633058 AM |
89 | .. |
90 | %{__make} | |
7e633058 | 91 | |
039e7839 | 92 | %if %{with tests} |
dee9c391 | 93 | cd tests |
7e633058 AM |
94 | ./benchmarktest || : |
95 | ./calendaringtest || : | |
96 | ./formattest || : | |
97 | ./freebusytest || : | |
98 | ./icalendartest || : | |
99 | ./kcalconversiontest || : | |
100 | ./upgradetest || : | |
039e7839 AM |
101 | %endif |
102 | ||
103 | %install | |
104 | rm -rf $RPM_BUILD_ROOT | |
039e7839 AM |
105 | %{__make} -C build install \ |
106 | DESTDIR=$RPM_BUILD_ROOT | |
107 | ||
dee9c391 | 108 | %if %{with php} |
039e7839 AM |
109 | install -d $RPM_BUILD_ROOT%{php_data_dir} |
110 | mv $RPM_BUILD_ROOT{%{php_extensiondir}/*.php,%{php_data_dir}} | |
dee9c391 | 111 | %endif |
7e633058 | 112 | |
dee9c391 | 113 | %if %{with python} |
0673c669 ER |
114 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} |
115 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
116 | %py_postclean | |
dee9c391 | 117 | %endif |
0673c669 | 118 | |
7e633058 AM |
119 | %clean |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | ||
6b014dfe ER |
122 | %post -p /sbin/ldconfig |
123 | %postun -p /sbin/ldconfig | |
7e633058 AM |
124 | |
125 | %files | |
126 | %defattr(644,root,root,755) | |
039e7839 | 127 | %attr(755,root,root) %{_libdir}/%{name}.so.*.* |
e431bf77 | 128 | %attr(755,root,root) %ghost %{_libdir}/%{name}.so.0 |
7e633058 AM |
129 | |
130 | %files devel | |
131 | %defattr(644,root,root,755) | |
039e7839 | 132 | %attr(755,root,root) %{_libdir}/%{name}.so |
7e633058 AM |
133 | %{_libdir}/cmake/Libkolab |
134 | %{_includedir}/kolab | |
135 | ||
dee9c391 | 136 | %if %{with php} |
acd36a01 | 137 | %files -n %{php_name}-kolab |
7e633058 | 138 | %defattr(644,root,root,755) |
039e7839 AM |
139 | %attr(755,root,root) %{php_extensiondir}/kolabcalendaring.so |
140 | %attr(755,root,root) %{php_extensiondir}/kolabicalendar.so | |
acd36a01 | 141 | %attr(755,root,root) %{php_extensiondir}/kolabobject.so |
039e7839 | 142 | %attr(755,root,root) %{php_extensiondir}/kolabshared.so |
e431bf77 ER |
143 | %{php_data_dir}/kolabcalendaring.php |
144 | %{php_data_dir}/kolabicalendar.php | |
acd36a01 | 145 | %{php_data_dir}/kolabobject.php |
e431bf77 | 146 | %{php_data_dir}/kolabshared.php |
dee9c391 | 147 | %endif |
7e633058 | 148 | |
dee9c391 | 149 | %if %{with python} |
7e633058 AM |
150 | %files -n python-kolab |
151 | %defattr(644,root,root,755) | |
039e7839 AM |
152 | %dir %{py_sitedir}/kolab |
153 | %attr(755,root,root) %{py_sitedir}/kolab/_calendaring.so | |
039e7839 | 154 | %attr(755,root,root) %{py_sitedir}/kolab/_icalendar.so |
acd36a01 | 155 | %attr(755,root,root) %{py_sitedir}/kolab/_kolabobject.so |
039e7839 | 156 | %attr(755,root,root) %{py_sitedir}/kolab/_shared.so |
dee9c391 ER |
157 | %{py_sitedir}/kolab/calendaring.py[co] |
158 | %{py_sitedir}/kolab/icalendar.py[co] | |
159 | %{py_sitedir}/kolab/kolabobject.py[co] | |
e431bf77 | 160 | %{py_sitedir}/kolab/shared.py[co] |
dee9c391 | 161 | %endif |