Commit af5660b0 authored by Ondřej Surý's avatar Ondřej Surý

Merge branch 'bash_completion-makefile' into 'master'

makefile: install bash completion script for keymgr to correct location.

Solves #369.

See merge request !384
parents 6850fe45 332730e1
......@@ -37,7 +37,8 @@ AC_SUBST([libdnssec_VERSION_INFO],["-version-info 0:0:0"])
AC_SUBST([libzscanner_VERSION_INFO],["-version-info 0:1:0"])
# Automatically update release date based on configure.ac date
release_date=$(sed -n 's/^Knot DNS .* (\(.*\))/\1/p;q;' ${srcdir}/NEWS)
AC_PROG_SED
release_date=$($SED -n 's/^Knot DNS .* (\(.*\))/\1/p;q;' ${srcdir}/NEWS)
AC_SUBST([RELEASE_DATE], $release_date)
# Set compiler compatibility flags
......@@ -56,12 +57,21 @@ AC_PROG_LIBTOOL
LT_INIT
# Use pkg-config
PKG_PROG_PKG_CONFIG
m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], [AC_SUBST([pkgconfigdir], ['${libdir}/pkgconfig'])])
AC_CONFIG_FILES([src/libknot.pc
src/dnssec/libdnssec.pc
src/zscanner/libzscanner.pc
])
# Get Bash completion scripts directory
bash_completion_dir=""
PKG_CHECK_VAR([bash_completion_dir], [bash-completion], [completionsdir],[
PKG_CHECK_VAR([bash_completion_prefix], [bash-completion], [prefix], [
AC_SUBST([BASH_COMPLETION_DIR], ["${prefix}"/$(echo "$bash_completion_dir" | $SED -e "s,^$bash_completion_prefix,,")])
])],[:])
AM_CONDITIONAL([HAVE_BASH_COMPLETION], [test -n "$bash_completion_dir"])
# Build Knot DNS daemon
AC_ARG_ENABLE([daemon],
AS_HELP_STRING([--disable-daemon], [Don't build Knot DNS main daemon]), [], [enable_daemon=yes])
......
# ax_pkg_check_var.m4 - Macros to locate and utilise variables from pkg-config. -*- Autoconf -*-
# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# -------------------------------------------
# Retrieves the value of the pkg-config variable for the given module.
m4_ifndef([PKG_CHECK_VAR],[
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])# PKG_CHECK_VAR
])
......@@ -24,15 +24,19 @@ install-data-local: knot.sample.conf
$(INSTALL) -d $(DESTDIR)/$(config_dir); \
$(INSTALL_DATA) knot.sample.conf $(srcdir)/example.com.zone $(DESTDIR)/$(config_dir); \
fi
if [ \! -f $(DESTDIR)/$(sysconfdir)/bash_completion.d/keymgr ]; then \
$(INSTALL) -d $(DESTDIR)/$(sysconfdir)/bash_completion.d; \
$(INSTALL_DATA) $(srcdir)/keymgr-completion.sh $(DESTDIR)/$(sysconfdir)/bash_completion.d/keymgr; \
if HAVE_BASH_COMPLETION
if [ \! -f $(DESTDIR)/$(BASH_COMPLETION_DIR)/keymgr ]; then \
$(INSTALL) -d $(DESTDIR)/$(BASH_COMPLETION_DIR); \
$(INSTALL_DATA) $(srcdir)/keymgr-completion.sh $(DESTDIR)/$(BASH_COMPLETION_DIR)/keymgr; \
fi
endif # HAVE_BASH_COMPLETION
uninstall-local:
-rm -rf $(DESTDIR)/$(config_dir)/knot.sample.conf \
$(DESTDIR)/$(config_dir)/example.com.zone \
$(DESTDIR)/$(sysconfdir)/bash_completion.d/keymgr
$(DESTDIR)/$(config_dir)/example.com.zone
if HAVE_BASH_COMPLETION
-rm -rf $(DESTDIR)/$(BASH_COMPLETION_DIR)/keymgr
endif # HAVE_BASH_COMPLETION
endif # HAVE_DAEMON
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment