Include iprange and bash checks in maintainer mode

Provide a hidden environment variable, MAKEDIST_BUILD_ONLY, which
if set to "yes" will skip all the checks for programs needed at runtime,
for use on the build server.
This commit is contained in:
Philip Whineray 2015-12-29 08:52:18 +00:00
parent 6eef2b3f1d
commit 7688a624c0
2 changed files with 21 additions and 14 deletions

@ -9,7 +9,7 @@ define([VERSION_FIX], [1])
define([VERSION_SUFFIX], [_master])
dnl Required program versions
define([MIN_IPRANGE_VERSION], [1.0.0])
define([MIN_IPRANGE_VERSION], [1.0.2])
define([MIN_BASH_VERSION], [4.0])
define([MIN_PANDOC_VERSION], [1.12.2.1])
@ -115,6 +115,7 @@ AX_CHECK_MINVER([PANDOC_VERSION], MIN_PANDOC_VERSION, [$PANDOC],
[-v | head -n 1 | cut -d' ' -f2],
[], [AC_MSG_ERROR(could not find required version of pandoc)])
AX_CHECK_PANDOC_OUTPUT()
AX_NEED_SED()
AC_SUBST(PACKAGE_BUILT_DATE)
AC_SUBST(PANDOC_VERSION)
@ -130,19 +131,13 @@ fi
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin
if test x"$USE_MAINTAINER_MODE" = xno; then
AX_NEED_PROG([BASH_SHELL_PATH], [bash], [])
AX_CHECK_MINVER([BASH_VERSION_PATH], MIN_BASH_VERSION, [$BASH_SHELL_PATH],
[--version | sed -n -e '1{s/.* \(.*\..*\)\..*/\1/p;}'],
[], [AC_MSG_ERROR(could not find required version of bash)])
AX_NEED_PROG([IPRANGE], [iprange], [])
AX_CHECK_MINVER([IPRANGE_VERSION], MIN_IPRANGE_VERSION, [$IPRANGE],
[--version | head -n 1 | cut -d'_' -f1],
[], [AC_MSG_ERROR(could not find required version of iprange - check http://firehol.org/download/iprange/)])
fi
dnl --- OUTPUT OF './packaging/gen-config-detect.pl sbin/*.in' BEGIN ---
dnl --- OUTPUT OF './packaging/firehol/gen-config-detect sbin/*.in' BEGIN ---
if test x"$MAKEDIST_BUILD_ONLY" != xyes; then
AX_NEED_EGREP()
AX_NEED_GREP()
AX_NEED_SED()
@ -170,6 +165,7 @@ fi
if test x"$enable_ipv6" = xyes; then
AX_CHECK_PROG([IP6TABLES_SAVE], [ip6tables-save], [])
fi
AX_CHECK_PROG([IPRANGE], [iprange], [])
AX_CHECK_PROG([IPSET], [ipset], [])
if test x"$enable_ipv4" = xyes; then
AX_CHECK_PROG([IPTABLES], [iptables], [])
@ -187,12 +183,12 @@ AX_NEED_PROG([MKDIR], [mkdir], [])
AX_NEED_PROG([MKTEMP], [mktemp], [])
AX_CHECK_PROG([MODPROBE], [modprobe], [-q])
AX_CHECK_PROG([MODPROBE], [insmod], [])
AX_NEED_PROG([MV], [mv], [])
AX_CHECK_PROG([NFACCT], [nfacct], [])
AX_CHECK_PROG([MORE], [pager], [])
AX_CHECK_PROG([MORE], [less], [])
AX_CHECK_PROG([MORE], [more], [])
AX_NEED_PROG([MORE], [cat], [])
AX_NEED_PROG([MV], [mv], [])
AX_CHECK_PROG([NFACCT], [nfacct], [])
AX_CHECK_PROG([RENICE], [renice], [])
AX_NEED_PROG([RM], [rm], [])
AX_NEED_PROG([SLEEP], [sleep], [])
@ -247,6 +243,7 @@ AX_NEED_PROG([ENV], [env], [])
AX_NEED_PROG([FLOCK], [flock], [])
AX_CHECK_PROG([HEAD], [head], [])
AX_NEED_PROG([IP], [ip], [])
AX_NEED_PROG([IPRANGE], [iprange], [])
AX_CHECK_PROG([JQ], [jq], [])
AX_NEED_PROG([LN], [ln], [])
AX_NEED_PROG([LOGGER], [logger], [])
@ -288,6 +285,7 @@ AX_CHECK_PROG([FUNZIP], [funzip], [])
AX_CHECK_PROG([GAWK], [gawk], [])
AX_NEED_PROG([GAWK], [awk], [])
AX_CHECK_PROG([GIT], [git], [])
AX_NEED_PROG([IPRANGE], [iprange], [])
AX_NEED_PROG([IPSET], [ipset], [])
AX_NEED_PROG([LN], [ln], [])
AX_NEED_PROG([LOGGER], [logger], [])
@ -325,8 +323,15 @@ AX_NEED_PROG([SH], [ksh], [])
AX_NEED_PROG([SLEEP], [sleep], [])
AX_NEED_PROG([TR], [tr], [])
fi
fi
dnl --- OUTPUT OF './packaging/gen-config-detect.pl sbin/*.in' END ---
if test x"$IPRANGE" != x; then
AX_CHECK_MINVER([IPRANGE_VERSION], MIN_IPRANGE_VERSION, [$IPRANGE],
[--version | head -n 1 | cut -d'_' -f1],
[], [AC_MSG_ERROR(could not find required version of iprange - check http://firehol.org/download/iprange/)])
fi
AUTOCONF_RUN=Y
AC_SUBST(AUTOCONF_RUN)

@ -8,7 +8,7 @@ use Data::Dumper;
use File::Basename;
if (@ARGV == 0) {
print "Usage: ./packaging/firehol/gen-config-detect.pl sbin/file.in ...\n";
print "Usage: ./packaging/firehol/gen-config-detect sbin/file.in ...\n";
print "\n";
print "Generates the configure.ac content for detecting commands\n";
exit 0;
@ -59,7 +59,6 @@ my %special = (
SED => "AX_NEED_SED()",
GREP => "AX_NEED_GREP()",
EGREP => "AX_NEED_EGREP()",
IPRANGE => "",
);
my %ipv = (
@ -73,7 +72,9 @@ my %ipv = (
PING6 => 6,
);
print "dnl --- OUTPUT OF './packaging/gen-config-detect.pl sbin/*.in' BEGIN ---\n";
print "dnl --- OUTPUT OF './packaging/firehol/gen-config-detect sbin/*.in' BEGIN ---\n";
print 'if test x"$MAKEDIST_BUILD_ONLY" != xyes; then', "\n";
foreach my $special (sort(values(%special))) {
print $special . "\n" if ($special);
}
@ -123,6 +124,7 @@ foreach my $s (sort(keys(%scripts))) {
print "fi\n";
}
print "fi\n";
print "dnl --- OUTPUT OF './packaging/gen-config-detect.pl sbin/*.in' END ---\n";
sub split_options {