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