From 2087dc738492136d97d006aeb299746c4735c48b Mon Sep 17 00:00:00 2001 From: fantashley Date: Mon, 16 Oct 2017 08:19:53 -0500 Subject: [PATCH] Make RPM spec compatible with RHEL 6 (#31653) * Make RPM spec compatible with RHEL 6 * Define __python2 macro only when undefined --- packaging/rpm/ansible.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packaging/rpm/ansible.spec b/packaging/rpm/ansible.spec index 76dd3ff55ec..f0d14192a99 100644 --- a/packaging/rpm/ansible.spec +++ b/packaging/rpm/ansible.spec @@ -2,7 +2,7 @@ %define ansible_version $VERSION %if 0%{?rhel} == 5 -%define __python /usr/bin/python26 +%define __python2 /usr/bin/python26 %endif Name: %{name} @@ -14,6 +14,7 @@ License: GPLv3+ Group: Development/Libraries Source: http://releases.ansible.com/ansible/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot +%{!?__python2: %global __python2 /usr/bin/python2.6} %{!?python_sitelib: %global python_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} BuildArch: noarch