From 07e03fdaa0f0c5ab1f8b31c5c3cfb6e46df2ff22 Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Mon, 2 Apr 2018 17:41:16 -0400 Subject: [PATCH] Use %bcond_(with|without) to enable/disable python3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The with_python3 macro was added in 7ac1fbc ("Avoid python dependency in git-core (#1536471)", 2018-01-22) and followed the example from a devel list request¹. The %bcond_(with|without) macro allows enabling or disabling of python3 via the command line, modulemd file, etc. Use it. ¹ https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/UG6XYG3EPLMLA5N47AK63NCF2Y6MDWFJ/ --- git.spec | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/git.spec b/git.spec index 70faa18..a48ed73 100644 --- a/git.spec +++ b/git.spec @@ -12,9 +12,9 @@ # Settings for Fedora and EL > 7 %if 0%{?fedora} || 0%{?rhel} > 7 -%global with_python3 1 +%bcond_without python3 %else -%global with_python3 0 +%bcond_with python3 %endif # Settings for Fedora and EL >= 7 @@ -177,7 +177,7 @@ BuildRequires: perl(Memoize) BuildRequires: perl(Test::More) BuildRequires: perl(Time::HiRes) BuildRequires: python2-devel -%if 0%{?with_python3} +%if %{with python3} BuildRequires: python3-devel %endif BuildRequires: subversion @@ -487,7 +487,7 @@ sed -i -e '1s|#! */usr/bin/env python$|#!%{__python2}|' \ contrib/hooks/multimail/migrate-mailhook-config \ contrib/hooks/multimail/post-receive.example \ contrib/svn-fe/svnrdump_sim.py -%if 0%{?with_python3} +%if %{with python3} sed -i -e '1s|#!%{__python2}$|#!%{__python3}|' \ contrib/hooks/multimail/git_multimail.py \ contrib/hooks/multimail/migrate-mailhook-config \ @@ -867,6 +867,7 @@ make test || ./print-failed-test-output %changelog * Mon Apr 02 2018 Todd Zullinger - Allow git-p4 subpackage to be toggled via --with/--without +- Use %%bcond_(with|without) to enable/disable python3 * Mon Apr 02 2018 Todd Zullinger - 2.17.0-1 - Update to 2.17.0