From cbcbc0f6b05e6dffb3f538ec1b33566be4517920 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Wed, 31 Jan 2018 15:42:42 -0600 Subject: [PATCH] suricata-update: bundle suricata update Add autoconf/automake support for installing suricata-update if found in the top level suricata-update. --- .gitignore | 3 +++ Makefile.am | 5 +++-- configure.ac | 7 +++++++ suricata-update/Makefile.am | 22 ++++++++++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 suricata-update/Makefile.am diff --git a/.gitignore b/.gitignore index e7057d1ddd..2a53abc66c 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,6 @@ src/suricata stamp-h1 src/build-info.h qa/log/ + +/suricata-update/* +!/suricata-update/Makefile.am diff --git a/Makefile.am b/Makefile.am index a980335174..e50f24f706 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,8 +4,9 @@ AUTOMAKE_OPTIONS = foreign 1.4 ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = ChangeLog COPYING LICENSE suricata.yaml.in \ classification.config threshold.config \ - reference.config -SUBDIRS = $(HTP_DIR) rust src qa rules doc contrib scripts etc python ebpf + reference.config $(SURICATA_UPDATE_DIR) +SUBDIRS = $(HTP_DIR) rust src qa rules doc contrib scripts etc python ebpf \ + $(SURICATA_UPDATE_DIR) CLEANFILES = stamp-h[0-9]* diff --git a/configure.ac b/configure.ac index 6c3380ab71..278f408940 100644 --- a/configure.ac +++ b/configure.ac @@ -1375,6 +1375,13 @@ AC_CHECK_HEADER(net/netmap_user.h,,[AC_ERROR(net/netmap_user.h not found ...)],) ]) + # suricata-update + AC_CHECK_FILE([$srcdir/suricata-update/setup.py], [ + SURICATA_UPDATE_DIR="suricata-update" + AC_SUBST(SURICATA_UPDATE_DIR) + AC_OUTPUT(suricata-update/Makefile) + ]) + # libhtp AC_ARG_ENABLE(non-bundled-htp, AS_HELP_STRING([--enable-non-bundled-htp], [Enable the use of an already installed version of htp]),,[enable_non_bundled_htp=no]) diff --git a/suricata-update/Makefile.am b/suricata-update/Makefile.am new file mode 100644 index 0000000000..5f6914bbe9 --- /dev/null +++ b/suricata-update/Makefile.am @@ -0,0 +1,22 @@ +if HAVE_PYTHON + +install-exec-local: + cd $(srcdir) && \ + $(HAVE_PYTHON) setup.py build --build-base $(abs_builddir) \ + install --prefix $(DESTDIR)$(prefix) + +uninstall-local: + rm -f $(DESTDIR)$(bindir)/suricata-update + rm -rf $(DESTDIR)$(prefix)/lib*/python*/site-packages/suricata-update + rm -rf $(DESTDIR)$(prefix)/lib*/python*/site-packages/suricata_update-[0-9]*.egg-info + +clean-local: + cd $(srcdir) && \ + $(HAVE_PYTHON) setup.py clean \ + --build-base $(abs_builddir) + rm -rf scripts-* lib* build + find . -name \*.pyc -print0 | xargs -0 rm -f + +distclean-local: + +endif