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