[packages/swig] - allow building with python 2.x, 3.x, both or none

hawk hawk at pld-linux.org
Tue Apr 5 17:35:25 CEST 2022


commit 1fddf32ae5312bbc34f8af1fdda6fe482bcac89a
Author: Marcin Krol <hawk at tld-linux.org>
Date:   Tue Apr 5 15:35:00 2022 +0000

    - allow building with python 2.x, 3.x, both or none

 swig.spec | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/swig.spec b/swig.spec
index 334e93a..37e351e 100644
--- a/swig.spec
+++ b/swig.spec
@@ -3,6 +3,8 @@
 %bcond_without	guile	# disable guile support
 %bcond_without	perl	# disable perl support
 %bcond_without	php	# disable php support
+%bcond_without	python2	# disable python 2.x support
+%bcond_without	python3	# disable python 3.x support
 %bcond_without	ruby	# disable ruby support
 %bcond_without	tcl	# disable tcl support
 #
@@ -15,7 +17,7 @@ Summary(pl.UTF-8):	Generator interfejsów do Perla, Tcl-a, Guile'a i Pythona
 Summary(pt_BR.UTF-8):	Gerador de Interfaces e "Wrappers" Simplificado (SWIG)
 Name:		swig
 Version:	4.0.2
-Release:	1
+Release:	2
 License:	GPL v3+ (utility), free (library)
 Group:		Development/Languages
 Source0:	https://downloads.sourceforge.net/swig/%{name}-%{version}.tar.gz
@@ -34,10 +36,14 @@ BuildRequires:	pcre-devel
 %{?with_perl:BuildRequires:	perl-devel >= 1:5.6.1}
 %{?with_php:BuildRequires:	%{php_name}-cli}
 %{?with_php:BuildRequires:	%{php_name}-devel >= 4.1.0}
+%if %{with python2}
 BuildRequires:	python-devel >= 1:2.3.2
 BuildRequires:	python-modules
+%endif
+%if %{with python2}
 BuildRequires:	python3-devel
 BuildRequires:	python3-modules
+%endif
 BuildRequires:	rpm-pythonprov
 %if %{with ruby}
 BuildRequires:	rpmbuild(macros) >= 1.277
@@ -172,7 +178,9 @@ Moduł SWIG do generowania wiązań języka Tcl.
 %{__aclocal} -I Tools/config
 %{__autoconf}
 %{__automake}
-%configure
+%configure \
+	%{!?with_python2:--without-python} \
+	%{!?with_python3:--without-python3}
 
 %{__make} \
 	OPT="%{rpmcflags}"
@@ -238,9 +246,11 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/%{name}/%{version}/php
 %endif
 
+%if %{with python2} || %{with python3}
 %files python
 %defattr(644,root,root,755)
 %{_datadir}/%{name}/%{version}/python
+%endif
 
 %if %{with ruby}
 %files ruby
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/swig.git/commitdiff/1fddf32ae5312bbc34f8af1fdda6fe482bcac89a



More information about the pld-cvs-commit mailing list