]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
install-rules: use suricata-update if available
authorJason Ish <ish@unx.ca>
Thu, 26 Apr 2018 13:40:04 +0000 (07:40 -0600)
committerVictor Julien <victor@inliniac.net>
Thu, 3 May 2018 11:23:15 +0000 (13:23 +0200)
If Suricata update was bundled, use it for "install-rules" instead
of curl or wget.

Makefile.am
configure.ac

index 322ad3999828bcbe1593329728951a6535d9a13b..90982cb9286e6a83f448b5dc80f6bc696d5c7563 100644 (file)
@@ -30,6 +30,12 @@ install-conf:
        install -m 770 -d "$(DESTDIR)$(e_localstatedir)"
 
 install-rules:
+if HAVE_SURICATA_UPDATE
+       $(DESTDIR)$(bindir)/suricata-update \
+               --suricata $(DESTDIR)$(bindir)/suricata \
+               --suricata-conf $(DESTDIR)$(sysconfdir)/suricata/suricata.yaml \
+               --no-test --no-reload
+else
        install -d "$(DESTDIR)$(e_sysconfrulesdir)"
 if HAVE_FETCH_COMMAND
 if HAVE_WGET_COMMAND
@@ -58,3 +64,4 @@ endif
        @echo "While rules are installed now, it's highly recommended to use a rule manager for maintaining rules."
        @echo "The three most common are Suricata-Update, Oinkmaster and Pulledpork. For a guide see:"
        @echo "https://suricata.readthedocs.io/en/latest/rule-management/index.html"
+endif
index 12a7d179f0d98670337b7913b482184d224a3f37..0b0ff7a41b4ff6a245164bc4f30a55b44d64959f 100644 (file)
   ])
 
   # suricata-update
+  have_suricata_update="no"
   AC_CHECK_FILE([$srcdir/suricata-update/setup.py], [
       SURICATA_UPDATE_DIR="suricata-update"
       AC_SUBST(SURICATA_UPDATE_DIR)
       AC_OUTPUT(suricata-update/Makefile)
+      have_suricata_update="yes"
   ])
+  AM_CONDITIONAL([HAVE_SURICATA_UPDATE], [test "x$have_suricata_update" != "xno"])
 
   # libhtp
     AC_ARG_ENABLE(non-bundled-htp,