From e82f76b87ff9779532908a02315b6425fb8a53f4 Mon Sep 17 00:00:00 2001 From: Einhard Leichtfuß Date: Mon, 24 Dec 2018 21:56:30 +0100 Subject: 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). --- configure.ac | 55 +++++++++++++++++++++++-------------------------------- 1 file changed, 23 insertions(+), 32 deletions(-) (limited to 'configure.ac') 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" \ -- cgit v1.2.3