diff --git a/CMakeLists.txt b/CMakeLists.txt index 23a53d98f..e66fb367a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,15 +89,24 @@ OPTION(ENABLE_GUILE "Enable Scheme (guile) scripting language" ON) OPTION(ENABLE_XFER "Enable Xfer plugin" ON) OPTION(ENABLE_DOC "Enable Documentation" OFF) +# option WEECHAT_HOME IF(NOT DEFINED WEECHAT_HOME OR "${WEECHAT_HOME}" STREQUAL "") SET(WEECHAT_HOME "~/.weechat") ENDIF(NOT DEFINED WEECHAT_HOME OR "${WEECHAT_HOME}" STREQUAL "") - SET(WEECHAT_HOME "${WEECHAT_HOME}" CACHE STRING "WeeChat home directory for config, logs, scripts.. (default is \"~/.weechat\")" FORCE) MARK_AS_ADVANCED(CLEAR WEECHAT_HOME) +# option CA_FILE +IF(NOT DEFINED CA_FILE OR "${CA_FILE}" STREQUAL "") + SET(CA_FILE "/etc/ssl/certs/ca-certificates.crt") +ENDIF(NOT DEFINED CA_FILE OR "${CA_FILE}" STREQUAL "") +SET(CA_FILE "${CA_FILE}" CACHE + STRING "File containing the certificate authorities (default is \"/etc/ssl/certs/ca-certificates.crt\"). This is the default value of option \"weechat.network.gnutls_ca_file\"." + FORCE) +MARK_AS_ADVANCED(CLEAR CA_FILE) + IF(ENABLE_NLS) ADD_SUBDIRECTORY( po ) ENDIF(ENABLE_NLS) diff --git a/ChangeLog b/ChangeLog index cb3c227fb..1339f2e5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,9 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] Version 0.4.2 (under dev!) -------------------------- +* core: add CA_FILE option in cmake and configure to setup default + value of option weechat.network.gnutls_ca_file (default is + "/etc/ssl/certs/ca-certificates.crt") (task #12725) * core: use "/dev/null" for stdin in hook_process instead of closing stdin (bug #39538) * core: add option "scroll_beyond_end" for command /window (task #6745) diff --git a/config.h.cmake b/config.h.cmake index f4e3a1472..6e1fd067f 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -14,4 +14,5 @@ #define WEECHAT_SHAREDIR "@SHAREDIR@" #define LOCALEDIR "@LOCALEDIR@" #define WEECHAT_HOME "@WEECHAT_HOME@" +#define CA_FILE "@CA_FILE@" #define _GNU_SOURCE 1 diff --git a/configure.ac b/configure.ac index 92d4bfd84..cbd3553bd 100644 --- a/configure.ac +++ b/configure.ac @@ -120,6 +120,7 @@ AH_VERBATIM([PLUGIN_GUILE], [#undef PLUGIN_GUILE]) AH_VERBATIM([PLUGIN_XFER], [#undef PLUGIN_XFER]) AH_VERBATIM([DOC], [#undef DOC]) AH_VERBATIM([WEECHAT_HOME], [#define WEECHAT_HOME "~/.weechat"]) +AH_VERBATIM([CA_FILE], [#define CA_FILE "/etc/ssl/certs/ca-certificates.crt"]) # Arguments for ./configure @@ -154,12 +155,18 @@ AC_ARG_ENABLE(doc, [ --enable-doc turn on build of document AC_ARG_WITH(debug, [ --with-debug debugging: 0=no debug, 1=debug compilation (default=1)],debug=$withval,debug=1) AC_ARG_VAR(WEECHAT_HOME, [WeeChat home directory for config, logs, scripts.. (default is "~/.weechat")]) +AC_ARG_VAR(CA_FILE, [File containing the certificate authorities (default is "/etc/ssl/certs/ca-certificates.crt"). This is the default value of option "weechat.network.gnutls_ca_file".]) if test "x$WEECHAT_HOME" = "x" ; then WEECHAT_HOME="~/.weechat" fi AC_DEFINE_UNQUOTED(WEECHAT_HOME, "$WEECHAT_HOME") +if test "x$CA_FILE" = "x" ; then + CA_FILE="/etc/ssl/certs/ca-certificates.crt" +fi +AC_DEFINE_UNQUOTED(CA_FILE, "$CA_FILE") + not_asked="" not_found="" @@ -1219,11 +1226,12 @@ fi echo "" echo "Enabled features:" -echo " Interfaces........... :$listgui" -echo " Plugins.............. :$listplugins" -echo " Optional features.... :$listoptional" -echo " Compile with debug... : $msg_debug" -echo " Documentation........ : $msg_doc" +echo " Interfaces............. :$listgui" +echo " Plugins................ :$listplugins" +echo " Optional features...... :$listoptional" +echo " Compile with debug..... : $msg_debug" +echo " Documentation.......... : $msg_doc" +echo " Certificate authorities : ${CA_FILE}" if test "x$not_asked" != "x" || test "x$not_found" != "x"; then echo "" diff --git a/doc/de/weechat_user.de.txt b/doc/de/weechat_user.de.txt index 6b512be21..cb09c9fdc 100644 --- a/doc/de/weechat_user.de.txt +++ b/doc/de/weechat_user.de.txt @@ -144,7 +144,7 @@ Optionen für cmake können mit dem Format, "-DOPTION=VALUE", genutzt werden. Liste von häufig verwendeten Optionen: -[width="100%",cols="2m,2,2m,12",options="header"] +[width="100%",cols="2m,2,5m,12",options="header"] |======================================== | Option | Wert | Standardwert | Beschreibung @@ -158,6 +158,12 @@ Liste von häufig verwendeten Optionen: | WEECHAT_HOME | directory | ~/.weechat | Standard-Verzeichnis in welchem die Daten liegen. +// TRANSLATION MISSING +| CA_FILE | file | /etc/ssl/certs/ca-certificates.crt | + File containing the certificate authorities. + This is the default value of option + <>. + | ENABLE_ALIAS | `ON`, `OFF` | ON | kompiliert <>. diff --git a/doc/en/weechat_user.en.txt b/doc/en/weechat_user.en.txt index f2a0aefc0..366cf8dc3 100644 --- a/doc/en/weechat_user.en.txt +++ b/doc/en/weechat_user.en.txt @@ -144,7 +144,7 @@ Options can be used for cmake, with format: "-DOPTION=VALUE". List of commonly used options: -[width="100%",cols="2m,2,2m,12",options="header"] +[width="100%",cols="2m,2,5m,12",options="header"] |======================================== | Option | Values | Default value | Description @@ -158,6 +158,11 @@ List of commonly used options: | WEECHAT_HOME | directory | ~/.weechat | The default home directory when running WeeChat. +| CA_FILE | file | /etc/ssl/certs/ca-certificates.crt | + File containing the certificate authorities. + This is the default value of option + <>. + | ENABLE_ALIAS | `ON`, `OFF` | ON | Compile <>. diff --git a/doc/fr/weechat_user.fr.txt b/doc/fr/weechat_user.fr.txt index def260e66..544530001 100644 --- a/doc/fr/weechat_user.fr.txt +++ b/doc/fr/weechat_user.fr.txt @@ -146,7 +146,7 @@ Des options peuvent être utilisées pour cmake, avec le format: "-DOPTION=VALUE Liste des options couramment utilisées : -[width="100%",cols="2m,2,2m,12",options="header"] +[width="100%",cols="2m,2,5m,12",options="header"] |======================================== | Option | Valeurs | Valeur par défaut | Description @@ -160,6 +160,11 @@ Liste des options couramment utilisées : | WEECHAT_HOME | répertoire | ~/.weechat | Le répertoire "maison" par défaut lors du lancement de WeeChat. +| CA_FILE | fichier | /etc/ssl/certs/ca-certificates.crt | + Fichier contenant les autorités de certification. + C'est la valeur par défaut de l'option + <>. + | ENABLE_ALIAS | `ON`, `OFF` | ON | Compiler <>. diff --git a/doc/it/weechat_user.it.txt b/doc/it/weechat_user.it.txt index 915cb7b2b..a1e638613 100644 --- a/doc/it/weechat_user.it.txt +++ b/doc/it/weechat_user.it.txt @@ -155,7 +155,7 @@ Options can be used for cmake, with format: "-DOPTION=VALUE". List of commonly used options: // TRANSLATION MISSING -[width="100%",cols="2m,2,2m,12",options="header"] +[width="100%",cols="2m,2,5m,12",options="header"] |======================================== | Option | Values | Default value | Description @@ -169,6 +169,11 @@ List of commonly used options: | WEECHAT_HOME | directory | ~/.weechat | The default home directory when running WeeChat. +| CA_FILE | file | /etc/ssl/certs/ca-certificates.crt | + File containing the certificate authorities. + This is the default value of option + <>. + | ENABLE_ALIAS | `ON`, `OFF` | ON | Compile <>. diff --git a/doc/ja/weechat_user.ja.txt b/doc/ja/weechat_user.ja.txt index cf936c939..81f2a8c89 100644 --- a/doc/ja/weechat_user.ja.txt +++ b/doc/ja/weechat_user.ja.txt @@ -140,7 +140,7 @@ Options can be used for cmake, with format: "-DOPTION=VALUE". List of commonly used options: // TRANSLATION MISSING -[width="100%",cols="2m,2,2m,12",options="header"] +[width="100%",cols="2m,2,5m,12",options="header"] |======================================== | Option | Values | Default value | Description @@ -154,6 +154,11 @@ List of commonly used options: | WEECHAT_HOME | directory | ~/.weechat | The default home directory when running WeeChat. +| CA_FILE | file | /etc/ssl/certs/ca-certificates.crt | + File containing the certificate authorities. + This is the default value of option + <>. + | ENABLE_ALIAS | `ON`, `OFF` | ON | Compile <>. diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 1855f070f..ad547481b 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -3004,7 +3004,7 @@ config_weechat_init_options () "gnutls_ca_file", "string", N_("file containing the certificate authorities (\"%h\" will be " "replaced by WeeChat home, \"~/.weechat\" by default)"), - NULL, 0, 0, "/etc/ssl/certs/ca-certificates.crt", NULL, 0, NULL, NULL, + NULL, 0, 0, CA_FILE, NULL, 0, NULL, NULL, &config_change_network_gnutls_ca_file, NULL, NULL, NULL); config_network_gnutls_handshake_timeout = config_file_new_option ( weechat_config_file, ptr_section,