4e5dbe2
From cf560591d75adfbcf6688d11486f60c2d3a15942 Mon Sep 17 00:00:00 2001
4e5dbe2
From: Neil Hanlon <neil@rockylinux.org>
4e5dbe2
Date: Mon, 4 Jul 2022 15:57:15 -0400
4e5dbe2
Subject: [PATCH 04/21] Fix for running on python3 and building on EL8 or
4e5dbe2
 higher
4e5dbe2
4e5dbe2
---
4e5dbe2
 Makefile   | 2 +-
4e5dbe2
 oz.spec.in | 2 +-
4e5dbe2
 setup.py   | 4 ++--
4e5dbe2
 3 files changed, 4 insertions(+), 4 deletions(-)
4e5dbe2
4e5dbe2
diff --git a/Makefile b/Makefile
4e5dbe2
index c8c5a54..fa81313 100644
4e5dbe2
--- a/Makefile
4e5dbe2
+++ b/Makefile
4e5dbe2
@@ -2,7 +2,7 @@ VERSION = $(shell egrep "^VERSION" setup.py | awk '{print $$3}')
4e5dbe2
 VENV_DIR = tests/.venv
4e5dbe2
 
4e5dbe2
 sdist: oz.spec.in
4e5dbe2
-	python setup.py sdist
4e5dbe2
+	python3 setup.py sdist
4e5dbe2
 
4e5dbe2
 oz.spec: sdist
4e5dbe2
 
4e5dbe2
diff --git a/oz.spec.in b/oz.spec.in
4e5dbe2
index e738026..37716b1 100644
4e5dbe2
--- a/oz.spec.in
4e5dbe2
+++ b/oz.spec.in
4e5dbe2
@@ -25,7 +25,7 @@ Requires: libvirt >= 0.9.7
4e5dbe2
 Requires: python3-requests
4e5dbe2
 Requires: genisoimage
4e5dbe2
 Requires: mtools
4e5dbe2
-%if 0%{?fedora} < 26
4e5dbe2
+%if 0%{?fedora} < 26 or 0%{?rhel} < 8
4e5dbe2
 Requires: python-uuid
4e5dbe2
 %endif
4e5dbe2
 Requires: openssh-clients
4e5dbe2
diff --git a/setup.py b/setup.py
4e5dbe2
index 8ca211f..22ec1fd 100644
4e5dbe2
--- a/setup.py
4e5dbe2
+++ b/setup.py
4e5dbe2
@@ -23,12 +23,12 @@ class sdist(_sdist):
4e5dbe2
                                     shell=True,
4e5dbe2
                                     stdout=subprocess.PIPE).communicate()[0].strip()
4e5dbe2
         date = time.strftime("%Y%m%d%H%M%S", time.gmtime())
4e5dbe2
-        git_release = "%sgit%s" % (date, git_head)
4e5dbe2
+        git_release = "%sgit%s" % (date, git_head.decode())
4e5dbe2
 
4e5dbe2
         # Expand macros in oz.spec.in and create oz.spec
4e5dbe2
         spec_in = open('oz.spec.in', 'r')
4e5dbe2
         spec = open('oz.spec', 'w')
4e5dbe2
-        for line in spec_in.xreadlines():
4e5dbe2
+        for line in spec_in.readlines():
4e5dbe2
             if "@VERSION@" in line:
4e5dbe2
                 line = line.replace("@VERSION@", VERSION)
4e5dbe2
             elif "@RELEASE@" in line:
4e5dbe2
-- 
4e5dbe2
2.43.0
4e5dbe2