From patchwork Fri Feb 24 16:22:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 6609 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4PNZt402Qvz3xHC for ; Fri, 24 Feb 2023 16:22:20 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4PNZt13rwhz6L1; Fri, 24 Feb 2023 16:22:17 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4PNZt12ssSz302b; Fri, 24 Feb 2023 16:22:17 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4PNZsz3S8Vz2xYk; Fri, 24 Feb 2023 16:22:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4PNZsy3x9Nzgr; Fri, 24 Feb 2023 16:22:14 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1677255734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HNBlIIsNJMPOvA7Baw5sX5sGm/kWy9K65AWtMrtpIZE=; b=BokToyFCeOd9EkLZwhXnTHV4e+SbUJYU2UwrjR6Hpatp5IEBKpgccsycsmnRP9BtIpywMz ioHWRtaj85ddf2BA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1677255734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HNBlIIsNJMPOvA7Baw5sX5sGm/kWy9K65AWtMrtpIZE=; b=eZnHITkONAF07gm5wKOlbRANHNFRGCPt4ny/Y1uv3DYNOqPUdQIHiZ/pWxH6x/qCERWG4e qd3+Oi7RTyM26olBMIBrAhbVNoN/KLgfS1KhaeDqD+QTdUIDA0Zxhzjy46gxb8LCQj7BeA CAApg1lVlWMG+PdS33gR/SgjpYKNjc0Myd0vpCTwzBtEND1JdQzBeaj6RPKJgC6R/kgvWl sR8kcooBf2mTusYm5Jzw4wuVlrzkjEQX9tqGx658OvED85vZLZg+D0FRQ4lqeM3rEJpQY6 j7JSaaZG5i9YcIUemCi4tWF5Wy+Cs8GfokViVxPIGs7tv8Jqap+yS1TkdDppmQ== From: Stefan Schantl To: location@lists.ipfire.org Subject: [PATCH 2/2] Install bash-completion files. Date: Fri, 24 Feb 2023 17:22:06 +0100 Message-Id: <20230224162206.89971-2-stefan.schantl@ipfire.org> In-Reply-To: <20230224162206.89971-1-stefan.schantl@ipfire.org> References: <20230224162206.89971-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: development@lists.ipfire.org Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Stefan Schantl --- Makefile.am | 9 +++++++++ configure.ac | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/Makefile.am b/Makefile.am index 4da2ec5..4edb9e9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,8 @@ if ENABLE_PERL BINDINGS += perl endif +bashcompletiondir = @bashcompletiondir@ + AM_CPPFLAGS = \ -include $(top_builddir)/config.h \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ @@ -172,6 +174,13 @@ EXTRA_DIST += \ CLEANFILES += \ src/libloc.pc +#dist_bashcompletion_DATA = + +if BUILD_BASH_COMPLETION +dist_bashcompletion_DATA = \ + bash-completion/location +endif + dist_pkgpython_PYTHON = \ src/python/database.py \ src/python/downloader.py \ diff --git a/configure.ac b/configure.ac index edca1d4..e21574d 100644 --- a/configure.ac +++ b/configure.ac @@ -55,6 +55,41 @@ AC_CHECK_PROGS(ASCIIDOC, [asciidoc]) if test "${have_man_pages}" = "yes" && test -z "${ASCIIDOC}"; then AC_MSG_ERROR([Required program 'asciidoc' not found]) fi + +# - pkg-config ----------------------------------------------------------------- + +m4_ifndef([PKG_PROG_PKG_CONFIG], + [m4_fatal([Could not locate the pkg-config autoconf + macros. These are usually located in /usr/share/aclocal/pkg.m4. + If your macros are in a different location, try setting the + environment variable AL_OPTS="-I/other/macro/dir" before running + ./autogen.sh or autoreconf again. Make sure pkg-config is installed.])]) + +PKG_PROG_PKG_CONFIG +PKG_INSTALLDIR(['${usrlib_execdir}/pkgconfig']) + +# - bash-completion ------------------------------------------------------------ + +#enable_bash_completion=yes +AC_ARG_WITH([bashcompletiondir], + AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]), + [], + [AS_IF([`$PKG_CONFIG --exists bash-completion`], [ + with_bashcompletiondir=`$PKG_CONFIG --variable=completionsdir bash-completion` + ], [ + with_bashcompletiondir=${datadir}/bash-completion/completions + ]) +]) + +AC_SUBST([bashcompletiondir], [$with_bashcompletiondir]) + +AC_ARG_ENABLE([bash-completion], + AS_HELP_STRING([--disable-bash-completion], [do not install bash completion files]), + [], [enable_bash_completion=yes] +) + +AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes]) + # - debug ---------------------------------------------------------------------- AC_ARG_ENABLE([debug], @@ -206,6 +241,7 @@ AC_MSG_RESULT([ debug: ${enable_debug} systemd support: ${have_systemd} + bash-completion: ${enable_bash_completion} Bindings: perl: ${enable_perl}