nixpkgs/pkgs/tools/networking/easyrsa/fix-paths.patch

50 lines
2.0 KiB
Diff
Raw Normal View History

2016-01-05 18:55:33 +00:00
diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa
2020-08-23 02:19:39 +01:00
index 261336f..7b9a79b 100755
2016-01-05 18:55:33 +00:00
--- a/easyrsa3/easyrsa
+++ b/easyrsa3/easyrsa
2020-08-23 02:19:39 +01:00
@@ -1661,7 +1661,7 @@ Note: using Easy-RSA configuration from: $vars"
2016-01-05 18:55:33 +00:00
# Set defaults, preferring existing env-vars if present
2020-08-23 02:19:39 +01:00
set_var EASYRSA "$prog_dir"
2016-01-05 18:55:33 +00:00
- set_var EASYRSA_OPENSSL openssl
+ set_var EASYRSA_OPENSSL "@openssl@"
2020-08-23 02:19:39 +01:00
set_var EASYRSA_PKI "$PWD/pki"
2016-01-05 18:55:33 +00:00
set_var EASYRSA_DN cn_only
set_var EASYRSA_REQ_COUNTRY "US"
2020-08-23 02:19:39 +01:00
@@ -1683,16 +1683,31 @@ Note: using Easy-RSA configuration from: $vars"
set_var EASYRSA_TEMP_DIR "$EASYRSA_PKI"
set_var EASYRSA_REQ_CN ChangeMe
set_var EASYRSA_DIGEST sha256
- set_var EASYRSA_SSL_CONF "$EASYRSA_PKI/openssl-easyrsa.cnf"
- set_var EASYRSA_SAFE_CONF "$EASYRSA_PKI/safessl-easyrsa.cnf"
set_var EASYRSA_KDC_REALM "CHANGEME.EXAMPLE.COM"
2016-01-05 18:55:33 +00:00
2020-08-23 02:19:39 +01:00
+ if [ -f "$EASYRSA_PKI/safessl-easyrsa.conf" ]; then
+ set_var EASYRSA_SAFE_CONF "$EASYRSA_PKI/safessl-easyrsa.cnf"
+ elif [ -f "$EASYRSA/safessl-easyrsa.conf" ]; then
+ set_var EASYRSA_SAFE_CONF "$EASYRSA/safessl-easyrsa.cnf"
+ elif [ -f "@out@/share/easyrsa/safessl-easyrsa.cnf" ]; then
+ set_var EASYRSA_SAFE_CONF "@out@/share/easyrsa/safessl-easyrsa.cnf"
+ fi
+
+ if [ -f "$EASYRSA_PKI/openssl-easyrsa.conf" ]; then
+ set_var EASYRSA_SSL_CONF "$EASYRSA_PKI/openssl-easyrsa.cnf"
+ elif [ -f "$EASYRSA/openssl-easyrsa.conf" ]; then
+ set_var EASYRSA_SSL_CONF "$EASYRSA/openssl-easyrsa.cnf"
+ elif [ -f "@out@/share/easyrsa/openssl-easyrsa.cnf" ]; then
+ set_var EASYRSA_SSL_CONF "@out@/share/easyrsa/openssl-easyrsa.cnf"
+ fi
+
2016-01-05 18:55:33 +00:00
# Same as above for the x509-types extensions dir
if [ -d "$EASYRSA_PKI/x509-types" ]; then
set_var EASYRSA_EXT_DIR "$EASYRSA_PKI/x509-types"
2020-08-23 02:19:39 +01:00
- else
- #TODO: This should be removed. Not really suitable for packaging.
2016-01-05 18:55:33 +00:00
+ elif [ -d "$EASYRSA/x509-types" ]; then
2020-08-23 02:19:39 +01:00
set_var EASYRSA_EXT_DIR "$EASYRSA/x509-types"
+ else
+ set_var EASYRSA_EXT_DIR "@out@/share/easyrsa/x509-types"
2016-01-05 18:55:33 +00:00
fi
# EASYRSA_ALGO_PARAMS must be set depending on selected algo