# autoconf script for ctct # # Copyright 2015, 2016, 2018, 2019 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 . # AC_INIT([ctct], [0.3.0-dev], [alguien@respiranto.de]) AC_CONFIG_FILES( [Makefile] [ctct.1] [ctct_config.5] [bash_completion] [ctct_config] ) AC_CONFIG_FILES([ctct], [chmod +x ctct]) # ret_success must be 0, all others nonzero. AC_SUBST([ret_success], 0) AC_SUBST([ret_failure], 1) AC_SUBST([ret_badsyntax], 2) AC_SUBST([ret_error], 4) 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 and the ctct script. Needs to be fully expanded. AC_SUBST([sysconfdir_expanded]) # Use a function to allow for local variables. expand_sysconfdir() { 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 sysconfdir_expanded="$sysconfdir" # Expand $sysconfdir recursively (notably including $prefix): while eval "next=\"$sysconfdir_expanded\"" test "$next" != "$sysconfdir_expanded" do sysconfdir_expanded="$next" done # Prevent //. sysconfdir_expanded="${sysconfdir_expanded//\/\//\/}" test "$sysconfdir_expanded" = / && sysconfdir_expanded='' }; expand_sysconfdir AC_SUBST([default_user_config_file], ['$HOME/.config/ctct_config']) AC_ARG_VAR([default_datadir], ['directory to store contact data in']) test -z "$default_datadir" && default_datadir='$HOME/.ctct' AC_ARG_VAR([default_fallback_editor], ['editor to use if both $VISUAL AND $EDITOR are unset']) test -z "$default_fallback_editor" && default_fallback_editor=vi 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" && default_input_program='cat' AC_ARG_VAR([default_output_program], ['the program that gets passed the contact files on stdin']) test -z "$default_output_program" && default_output_program='cat' AC_ARG_VAR([default_visual_program], ['the program that is used to display the data']) 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']) 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']) test -z "$default_confirm_default_yes" && default_confirm_default_yes=false AC_OUTPUT # vi: ts=2 sw=2