From: Eric Leblond Date: Thu, 1 Aug 2013 13:51:45 +0000 (+0200) Subject: Use wget or curl to download ruleset. X-Git-Tag: suricata-2.0beta2~385 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F539%2Fhead;p=thirdparty%2Fsuricata.git Use wget or curl to download ruleset. --- diff --git a/Makefile.am b/Makefile.am index 58200ae869..fd4527c208 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,7 +27,15 @@ install-conf: install-rules: install -d "$(e_sysconfrulesdir)" - wget -qO - http://rules.emergingthreats.net/open/suricata/emerging.rules.tar.gz | tar -x -z -C "$(e_sysconfdir)" -f - +if HAVE_FETCH_COMMAND +if HAVE_WGET_COMMAND + $(HAVE_WGET) -qO - http://rules.emergingthreats.net/open/suricata/emerging.rules.tar.gz | tar -x -z -C "$(e_sysconfdir)" -f - +else + $(HAVE_CURL) -s http://rules.emergingthreats.net/open/suricata/emerging.rules.tar.gz | tar -x -z -C "$(e_sysconfdir)" -f - +endif +else + @echo "UNABLE to load ruleset wget or curl are not installed on system." +endif @test -e "$(e_sysconfrulesdir)decoder-events.rules" || install -m 600 "$(top_srcdir)/rules/decoder-events.rules" "$(e_sysconfrulesdir)" @test -e "$(e_sysconfrulesdir)stream-events.rules" || install -m 600 "$(top_srcdir)/rules/stream-events.rules" "$(e_sysconfrulesdir)" @test -e "$(e_sysconfrulesdir)smtp-events.rules" || install -m 600 "$(top_srcdir)/rules/smtp-events.rules" "$(e_sysconfrulesdir)" diff --git a/configure.ac b/configure.ac index e1956c2992..1a327bc223 100644 --- a/configure.ac +++ b/configure.ac @@ -114,7 +114,17 @@ fi AM_CONDITIONAL([HAVE_PYTHON], [test "$HAVE_PYTHON_CONFIG" != "no"]) - + AC_PATH_PROG(HAVE_WGET, wget, "no") + if test "$HAVE_WGET" = "no"; then + AC_PATH_PROG(HAVE_CURL, curl, "no") + if test "$HAVE_CURL" = "no"; then + echo + echo " Warning curl or wget not found, you won't be able to" + echo " download latest ruleset with 'make install-rules'" + fi + fi + AM_CONDITIONAL([HAVE_FETCH_COMMAND], [test "x$HAVE_WGET" != "xno" || test "x$HAVE_CURL" != "xno"]) + AM_CONDITIONAL([HAVE_WGET_COMMAND], [test "x$HAVE_WGET" != "xno"]) # Checks for libraries.