[libvirt] [PATCH python 2/7] Allow override of which sub-RPMs to build

Daniel P. Berrange posted 7 patches 7 years, 4 months ago
[libvirt] [PATCH python 2/7] Allow override of which sub-RPMs to build
Posted by Daniel P. Berrange 7 years, 4 months ago
Allow using

  rpmbuild --define "with_python2 0"

to override the default logic about which python sub-RPMs to build

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 libvirt-python.spec.in | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in
index 5bbebeb..1619e26 100644
--- a/libvirt-python.spec.in
+++ b/libvirt-python.spec.in
@@ -1,10 +1,13 @@
 
-%define with_python2 1
-%define with_python3 0
+%define _with_python2 1
+%define _with_python3 0
 %if 0%{?fedora}
-%define with_python3 1
+%define _with_python3 1
 %endif
 
+%{!?with_python2: %define with_python2 %{_with_python2}}
+%{!?with_python3: %define with_python3 %{_with_python3}}
+
 Summary: The libvirt virtualization API python2 binding
 Name: libvirt-python
 Version: @PY_VERSION@
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH python 2/7] Allow override of which sub-RPMs to build
Posted by Pavel Hrdina 7 years, 4 months ago
On Thu, Jan 11, 2018 at 04:43:34PM +0000, Daniel P. Berrange wrote:
> Allow using
> 
>   rpmbuild --define "with_python2 0"
> 
> to override the default logic about which python sub-RPMs to build
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  libvirt-python.spec.in | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list