[packages/libkolab] add php, python bconds; drop pointless deps from -devel

glen glen at pld-linux.org
Fri May 30 08:49:02 CEST 2014


commit dee9c39109605fafcfe97496623bcbb79be158ff
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri May 30 09:48:44 2014 +0300

    add php, python bconds; drop pointless deps from -devel

 libkolab.spec | 44 ++++++++++++++++++++++++++++++--------------
 1 file changed, 30 insertions(+), 14 deletions(-)
---
diff --git a/libkolab.spec b/libkolab.spec
index 9167b02..e73fcd3 100644
--- a/libkolab.spec
+++ b/libkolab.spec
@@ -1,27 +1,36 @@
 #
 # Conditional build:
 %bcond_without	tests		# build without tests
+%bcond_without	php		# PHP bindings
+%bcond_without	python		# Python bindings
 
+%define		php_name	php55
 Summary:	Kolab Object Handling Library
 Name:		libkolab
 Version:	0.5.0
 Release:	2
 License:	LGPL v3+
 Group:		Libraries
-URL:		http://git.kolab.org/libkolab
 Source0:	http://mirror.kolabsys.com/pub/releases/%{name}-%{version}.tar.gz
 # Source0-md5:	38da4b0918e8585ab935ae02bc321aa0
+URL:		http://git.kolab.org/libkolab
 BuildRequires:	QtCore-devel
 BuildRequires:	curl-devel
 BuildRequires:	kde4-kdepimlibs-devel >= 4.8
 BuildRequires:	libkolabxml-devel >= 1.0
-BuildRequires:	%{php_name}-devel
-BuildRequires:	python-devel
 BuildRequires:	qt4-build
 BuildRequires:	rpmbuild(macros) >= 1.600
 BuildRequires:	swig
+%if %{with php}
+BuildRequires:	%{php_name}-devel
+BuildRequires:	%{php_name}-cli
+BuildRequires:	%{php_name}-program
 BuildRequires:	swig-php
+%endif
+%if %{with python}
+BuildRequires:	python-devel
 BuildRequires:	swig-python
+%endif
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -32,9 +41,6 @@ Summary:	Kolab library development headers
 Group:		Development/Languages/PHP
 Requires:	%{name} = %{version}-%{release}
 Requires:	libkolabxml-devel >= 1.0
-Requires:	%{php_name}-devel
-Requires:	pkgconfig
-Requires:	python-devel
 
 %description devel
 Development headers for the Kolab object libraries.
@@ -60,24 +66,26 @@ Python bindings for libkolab.
 %setup -q
 
 %build
-rm -rf build
 install -d build
 cd build
 %cmake \
 	-Wno-fatal-errors -Wno-errors \
-	-DPHP_EXECUTABLE=%{_bindir}/php \
 	-DINCLUDE_INSTALL_DIR=%{_includedir} \
+	-DLIB_INSTALL_DIR=%{_libdir} \
+%if %{with php}
 	-DPHP_BINDINGS=ON \
 	-DPHP_INSTALL_DIR=%{php_extensiondir} \
+	-DPHP_EXECUTABLE=%{__php} \
+%endif
+%if %{with python}
 	-DPYTHON_BINDINGS=ON \
 	-DPYTHON_INSTALL_DIR=%{py_sitedir} \
-	-DLIB_INSTALL_DIR=%{_libdir} \
+%endif
 	..
 %{__make}
-cd -
 
 %if %{with tests}
-cd build/tests
+cd tests
 ./benchmarktest || :
 ./calendaringtest || :
 ./formattest || :
@@ -92,12 +100,16 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} -C build install \
 	DESTDIR=$RPM_BUILD_ROOT
 
+%if %{with php}
 install -d $RPM_BUILD_ROOT%{php_data_dir}
 mv $RPM_BUILD_ROOT{%{php_extensiondir}/*.php,%{php_data_dir}}
+%endif
 
+%if %{with python}
 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
 %py_postclean
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -116,6 +128,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/cmake/Libkolab
 %{_includedir}/kolab
 
+%if %{with php}
 %files -n %{php_name}-kolab
 %defattr(644,root,root,755)
 %attr(755,root,root) %{php_extensiondir}/kolabcalendaring.so
@@ -126,15 +139,18 @@ rm -rf $RPM_BUILD_ROOT
 %{php_data_dir}/kolabicalendar.php
 %{php_data_dir}/kolabobject.php
 %{php_data_dir}/kolabshared.php
+%endif
 
+%if %{with python}
 %files -n python-kolab
 %defattr(644,root,root,755)
 %dir %{py_sitedir}/kolab
 %attr(755,root,root) %{py_sitedir}/kolab/_calendaring.so
-%{py_sitedir}/kolab/calendaring.py[co]
 %attr(755,root,root) %{py_sitedir}/kolab/_icalendar.so
-%{py_sitedir}/kolab/icalendar.py[co]
 %attr(755,root,root) %{py_sitedir}/kolab/_kolabobject.so
-%{py_sitedir}/kolab/kolabobject.py[co]
 %attr(755,root,root) %{py_sitedir}/kolab/_shared.so
+%{py_sitedir}/kolab/calendaring.py[co]
+%{py_sitedir}/kolab/icalendar.py[co]
+%{py_sitedir}/kolab/kolabobject.py[co]
 %{py_sitedir}/kolab/shared.py[co]
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libkolab.git/commitdiff/dee9c39109605fafcfe97496623bcbb79be158ff



More information about the pld-cvs-commit mailing list