dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

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

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