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