From 1926e74e4865032256cf5cebfe977ac9c3dd149a Mon Sep 17 00:00:00 2001
From: Thierry Parmentelat <thierry.parmentelat@inria.fr>
Date: Thu, 27 Feb 2020 11:54:40 +0100
Subject: [PATCH] reguire gnupg1 on f>=31; sense the system to use gpg1 when
 installed

---
 nodemanager.spec | 5 +++++
 ticket.py        | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/nodemanager.spec b/nodemanager.spec
index 4319cbb..e4ef6db 100644
--- a/nodemanager.spec
+++ b/nodemanager.spec
@@ -44,7 +44,12 @@ Requires: python3
 # connecting PLC
 Requires: python3-pycurl
 # Signed tickets
+# see myplc/plc.d/gpg for more details on the gnupg / gpg topic
+%if "%{distro}" == "Fedora" && %{distrorelease} >= 31
+Requires: gnupg1
+%else
 Requires: gnupg
+%endif
 # sioc/plnet
 Requires: pyplnet >= 4.3
 # we do need the slice images in any case
diff --git a/ticket.py b/ticket.py
index 1904b81..a52be17 100644
--- a/ticket.py
+++ b/ticket.py
@@ -7,7 +7,9 @@ You must already have the key in the keyring.
 from subprocess import PIPE, Popen
 from xmlrpc.client import dumps, loads
 
-GPG = '/usr/bin/gpg'
+# see also myplc/plc.d/gpg
+import os.path
+GPG = '/usr/bin/gpg1' if os.path.exists("/usr/bin/gpg1") else "/usr/bin/gpg"
 
 def _popen_gpg(*args):
     """Return a Popen object to GPG."""
-- 
2.47.0