Blame SOURCES/0153-BUILD-Improve-error-messages-for-optional-dependenci.patch

ecf709
From 9581287c1b5e13a38182af12328ace781957a118 Mon Sep 17 00:00:00 2001
ecf709
From: Lukas Slebodnik <lslebodn@redhat.com>
ecf709
Date: Tue, 30 May 2017 14:40:07 +0200
ecf709
Subject: [PATCH 153/160] BUILD: Improve error messages for optional
ecf709
 dependencies
ecf709
ecf709
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
ecf709
(cherry picked from commit 8ccc9b7c317cf5ee8f295b38bfc4c2b7d551f8f1)
ecf709
---
ecf709
 configure.ac               | 2 +-
ecf709
 contrib/sssd.spec.in       | 6 +++++-
ecf709
 src/external/libcurl.m4    | 6 +++++-
ecf709
 src/external/libjansson.m4 | 5 +++--
ecf709
 4 files changed, 14 insertions(+), 5 deletions(-)
ecf709
ecf709
diff --git a/configure.ac b/configure.ac
ecf709
index 80d8ea9ff5785b0d76edbb04f454d0dd8c8a1e6d..e8fe1d47e1803cc570295cf6512a3363e63c51c5 100644
ecf709
--- a/configure.ac
ecf709
+++ b/configure.ac
ecf709
@@ -197,7 +197,6 @@ m4_include([src/external/service.m4])
ecf709
 
ecf709
 if test x$with_secrets = xyes; then
ecf709
     m4_include([src/external/libhttp_parser.m4])
ecf709
-    m4_include([src/external/libjansson.m4])
ecf709
 fi
ecf709
 
ecf709
 if test x$with_kcm = xyes; then
ecf709
@@ -206,6 +205,7 @@ fi
ecf709
 
ecf709
 if test x$with_kcm = xyes -o x$with_secrets = xyes; then
ecf709
     m4_include([src/external/libcurl.m4])
ecf709
+    m4_include([src/external/libjansson.m4])
ecf709
 fi
ecf709
 
ecf709
 # This variable is defined by external/libcurl.m4, but conditionals
ecf709
diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
ecf709
index 39a974edebba3dbcd7625d1729b4a7330eaa8a27..b19702d091862e25bea352901b85406ccda1db65 100644
ecf709
--- a/contrib/sssd.spec.in
ecf709
+++ b/contrib/sssd.spec.in
ecf709
@@ -228,10 +228,14 @@ BuildRequires: systemtap-sdt-devel
ecf709
 %endif
ecf709
 %if (0%{?with_secrets} == 1)
ecf709
 BuildRequires: http-parser-devel
ecf709
-BuildRequires: jansson-devel
ecf709
 %endif
ecf709
+%if (0%{?with_kcm} == 1)
ecf709
 BuildRequires: libuuid-devel
ecf709
+%endif
ecf709
+%if (0%{?with_secrets} == 1 || 0%{?with_kcm} == 1)
ecf709
+BuildRequires: jansson-devel
ecf709
 BuildRequires: libcurl-devel
ecf709
+%endif
ecf709
 
ecf709
 %description
ecf709
 Provides a set of daemons to manage access to remote directories and
ecf709
diff --git a/src/external/libcurl.m4 b/src/external/libcurl.m4
ecf709
index 42be308cd1e4b04e736daf887be9b75ea92db80e..94cea9ebe40f07c18452b8c2faf82e81e1dc766b 100644
ecf709
--- a/src/external/libcurl.m4
ecf709
+++ b/src/external/libcurl.m4
ecf709
@@ -1,5 +1,9 @@
ecf709
 PKG_CHECK_MODULES([CURL], [libcurl], [found_libcurl=yes],
ecf709
-              [AC_MSG_ERROR([The libcurl development library was not found.])])
ecf709
+              [AC_MSG_ERROR([The libcurl development library was not found.
ecf709
+You must have the header file curl/curl.h installed to build sssd
ecf709
+with secrets and KCM responder. If you want to build sssd without these
ecf709
+responders then specify --without-secrets --without-kcm when running configure.
ecf709
+])])
ecf709
 
ecf709
 AS_IF([test x"$found_libcurl" = xyes],
ecf709
     CFLAGS="$CFLAGS $CURL_CFLAGS"
ecf709
diff --git a/src/external/libjansson.m4 b/src/external/libjansson.m4
ecf709
index 48a4a5fd8df4ac41312a596b5ebd5de7474e75f1..d87769848558efdd32325e01d8d222bb517b4c45 100644
ecf709
--- a/src/external/libjansson.m4
ecf709
+++ b/src/external/libjansson.m4
ecf709
@@ -13,5 +13,6 @@ AS_IF([test x"$found_jansson" != xyes],
ecf709
                       [-L$sss_extra_libdir -ljanson])],
ecf709
         [AC_MSG_ERROR([
ecf709
 You must have the header file jansson.h installed to build sssd
ecf709
-with secrets responder. If you want to build sssd without secret responder
ecf709
-then specify --without-secrets when running configure.])])])
ecf709
+with secrets and KCM responder. If you want to build sssd without these
ecf709
+responders then specify --without-secrets --without-kcm when running configure.
ecf709
+])])])
ecf709
-- 
ecf709
2.9.4
ecf709