17b94a
From 2e6241a800c98ba95b3420255d8089e0271b46eb Mon Sep 17 00:00:00 2001
17b94a
From: Sunil Kumar Acharya <sheggodu@redhat.com>
17b94a
Date: Thu, 6 Jun 2019 16:18:26 +0530
17b94a
Subject: [PATCH 169/169] Build: Fix spec to enable rhel8 client build
17b94a
17b94a
Updated the spec file with required changes to enable RHGS RHEL8
17b94a
client build. As Ganesha scripts are not python3 compatible, we
17b94a
will not be generating RHGS RHEL8 server build until the required
17b94a
changes are backported from upstream.
17b94a
17b94a
Label : DOWNSTREAM ONLY
17b94a
17b94a
BUG: 1717927
17b94a
Change-Id: I2a8d37d24405a8b2d5533ebf7b85327485f810d7
17b94a
Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
17b94a
Reviewed-on: https://code.engineering.redhat.com/gerrit/172668
17b94a
Tested-by: RHGS Build Bot <nigelb@redhat.com>
17b94a
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
17b94a
---
17b94a
 glusterfs.spec.in | 10 ++++------
17b94a
 1 file changed, 4 insertions(+), 6 deletions(-)
17b94a
17b94a
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
17b94a
index 85e75f2..9c7d7a7 100644
17b94a
--- a/glusterfs.spec.in
17b94a
+++ b/glusterfs.spec.in
17b94a
@@ -91,7 +91,7 @@
17b94a
 
17b94a
 # disable server components forcefully as rhel <= 6
17b94a
 %if ( 0%{?rhel} )
17b94a
-%if (!(( "%{?dist}" == ".el6rhs" ) || ( "%{?dist}" == ".el7rhs" ) || ( "%{?dist}" == ".el7rhgs" )))
17b94a
+%if (!(( "%{?dist}" == ".el6rhs" ) || ( "%{?dist}" == ".el7rhs" ) || ( "%{?dist}" == ".el7rhgs" ) || ( "%{?dist}" == ".el8rhgs" )))
17b94a
 %global _without_server --without-server
17b94a
 %endif
17b94a
 %endif
17b94a
@@ -270,7 +270,7 @@ BuildRequires:    python%{_pythonver}-devel
17b94a
 %if ( 0%{?rhel} && 0%{?rhel} < 8 )
17b94a
 BuildRequires:    python-ctypes
17b94a
 %endif
17b94a
-%if ( 0%{?_with_ipv6default:1} ) || ( 0%{!?_without_libtirpc:1} )
17b94a
+%if ( 0%{?_with_ipv6default:1} ) || ( 0%{!?_without_libtirpc:1} ) || ( 0%{?rhel} && ( 0%{?rhel} >= 8 ) )
17b94a
 BuildRequires:    libtirpc-devel
17b94a
 %endif
17b94a
 %if ( 0%{?fedora} && 0%{?fedora} > 27 ) || ( 0%{?rhel} && 0%{?rhel} > 7 )
17b94a
@@ -722,12 +722,10 @@ GlusterFS Events
17b94a
 
17b94a
 %prep
17b94a
 %setup -q -n %{name}-%{version}%{?prereltag}
17b94a
-%if ( ! %{_usepython3} )
17b94a
 echo "fixing python shebangs..."
17b94a
-for f in api events extras geo-replication libglusterfs tools xlators; do
17b94a
-find $f -type f -exec sed -i 's|/usr/bin/python3|/usr/bin/python2|' {} \;
17b94a
+for i in `find . -type f -exec bash -c "if file {} | grep 'Python script, ASCII text executable' >/dev/null; then echo {}; fi" ';'`; do
17b94a
+    sed -i -e 's|^#!/usr/bin/python.*|#!%{__python3}|' -e 's|^#!/usr/bin/env python.*|#!%{__python3}|' $i
17b94a
 done
17b94a
-%endif
17b94a
 
17b94a
 %build
17b94a
 
17b94a
-- 
17b94a
1.8.3.1
17b94a