From ce4fb7605e46e1a42ec8f176b360b872ba65eb2b Mon Sep 17 00:00:00 2001
From: Justin Stephenson <jstephen@redhat.com>
Date: Mon, 12 Jul 2021 10:06:20 -0400
Subject: [PATCH] KCM: Add krb5-libs dependency in spec

---
 contrib/sssd.spec.in | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
index e2877b64b1..0ff0bc311b 100644
--- a/contrib/sssd.spec.in
+++ b/contrib/sssd.spec.in
@@ -14,6 +14,18 @@
 %global child_attrs 4750
 %endif
 
+%if 0%{?fedora} >= 34
+%global build_kcm_renewals 1
+%global krb5_version 1.19.1
+%else
+%if 0%{rhel} >= 8
+%global build_kcm_renewals 1
+%global krb5_version 1.18.2
+%else
+%global build_kcm_renewals 0
+%endif
+%endif
+
 # we don't want to provide private python extension libs
 %define __provides_exclude_from %{python3_sitearch}/.*\.so$
 
@@ -472,6 +484,10 @@ Library to map certificates to users based on rules
 Summary: An implementation of a Kerberos KCM server
 License: GPLv3+
 Requires: sssd-common = %{version}-%{release}
+%if %{build_kcm_renewals}
+BuildRequires: krb5-libs >= %{krb5_version}
+Requires: krb5-libs >= %{krb5_version}
+%endif
 %{?systemd_requires}
 
 %description kcm
