[evolution-data-server/gnome-3-24] Warn and set default when sendmail not found during the build



commit f03000e095a6083b334ee540397291baf1ff7dac
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jul 10 14:14:05 2017 +0200

    Warn and set default when sendmail not found during the build
    
    When sendmail is not available when building, the corresponding SENDMAIL_PATH
    variable contains useless value. This change makes it possible to define
    SENDMAIL_PATH as an environment variable, which then points to
    the sendmail binary (like "/usr/sbin/sendmail"), and if not set, then
    it is searched for and when even that fails, then a default is used.
    
    There had been also SYSTEM_MAIL_DIR variable, but it was not used
    anywhere, thus it's removed now.
    
    The issue with missing sendmail had been reported at:
    https://bugzilla.redhat.com/show_bug.cgi?id=1468890

 CMakeLists.txt |   11 +++++++++--
 config.h.in    |    3 ---
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c1f4e9..7ff5870 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -605,8 +605,15 @@ CHECK_C_SOURCE_RUNS("
 # system mail stuff
 # ******************************
 
-find_program(SENDMAIL_PATH sendmail /usr/sbin /usr/lib)
-find_path(SYSTEM_MAIL_DIR /var/mail /var/spool/mail)
+if("$ENV{SENDMAIL_PATH}" STREQUAL "")
+       find_program(SENDMAIL_PATH sendmail /usr/sbin /usr/lib)
+       if(NOT SENDMAIL_PATH)
+               set(SENDMAIL_PATH "/usr/sbin/sendmail")
+               message(WARNING "sendmail not found, defaulting to ${SENDMAIL_PATH}")
+       endif(NOT SENDMAIL_PATH)
+else("$ENV{SENDMAIL_PATH}" STREQUAL "")
+       set(SENDMAIL_PATH $ENV{SENDMAIL_PATH})
+endif("$ENV{SENDMAIL_PATH}" STREQUAL "")
 
 # ******************************
 # Timezone checks
diff --git a/config.h.in b/config.h.in
index ba1c33e..6d4e506 100644
--- a/config.h.in
+++ b/config.h.in
@@ -39,9 +39,6 @@
 /* Path to a sendmail binary, or equivalent */
 #define SENDMAIL_PATH "@SENDMAIL_PATH@"
 
-/* Directory local mail is delivered to */
-#define SYSTEM_MAIL_DIR "@SYSTEM_MAIL_DIR@"
-
 /* Configured with enabled maintainer mode */
 #cmakedefine ENABLE_MAINTAINER_MODE 1
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]