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