From 0e9a9bf15758bf52e1e83c780b13ec77a8b74c58 Mon Sep 17 00:00:00 2001 From: "David M. Syzdek" Date: Mon, 11 Mar 2019 20:48:39 -0800 Subject: Adding ability to disable examples --- Makefile.am | 18 ++++++++++-------- acinclude.m4 | 27 +++++++++++++++++++++++++++ configure.ac | 2 ++ 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index c19b3c6..09b45a8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -76,14 +76,6 @@ bin_PROGRAMS = bin_SCRIPTS = pkgdata_DATA = sbin_SCRIPTS = src/bbfw -firewallglobal_DATA = src/firewall.d/global.d/rules-example \ - src/firewall.d/global.d/rules4-example \ - src/firewall.d/global.d/rules6-example \ - src/firewall.d/global.d/ipsets-example -firewall_DATA = src/firewall.d/ipsets-example \ - src/firewall.d/rules-example \ - src/firewall.d/rules4-example \ - src/firewall.d/rules6-example # lists @@ -132,6 +124,16 @@ DISTCHECK_CONFIGURE_FLAGS = \ # conditional targets for slackware +if ENABLE_EXAMPLES +firewallglobal_DATA = src/firewall.d/global.d/rules-example \ + src/firewall.d/global.d/rules4-example \ + src/firewall.d/global.d/rules6-example \ + src/firewall.d/global.d/ipsets-example +firewall_DATA = src/firewall.d/ipsets-example \ + src/firewall.d/rules-example \ + src/firewall.d/rules4-example \ + src/firewall.d/rules6-example +endif if ENABLE_SLACKWARE slackrcd_SCRIPTS = src/rc.firewall.new endif diff --git a/acinclude.m4 b/acinclude.m4 index 06006bc..65200f0 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -30,6 +30,33 @@ # acinclude.m4 - custom m4 macros used by configure.ac # + +# AC_BBFW_EXAMPLES() +# ----------------------------------- +AC_DEFUN([AC_BBFW_EXAMPLES],[dnl + + # display options + enableval="" + AC_ARG_ENABLE( + examples, + [AS_HELP_STRING([--disable-examples], [install example files [default=yes]])], + [ EEXAMPLES=$enableval ], + [ EEXAMPLES=$enableval ] + ) + + # sets options + if test "x${EEXAMPLES}" == "xyes";then + ENABLE_EXAMPLES=yes + elif test "x${EEXAMPLES}" == "xno";then + ENABLE_EXAMPLES=no + else + ENABLE_EXAMPLES=yes + fi + + AM_CONDITIONAL([ENABLE_EXAMPLES], [test "${ENABLE_EXAMPLES}" == "yes"]) +])dnl + + # AC_BBFW_SLACKWARE() # ----------------------------------- AC_DEFUN([AC_BBFW_SLACKWARE],[dnl diff --git a/configure.ac b/configure.ac index 1aaee07..93e79b8 100644 --- a/configure.ac +++ b/configure.ac @@ -99,6 +99,7 @@ AC_BINDLE_GIT_PACKAGE_VERSION([contrib/bindletools/build-aux/git-package-version # custom configure options +AC_BBFW_EXAMPLES AC_BBFW_SLACKWARE AC_BBFW_INITD AC_BBFW_SYSTEMD @@ -116,6 +117,7 @@ AC_MSG_NOTICE([ Install:]) AC_MSG_NOTICE([ Slackware Init Script: ${ENABLE_SLACKWARE}]) AC_MSG_NOTICE([ Init.d Scriptb: ${ENABLE_INITD}]) AC_MSG_NOTICE([ System Unit: ${ENABLE_SYSTEMD}]) +AC_MSG_NOTICE([ Example Files: ${ENABLE_EXAMPLES}]) AC_MSG_NOTICE([ ]) AC_MSG_NOTICE([ Please send suggestions to: $PACKAGE_BUGREPORT]) AC_MSG_NOTICE([ ]) -- cgit v1.2.3