Skip to content

Commit

Permalink
install-rules: use suricata-update if available
Browse files Browse the repository at this point in the history
If Suricata update was bundled, use it for "install-rules" instead
of curl or wget.
  • Loading branch information
jasonish authored and victorjulien committed May 3, 2018
1 parent b9e083a commit 732ce3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Makefile.am
Expand Up @@ -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
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions configure.ac
Expand Up @@ -1376,11 +1376,14 @@
])

# 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,
Expand Down

0 comments on commit 732ce3f

Please sign in to comment.