summaryrefslogtreecommitdiff
path: root/app-admin/sagan/files
diff options
context:
space:
mode:
Diffstat (limited to 'app-admin/sagan/files')
-rw-r--r--app-admin/sagan/files/mysql_check.patch26
-rw-r--r--app-admin/sagan/files/sagan-1.0.0-liblognorm-json-c.patch55
-rw-r--r--app-admin/sagan/files/sagan.confd9
-rw-r--r--app-admin/sagan/files/sagan.init17
-rw-r--r--app-admin/sagan/files/sagan.init-r117
5 files changed, 124 insertions, 0 deletions
diff --git a/app-admin/sagan/files/mysql_check.patch b/app-admin/sagan/files/mysql_check.patch
new file mode 100644
index 000000000000..d2247aab571e
--- /dev/null
+++ b/app-admin/sagan/files/mysql_check.patch
@@ -0,0 +1,26 @@
+diff --git a/configure.in b/configure.ac
+rename from configure.in
+rename to configure.ac
+--- a/configure.in
++++ b/configure.ac
+@@ -215,13 +215,17 @@
+ AC_CHECK_LIB(pthread, main,,AC_MSG_ERROR(Sagan needs pthreads!))
+ AC_CHECK_LIB(m, main,,AC_MSG_ERROR(Sagan needs libm!))
+
++save_LIBS=$LIBS
+ if test "$MYSQL" = "yes"; then
+ AC_MSG_RESULT([------- MySQL support is enabled -------])
++ AC_CHECK_PROGS(MYSQL_CONFIG, mysql_config)
+ AC_CHECK_HEADER([mysql/mysql.h])
+ AC_CHECK_HEADER([mysql/errmsg.h])
+- AC_CHECK_LIB(mysqlclient_r, main,,AC_MSG_ERROR(The MySQL library libmysqlclient_r is missing!
+-If you're not interested in MySQL support use the --disable-mysql flag.))
+- fi
++ LIBS=$(mysql_config --libs_r)
++ AC_CHECK_LIB(mysqlclient_r, main,,AC_MSG_ERROR(The MySQL library libmysqlclient_r is missing!))
++fi
++LIBS="$save_LIBS $LIBS"
++
+
+ if test "$POSTGRES" = "yes"; then
+ AC_MSG_RESULT([------- PostgreSQL support is enabled -------])
diff --git a/app-admin/sagan/files/sagan-1.0.0-liblognorm-json-c.patch b/app-admin/sagan/files/sagan-1.0.0-liblognorm-json-c.patch
new file mode 100644
index 000000000000..f9540652717a
--- /dev/null
+++ b/app-admin/sagan/files/sagan-1.0.0-liblognorm-json-c.patch
@@ -0,0 +1,55 @@
+diff -rupN old/sagan-1.0.0RC3/configure.ac new/sagan-1.0.0RC3/configure.ac
+--- old/sagan-1.0.0RC3/configure.ac 2014-06-16 22:23:22.000000000 +0200
++++ new/sagan-1.0.0RC3/configure.ac 2015-10-11 21:04:26.493632624 +0200
+@@ -192,29 +192,15 @@ If you're not interested in libesmtp sup
+ fi
+
+ if test "$LOGNORM" = "yes"; then
+- AC_MSG_RESULT([------- liblognorm support is enabled -------])
+- AC_CHECK_HEADER([liblognorm.h])
+- AC_CHECK_HEADERS([json/json.h json.h], [break], [AC_MSG_ERROR([json-c headers not found or not usable.
+-This library is important for the correlation aspects of Sagan! Please see
+-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature
+-use the --disable-lognorm flag.])])
+- AC_CHECK_LIB(estr, main,,AC_MSG_ERROR(The libestr library cannot be found.
+-This library is important for the correlation aspects of Sagan! Please see
+-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature
+-use the --disable-lognorm flag. ))
+- AC_CHECK_LIB(ee, main,,AC_MSG_ERROR(The libee library cannot be found.
+-This library is important for the correlation aspects of Sagan! Please see
+-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature
+-use the --disable-lognorm flag. ))
+- AC_CHECK_LIB(lognorm, main,,AC_MSG_ERROR(The liblognorm library cannot be found.
+-This library is important for the correlation aspects of Sagan! Please see
+-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature
+-use the --disable-lognorm flag. ))
+- AC_CHECK_LIB(json, json_object_put,, [ AC_CHECK_LIB(json-c, json_object_put,,AC_MSG_ERROR(The json library cannot be found.
+-This library is important for the correlation aspects of Sagan! Please see
+-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature
+-use the --disable-lognorm flag.)) ],)
+- fi
++ AC_MSG_RESULT([------- liblognorm support is enabled -------])
++
++ PKG_CHECK_MODULES(LIBEE, libee >= 0.3.2)
++ PKG_CHECK_MODULES(LIBESTR, libestr >= 0.1.9)
++ PKG_CHECK_MODULES([JSON_C], [json-c],, [
++ PKG_CHECK_MODULES([JSON_C], [json],,)
++ ])
++ PKG_CHECK_MODULES(LIBLOGNORM, lognorm >= 1.0.2)
++fi
+
+ if test "$LIBPCAP" = "yes"; then
+ AC_MSG_RESULT([------- libpcap support is enabled -------])
+diff -rupN old/sagan-1.0.0RC3/src/Makefile.am new/sagan-1.0.0RC3/src/Makefile.am
+--- old/sagan-1.0.0RC3/src/Makefile.am 2014-06-16 22:23:22.000000000 +0200
++++ new/sagan-1.0.0RC3/src/Makefile.am 2015-10-11 21:05:28.754492699 +0200
+@@ -2,6 +2,9 @@ AUTOMAKE_OPIONS=foreign no-dependencies
+
+ bin_PROGRAMS = sagan
+
++sagan_CFLAGS = $(JSON_C_CFLAGS) $(LIBESTR_CFLAGS) $(LIBLOGNORM_CFLAGS)
++sagan_LDFLAGS = $(JSON_C_LIBS) $(LIBESTR_LIBS) $(LIBLOGNORM_LIBS)
++
+ sagan_SOURCES = sagan.c \
+ sagan-classifications.c \
+ sagan-config.c \
diff --git a/app-admin/sagan/files/sagan.confd b/app-admin/sagan/files/sagan.confd
new file mode 100644
index 000000000000..cab6db55ccf0
--- /dev/null
+++ b/app-admin/sagan/files/sagan.confd
@@ -0,0 +1,9 @@
+# Copyright 1999-2011 Gentoo Foundation
+# # Distributed under the terms of the GNU General Public License v2
+
+# Sagan daemon configuration file
+# Make debug mode
+# SAGAN_OPTS = " --debug "
+#
+# Run as user, default sagan
+SAGAN_USER="sagan"
diff --git a/app-admin/sagan/files/sagan.init b/app-admin/sagan/files/sagan.init
new file mode 100644
index 000000000000..99f1f24e3bfa
--- /dev/null
+++ b/app-admin/sagan/files/sagan.init
@@ -0,0 +1,17 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+pidfile="/var/run/sagan/sagan.pid"
+command="/usr/bin/sagan"
+command_args="-D \"${SAGAN_OPTS}\" -u \"${SAGAN_USER}\""
+
+depend() {
+ use logger mysql postgresql
+ need localmount
+}
+
+start_pre() {
+ checkpath -d -o sagan /var/run/sagan
+ checkpath -p -o sagan -m 0644 /var/run/sagan/sagan.fifo
+}
diff --git a/app-admin/sagan/files/sagan.init-r1 b/app-admin/sagan/files/sagan.init-r1
new file mode 100644
index 000000000000..f0d556583c43
--- /dev/null
+++ b/app-admin/sagan/files/sagan.init-r1
@@ -0,0 +1,17 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+pidfile="/var/run/sagan/sagan.pid"
+command="/usr/bin/sagan"
+command_args="-D \"${SAGAN_OPTS}\" -u \"${SAGAN_USER}\""
+
+depend() {
+ use logger mysql postgresql
+ need localmount
+}
+
+start_pre() {
+ checkpath -d -o sagan /run/sagan
+ checkpath -p -o sagan -m 0644 /run/sagan/sagan.fifo
+}