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