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