diff options
author | Einhard Leichtfuß <inbound@respiranto.de> | 2017-08-03 18:44:42 +0200 |
---|---|---|
committer | Einhard Leichtfuß <inbound@respiranto.de> | 2017-08-03 18:44:42 +0200 |
commit | 153a2021b263b6f22ecb624ab56ee7de1dc14e0c (patch) | |
tree | 0306a95cb63d17f26c8b1906e7db7efce9a620eb /configure.ac |
Initial commit of ctct
Somewhere after version 0.2.2.
Most notably, ctct can now be properly installed on OpenBSD and most
likely other BSDs.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..3b4d0a6 --- /dev/null +++ b/configure.ac @@ -0,0 +1,101 @@ +# autoconf script for ctct +# +# Copyright 2015, 2016 Einhard Leichtfuß +# +# This file is part of ctct. +# +# ctct is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ctct is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with ctct. If not, see <http://www.gnu.org/licenses/>. +# + +AC_INIT([ctct], [0.2.X], [ctct@respiranto.de]) +AC_CONFIG_FILES( + [Makefile] + [ctct.1] + [ctct.bash_completion] + [config.sh] +) +AC_CONFIG_FILES([ctct], [chmod +x ctct]) + +AC_ARG_VAR([confdir], ['system wide configuration directory']) +AC_SUBST([confdir]) +test -z "$confdir" && confdir='${sysconfdir}/$(TARGET)' + +AC_ARG_VAR([bash_completion_dir], + ['directory to store bash-completion script in']) +AC_SUBST([bash_completion_dir]) +test -z "$bash_completion_dir" \ + && bash_completion_dir='${datarootdir}/bash-completion/completions' + +AC_SUBST([default_confdir]) +if test -z "$default_confdir"; then + # Ugly, but works: + # If $prefix is unset by the user, set it temporarily: + test "$prefix" = NONE && prefix=/usr/local \ + && reset_prefix=true || reset_prefix=false + _confdir="$(echo "$confdir" \ + | sed -E 's/\$(\(TARGET\)|\{TARGET\})/$PACKAGE_NAME/')" + default_confdir="$_confdir" + # Resolve $prefix recursively: + # Vim has problems with '\"' in "doubled" double quotes after '!=': + while test "$default_confdir" \ + != "$(eval "printf '%s\n' \"$default_confdir\"")"; do #" + default_confdir="$(eval "printf '%s\n' \"$default_confdir\"")" #" + done + $reset_prefix && prefix=NONE +fi + +AC_ARG_VAR([default_datadir], ['directory to store contact data in']) +AC_SUBST([default_datadir]) +test -z "$default_datadir" && default_datadir='$HOME/.ctct' + +AC_ARG_VAR([default_fallback_editor], ['editor to use if EDITOR is unset']) +AC_SUBST([default_fallback_editor]) +test -z "$default_fallback_editor" && default_fallback_editor=vi + +AC_ARG_VAR([default_user_config_dir], ['user configuration directory']) +AC_SUBST([default_user_config_dir]) +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']) +AC_SUBST([default_input_program]) +test -z "$default_input_program" \ + && default_input_program='cat' + +AC_ARG_VAR([default_output_program], + ['the program that gets passed the contact files on stdin']) +AC_SUBST([default_output_program]) +test -z "$default_output_program" \ + && default_output_program='cat' + +AC_ARG_VAR([default_visual_program], + ['the program that is used to display the data']) +AC_SUBST([default_visual_program]) +test -z "$default_visual_program" \ + && default_visual_program='cat' + +AC_ARG_VAR([default_confirm_deletion], + ['whether to ask for confirmation upon deletion of a contact']) +AC_SUBST([default_confirm_deletion]) +test -z "$default_confirm_deletion" \ + && default_confirm_deletion=true + +AC_ARG_VAR([default_confirm_default_yes], + ['whether to consider "yes" as answer upon a not answered confirmation']) +AC_SUBST([default_confirm_default_yes]) +test -z "$default_confirm_default_yes" \ + && default_confirm_default_yes=false + +AC_OUTPUT |