]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
configure: allow for --disable-suricata-update
authorJason Ish <ish@unx.ca>
Sun, 25 Nov 2018 15:03:22 +0000 (09:03 -0600)
committerVictor Julien <victor@inliniac.net>
Mon, 3 Dec 2018 13:21:09 +0000 (14:21 +0100)
This is to prevent suricata-update from being installed if it
would otherwise be installed based on in being bundled, and
its dependencies being available.

Warn the user that Suricata-Update will not be installed if it
is bundled, but python-yaml is missing (this will also cover
the case where Python is missing).

Add "Install suricata-update" to the build summary. For consistency,
relable "Suricatasc install" as "Install suricatasc".

configure.ac

index c4e6803c83a8f8888df6effc7452902ea0306036..57d0c5146def718bffc99373939ad9db386ab7ed 100644 (file)
         AC_CHECK_HEADER(net/netmap_user.h,,[AC_ERROR(net/netmap_user.h not found ...)],)
   ])
 
-  # suricata-update
-  have_suricata_update="no"
-  ruledirprefix="$sysconfdir"
-  suricata_update_rule_files="suricata-update-rule-files"
-  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"
-      ruledirprefix="$localstatedir/lib"
-      no_suricata_update_comment=""
-      has_suricata_update_comment="#"
-  ], [
-      no_suricata_update_comment="#"
-      has_suricata_update_comment=""
-  ])
-  AM_CONDITIONAL([HAVE_SURICATA_UPDATE], [test "x$have_suricata_update" != "xno"])
+  # Suricata-Update.
+    AC_ARG_ENABLE([suricata-update], AS_HELP_STRING([--disable-suricata-update],
+        [Disable suricata-update]), [enable_suricata_update=$enableval],
+      [enable_suricata_update="yes"])
+
+    # Assume suircata-update will not be installed.
+    have_suricata_update="no"
+    ruledirprefix="$sysconfdir"
+    no_suricata_update_comment="#"
+    has_suricata_update_comment=""
+    suricata_update_rule_files="suricata-update-rule-files"
+
+    if test "$enable_suricata_update" = "yes"; then
+      AC_CHECK_FILE([$srcdir/suricata-update/setup.py], [
+          have_suricata_update="yes"], [])
+    fi
+    AM_CONDITIONAL([HAVE_SURICATA_UPDATE],
+        [test "x$have_suricata_update" != "xno"])
+
+    install_suricata_update="no"
+    if test "$have_suricata_update" = "yes"; then
+        if test "$have_python_yaml" != "yes"; then
+           echo ""
+           echo "    Warning: suricata-update will not be installed as the"
+           echo "        depedency python-yaml is not installed."
+           echo ""
+           echo "    Debian/Ubuntu: apt install python-yaml"
+           echo "    Fedora: dnf install python-yaml"
+           echo "    CentOS/RHEL: yum install python-yaml"
+           echo ""
+       else
+           install_suricata_update="yes"
+            SURICATA_UPDATE_DIR="suricata-update"
+            AC_SUBST(SURICATA_UPDATE_DIR)
+            AC_OUTPUT(suricata-update/Makefile)
+            ruledirprefix="$localstatedir/lib"
+            no_suricata_update_comment=""
+            has_suricata_update_comment="#"
+       fi
+    fi
 
   # libhtp
     AC_ARG_ENABLE(non-bundled-htp,
@@ -2449,7 +2472,8 @@ SURICATA_BUILD_CONF="Suricata Configuration:
   Rust compiler:                           ${rust_compiler_version}
   Rust cargo:                              ${rust_cargo_version}
 
-  Suricatasc install:                      ${enable_python}
+  Install suricatasc:                      ${enable_python}
+  Install suricata-update:                 ${install_suricata_update}
 
   Profiling enabled:                       ${enable_profiling}
   Profiling locks enabled:                 ${enable_profiling_locks}