]> git.pld-linux.org Git - packages/libkolab.git/blob - libkolab.spec
894e63df2c6683398da534a64aeefffbaf53f6af
[packages/libkolab.git] / libkolab.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 Object Handling Library
9 Name:           libkolab
10 Version:        0.5.2
11 Release:        3
12 License:        LGPL v3+
13 Group:          Libraries
14 Source0:        http://mirror.kolabsys.com/pub/releases/%{name}-%{version}.tar.gz
15 # Source0-md5:  f33fcdc6852b9d045cb2be98ef3907ed
16 URL:            http://git.kolab.org/libkolab
17 BuildRequires:  QtCore-devel
18 BuildRequires:  curl-devel
19 BuildRequires:  kde4-kdepimlibs-devel >= 4.8
20 BuildRequires:  libkolabxml-devel >= 1.0
21 BuildRequires:  qt4-build
22 BuildRequires:  rpmbuild(macros) >= 1.600
23 BuildRequires:  swig
24 %if %{with php}
25 BuildRequires:  %{php_name}-devel
26 BuildRequires:  %{php_name}-cli
27 BuildRequires:  %{php_name}-program
28 BuildRequires:  swig-php
29 %endif
30 %if %{with python}
31 BuildRequires:  python-devel
32 BuildRequires:  swig-python
33 %endif
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %description
37 The libkolab library is an advanced library to handle Kolab objects.
38
39 %package devel
40 Summary:        Kolab library development headers
41 Group:          Development/Languages/PHP
42 Requires:       %{name} = %{version}-%{release}
43 Requires:       libkolabxml-devel >= 1.0
44
45 %description devel
46 Development headers for the Kolab object libraries.
47
48 %package -n %{php_name}-kolab
49 Summary:        PHP Bindings for libkolab
50 Group:          Libraries
51 Requires:       %{name} = %{version}-%{release}
52 %{?requires_php_extension}
53
54 %description -n %{php_name}-kolab
55 PHP Bindings for libkolab.
56
57 %package -n python-kolab
58 Summary:        Python bindings for libkolab
59 Group:          Libraries
60 Requires:       %{name} = %{version}-%{release}
61
62 %description -n python-kolab
63 Python bindings for libkolab.
64
65 %prep
66 %setup -q
67
68 %build
69 install -d build
70 cd build
71 %cmake \
72         -Wno-fatal-errors -Wno-errors \
73         -DINCLUDE_INSTALL_DIR=%{_includedir} \
74         -DLIB_INSTALL_DIR=%{_libdir} \
75 %if %{with php}
76         -DPHP_BINDINGS=ON \
77         -DPHP_INSTALL_DIR=%{php_extensiondir} \
78         -DPHP_EXECUTABLE=%{__php} \
79 %endif
80 %if %{with python}
81         -DPYTHON_BINDINGS=ON \
82         -DPYTHON_INSTALL_DIR=%{py_sitedir} \
83 %endif
84         ..
85 %{__make}
86
87 %if %{with tests}
88 cd tests
89 ./benchmarktest || :
90 ./calendaringtest || :
91 ./formattest || :
92 ./freebusytest || :
93 ./icalendartest || :
94 ./kcalconversiontest || :
95 ./upgradetest || :
96 %endif
97
98 %install
99 rm -rf $RPM_BUILD_ROOT
100 %{__make} -C build install \
101         DESTDIR=$RPM_BUILD_ROOT
102
103 %if %{with php}
104 install -d $RPM_BUILD_ROOT%{php_data_dir}
105 mv $RPM_BUILD_ROOT{%{php_extensiondir}/*.php,%{php_data_dir}}
106 %endif
107
108 %if %{with python}
109 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
110 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
111 %py_postclean
112 %endif
113
114 %clean
115 rm -rf $RPM_BUILD_ROOT
116
117 %post   -p /sbin/ldconfig
118 %postun -p /sbin/ldconfig
119
120 %files
121 %defattr(644,root,root,755)
122 %attr(755,root,root) %{_libdir}/%{name}.so.*.*
123 %attr(755,root,root) %ghost %{_libdir}/%{name}.so.0
124
125 %files devel
126 %defattr(644,root,root,755)
127 %attr(755,root,root) %{_libdir}/%{name}.so
128 %{_libdir}/cmake/Libkolab
129 %{_includedir}/kolab
130
131 %if %{with php}
132 %files -n %{php_name}-kolab
133 %defattr(644,root,root,755)
134 %attr(755,root,root) %{php_extensiondir}/kolabcalendaring.so
135 %attr(755,root,root) %{php_extensiondir}/kolabicalendar.so
136 %attr(755,root,root) %{php_extensiondir}/kolabobject.so
137 %attr(755,root,root) %{php_extensiondir}/kolabshared.so
138 %{php_data_dir}/kolabcalendaring.php
139 %{php_data_dir}/kolabicalendar.php
140 %{php_data_dir}/kolabobject.php
141 %{php_data_dir}/kolabshared.php
142 %endif
143
144 %if %{with python}
145 %files -n python-kolab
146 %defattr(644,root,root,755)
147 %dir %{py_sitedir}/kolab
148 %attr(755,root,root) %{py_sitedir}/kolab/_calendaring.so
149 %attr(755,root,root) %{py_sitedir}/kolab/_icalendar.so
150 %attr(755,root,root) %{py_sitedir}/kolab/_kolabobject.so
151 %attr(755,root,root) %{py_sitedir}/kolab/_shared.so
152 %{py_sitedir}/kolab/calendaring.py[co]
153 %{py_sitedir}/kolab/icalendar.py[co]
154 %{py_sitedir}/kolab/kolabobject.py[co]
155 %{py_sitedir}/kolab/shared.py[co]
156 %endif
This page took 0.088076 seconds and 2 git commands to generate.