]> granicus.if.org Git - ipset/commitdiff
Add bash completion to the install routine.
authorMart Frauenlob <mart.frauenlob@chello.at>
Thu, 25 Feb 2016 15:01:40 +0000 (16:01 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 26 Feb 2016 18:59:29 +0000 (19:59 +0100)
Add the configure option --enable-bashcompl (default disabled).
The PKG_CHECK_VAR requires pkg-config 0.28 or greater.

Signed-off-by: Mart Frauenlob <mart.frauenlob@chello.at>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Makefile.am
configure.ac
utils/Makefile.am [new file with mode: 0644]
utils/ipset_bash_completion/ipset [moved from utils/ipset_bash_completion/ipset_bash_completion with 100% similarity]

index a3f31dd2791a2de62d1f0bc51e8454c25d32b601..684ebee5b100b936022443b625c7b606bf640287 100644 (file)
@@ -15,7 +15,7 @@ else
 IP_SET_MAX=$(MAXSETS)
 endif
 
-SUBDIRS                = include/libipset lib src
+SUBDIRS                = include/libipset lib src utils
 
 sparse:
        $(MAKE) -C lib sparse-check
index 390673cd0b4d7a3107cce3d32e576a78c94822e3..1de0808ea27a92a27817158cc0d5be08e504cec5 100644 (file)
@@ -39,6 +39,17 @@ AC_ARG_WITH([ksource],
 AM_CONDITIONAL(WITH_KBUILDDIR, test "$KBUILDDIR" != "")
 AC_SUBST(KBUILDDIR)
 
+dnl ipset bash compspec - bash shell programmable completion
+AC_ARG_ENABLE([bashcompl],
+       AS_HELP_STRING([--enable-bashcompl],
+       [Install bash completion for ipset]),
+       [enable_bashcompl="$enableval"], [enable_bashcompl="no"])
+
+if test "x$enable_bashcompl" = "xyes"; then
+       PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], , bashcompdir="${sysconfdir}/bash_completion.d")
+       AC_SUBST(bashcompdir)
+fi
+
 if test "$BUILDKMOD" == "yes"
 then
 dnl Sigh: check kernel version dependencies
@@ -501,13 +512,16 @@ dnl Checks for library functions.
 
 dnl Generate output
 AC_CONFIG_FILES([Makefile include/libipset/Makefile
-       lib/Makefile lib/libipset.pc src/Makefile
+       lib/Makefile lib/libipset.pc src/Makefile utils/Makefile
        kernel/include/linux/netfilter/ipset/ip_set_compat.h])
 AC_OUTPUT
 
 dnl Summary
 AC_MSG_RESULT([])
 AC_MSG_RESULT([$PACKAGE userspace tool configuration:])
+if test "x$bashcompdir" != "x"; then
+       AC_MSG_RESULT([    Bash completion directory: ${bashcompdir}])
+fi
 if test "x$enable_settype_modules" != "xyes"; then
        AC_MSG_RESULT([    Dynamic module loading: disabled])
 else
diff --git a/utils/Makefile.am b/utils/Makefile.am
new file mode 100644 (file)
index 0000000..40128d3
--- /dev/null
@@ -0,0 +1,4 @@
+include $(top_srcdir)/Make_global.am
+
+bashcompdir = @bashcompdir@
+dist_bashcomp_DATA = ipset_bash_completion/ipset