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