libyara3 on Debian/Ubuntu
yara on SUSE/RedHat
Signed-off-by: Matteo Cafasso <noxdafox(a)gmail.com>
---
appliance/packagelist.in | 4 ++++
daemon/Makefile.am | 3 ++-
m4/guestfs_daemon.m4 | 14 ++++++++++++++
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/appliance/packagelist.in b/appliance/packagelist.in
index bbbe4b2..352133c 100644
--- a/appliance/packagelist.in
+++ b/appliance/packagelist.in
@@ -51,6 +51,7 @@ ifelse(REDHAT,1,
vim-minimal
xz
yajl
+ yara
zfs-fuse
)
@@ -83,6 +84,7 @@ dnl iproute has been renamed to iproute2
libsystemd-id128-0
libsystemd-journal0
libyajl2
+ libyara3
linux-image
dnl syslinux 'suggests' mtools, but in reality it's a hard dependency:
mtools
@@ -125,6 +127,7 @@ ifelse(ARCHLINUX,1,
vim
xz
yajl
+ yara
)
ifelse(SUSE,1,
@@ -153,6 +156,7 @@ ifelse(SUSE,1,
systemd
vim
xz
+ yara
)
ifelse(FRUGALWARE,1,
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 23f60eb..3a25f43 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -222,7 +222,8 @@ guestfsd_LDADD = \
$(LIBINTL) \
$(SERVENT_LIB) \
$(PCRE_LIBS) \
- $(TSK_LIBS)
+ $(TSK_LIBS) \
+ $(YARA_LIBS)
guestfsd_CPPFLAGS = \
-I$(top_srcdir)/gnulib/lib \
diff --git a/m4/guestfs_daemon.m4 b/m4/guestfs_daemon.m4
index 12123df..0018930 100644
--- a/m4/guestfs_daemon.m4
+++ b/m4/guestfs_daemon.m4
@@ -126,3 +126,17 @@ AC_CHECK_LIB([tsk],[tsk_version_print],[
AC_DEFINE([HAVE_LIBTSK], [1], [Define to 1 if The Sleuth Kit library (libtsk) is
available.])
], [])
],[AC_MSG_WARN([The Sleuth Kit library (libtsk) not found])])
+
+dnl yara library (optional)
+PKG_CHECK_MODULES([YARA], [libyara],[
+ AC_SUBST([YARA_CFLAGS])
+ AC_SUBST([YARA_LIBS])
+ AC_DEFINE([HAVE_YARA],[1],[yara library found at compile time.])
+],[
+ AC_CHECK_LIB([yara],[yr_initialize],[
+ AC_CHECK_HEADER([yara.h],[
+ AC_SUBST([YARA_LIBS], [-lyara])
+ AC_DEFINE([HAVE_YARA], [1], [Define to 1 if Yara library is available.])
+ ], [])
+ ],[AC_MSG_WARN([Yara library not found])])
+])
--
2.10.2