From 4add5eaebb1e6c73a6bec76681c38fcc2191276e Mon Sep 17 00:00:00 2001 From: Faidon Liambotis Date: Thu, 5 Sep 2019 03:40:45 +0300 Subject: [PATCH] Avoid the hardcoding of /usr/local/etc On Linux systems, sysconfdir is usually /etc, while all the documentation refers to /usr/local/etc. Switch the two manpages that need to refer to the config file location to autoconf-substituted variables, and remove a spurious reference from the example config. --- .gitignore | 2 ++ README | 6 +++--- configure.ac | 10 ++++++++++ radsecproxy.8 => radsecproxy.8.in | 2 +- radsecproxy.conf-example | 3 +-- radsecproxy.conf.5 => radsecproxy.conf.5.in | 4 ++-- 6 files changed, 19 insertions(+), 8 deletions(-) rename radsecproxy.8 => radsecproxy.8.in (98%) rename radsecproxy.conf.5 => radsecproxy.conf.5.in (99%) diff --git a/.gitignore b/.gitignore index fa95497..8e166fc 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,8 @@ TAGS radsecproxy radsecproxy-conf radsecproxy-hash +radsecproxy.8 +radsecproxy.conf.5 build-aux/* tests/t_fticks tests/t_rewrite diff --git a/README b/README index c6d5f3c..33346cf 100644 --- a/README +++ b/README @@ -13,9 +13,9 @@ support. Without any special options to configure, all transports supported by the system will be enabled. See the output from "./configure --help" for how to change this. -To use radsecproxy you need to create a config file which is normally -found in /usr/local/etc/radsecproxy.conf. You can also specify the -location with the "-c" command line option (see below). For further +To use radsecproxy you need to create a config file which is normally found in +/etc/radsecproxy.conf or /usr/local/etc/radsecproxy.conf. You can also specify +the location with the "-c" command line option (see below). For further instructions, please see the enclosed example file and the manpages radsecproxy(8) and radsecproxy.conf(5). diff --git a/configure.ac b/configure.ac index 55d0921..b69c1b4 100644 --- a/configure.ac +++ b/configure.ac @@ -92,6 +92,16 @@ if test "x$dtls" = "xyes" ; then TARGET_CFLAGS="$TARGET_CFLAGS -DRADPROT_DTLS" fi +dnl Substitute variables such as sysconfdir +AC_CONFIG_FILES([radsecproxy.8 radsecproxy.conf.5]) + +dnl Expand sysconfdir early to avoid two layers of substitution +test "x$prefix" = xNONE && prefix=$ac_default_prefix +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +SYSCONFDIR=`eval echo $sysconfdir` +SYSCONFDIR=`eval echo $SYSCONFDIR` +AC_SUBST(SYSCONFDIR) + AC_SUBST(TARGET_CFLAGS) AC_SUBST(TARGET_LDFLAGS) AX_CHECK_SSL diff --git a/radsecproxy.8 b/radsecproxy.8.in similarity index 98% rename from radsecproxy.8 rename to radsecproxy.8.in index 8930e1b..b7fd334 100644 --- a/radsecproxy.8 +++ b/radsecproxy.8.in @@ -84,7 +84,7 @@ This signal is ignored. .SH "FILES" .TP -.B /usr/local/etc/radsecproxy.conf +.B @SYSCONFDIR@/radsecproxy.conf .sp The default configuration file. diff --git a/radsecproxy.conf-example b/radsecproxy.conf-example index c9347ee..1730e55 100644 --- a/radsecproxy.conf-example +++ b/radsecproxy.conf-example @@ -1,5 +1,4 @@ -# Master config file, must be in /usr/local/etc/radsecproxy or specified with -c option -# All possible config options are listed below +# Master config file, all possible config options are listed below # First you may define any global options, these are: # diff --git a/radsecproxy.conf.5 b/radsecproxy.conf.5.in similarity index 99% rename from radsecproxy.conf.5 rename to radsecproxy.conf.5.in index a1a300a..0f5d6aa 100644 --- a/radsecproxy.conf.5 +++ b/radsecproxy.conf.5.in @@ -6,7 +6,7 @@ radsecproxy.conf \- Radsec proxy configuration file .SH DESCRIPTION When the proxy server starts, it will first check the command line arguments, and then read the configuration file. Normally radsecproxy will read the -configuration file \fI/usr/local/etc/radsecproxy.conf\fR. The command line +configuration file \fI@SYSCONFDIR@/radsecproxy.conf\fR. The command line \fB\-c\fR option can be used to instead read an alternate file (see \fBradsecproxy\fR(8) for details). @@ -79,7 +79,7 @@ be included. The value can be a single file, or it can use normal shell globbing to specify multiple files, e.g.: .RS -include /usr/local/etc/radsecproxy.conf.d/*.conf +include @SYSCONFDIR@/radsecproxy.conf.d/*.conf .RE The files are sorted alphabetically. Included files are read in the order they