aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEinhard Leichtfuß <alguien@respiranto.de>2018-12-24 21:56:30 +0100
committerEinhard Leichtfuß <alguien@respiranto.de>2018-12-24 22:08:46 +0100
commite82f76b87ff9779532908a02315b6425fb8a53f4 (patch)
tree265ddbeb6281b29fdb4b34f90334359aa0f10245 /configure.ac
parent263743c43945d4ee8d0fcd88636db3ddd4981eaa (diff)
Rename conf file and bash completion script
Also, - Add the new manpage to the Makefile. - Add additional dependencies in README. - Fix some small formatting mistakes in ctct(1).
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac55
1 files changed, 23 insertions, 32 deletions
diff --git a/configure.ac b/configure.ac
index 8ffce4e..70cf150 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,47 +23,42 @@ AC_CONFIG_FILES(
[Makefile]
[ctct.1]
[ctct_config.5]
- [ctct.bash_completion]
- [config.sh]
+ [bash_completion]
+ [ctct_config]
)
AC_CONFIG_FILES([ctct], [chmod +x ctct])
-# Do not use $(.) notation here, confdir shall allow for shell substitution.
-AC_ARG_VAR([confdir], ['system wide configuration directory'])
-test -z "$confdir" && confdir='${sysconfdir}/${TARGET}'
-
AC_ARG_VAR([bash_completion_dir],
['directory to store bash-completion script in'])
test -z "$bash_completion_dir" \
&& bash_completion_dir='${datarootdir}/bash-completion/completions'
-# Used in manpage. Needs to be fully expanded.
-AC_SUBST([default_confdir])
+# Used in manpage and the ctct script. Needs to be fully expanded.
+AC_SUBST([sysconfdir_expanded])
# Use a function to allow for local variables.
fun() {
- if test -z "$default_confdir"
- then
-
- # If $prefix is unset by the user, set it to autoconf's default value:
- test "$prefix" = NONE && local prefix=/usr/local
-
- # Prevent //.
- test "$prefix" = / && local prefix=''
-
- local TARGET="$PACKAGE_NAME"
- default_confdir="$confdir"
-
- # Resolve $confdir recursively (notably including $prefix):
- while
- eval "default_confdir_expand=\"$default_confdir\""
- test "$default_confdir" != "$default_confdir_expand"
- do
- default_confdir="$default_confdir_expand"
- done
- fi
+ local prefix="$prefix"
+ local TARGET="$PACKAGE_NAME"
+ local next
+
+ # If $prefix is unset by the user, set it to autoconf's default value:
+ test "$prefix" = NONE && prefix=/usr/local
+
+ # Prevent //.
+ test "$prefix" = / && prefix=''
+
+ sysconfdir_expanded="$sysconfdir"
+
+ # Expand $sysconfdir recursively (notably including $prefix):
+ while
+ eval "next=\"$sysconfdir_expanded\""
+ test "$next" != "$sysconfdir_expanded"
+ do
+ sysconfdir_expanded="$next"
+ done
}; fun
@@ -73,10 +68,6 @@ test -z "$default_datadir" && default_datadir='$HOME/.ctct'
AC_ARG_VAR([default_fallback_editor], ['editor to use if EDITOR is unset'])
test -z "$default_fallback_editor" && default_fallback_editor=vi
-AC_ARG_VAR([default_user_config_dir], ['user configuration directory'])
-test -z "$default_user_config_dir" \
- && default_user_config_dir='$HOME/.config/'"$PACKAGE_NAME"
-
AC_ARG_VAR([default_input_program],
['the program that newly created or edited contact files get passed to on stdin'])
test -z "$default_input_program" \