summaryrefslogtreecommitdiff
path: root/app-admin/rsyslog
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /app-admin/rsyslog
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.xz
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'app-admin/rsyslog')
-rw-r--r--app-admin/rsyslog/Manifest4
-rw-r--r--app-admin/rsyslog/files/8-stable/10-respect_CFLAGS-r1.patch15
-rw-r--r--app-admin/rsyslog/files/8-stable/10-respect_CFLAGS.patch11
-rw-r--r--app-admin/rsyslog/files/8-stable/50-default.conf95
-rw-r--r--app-admin/rsyslog/files/8-stable/50-rsyslog-add-option-to-disable-valgrind-usage-in-testbench.patch56
-rw-r--r--app-admin/rsyslog/files/8-stable/50-rsyslog-fix-size-based-legacy-config-statements.patch31
-rw-r--r--app-admin/rsyslog/files/8-stable/50-rsyslog-run-queue-persist-test-only-once.patch22
-rw-r--r--app-admin/rsyslog/files/8-stable/README.gentoo36
-rw-r--r--app-admin/rsyslog/files/8-stable/rsyslog.conf61
-rw-r--r--app-admin/rsyslog/files/8-stable/rsyslog.confd30
-rw-r--r--app-admin/rsyslog/files/8-stable/rsyslog.initd69
-rw-r--r--app-admin/rsyslog/files/8-stable/rsyslog.logrotate37
-rw-r--r--app-admin/rsyslog/metadata.xml40
-rw-r--r--app-admin/rsyslog/rsyslog-8.7.0-r2.ebuild413
-rw-r--r--app-admin/rsyslog/rsyslog-8.9.0.ebuild409
15 files changed, 1329 insertions, 0 deletions
diff --git a/app-admin/rsyslog/Manifest b/app-admin/rsyslog/Manifest
new file mode 100644
index 00000000000..c2219c31486
--- /dev/null
+++ b/app-admin/rsyslog/Manifest
@@ -0,0 +1,4 @@
+DIST rsyslog-8.7.0.tar.gz 2003365 SHA256 c77125b67a623569c9bdca8136b9aac013f1c6fd82fb8595e3ea267e61800f9c SHA512 53feac42c14134d76f5592ee491bb56fb2c4c33822a7a5609a5267b6911a5c5c4e73c5d66a913a666967d8826ee3077b91d8d2a1d1b60bcb3d425b35ec4677b0 WHIRLPOOL c74c401de68bb59310e307a0d9859d2f58bcbf8126d637d23d4f3979a0d6c69bce8ca850c2942b43f311ea83f47c9554f34e5dc10623d32324da1b18023d357d
+DIST rsyslog-8.9.0.tar.gz 2022294 SHA256 eab00e8e758cd9dd33b3e2cf6af80297d1951dc7db37bd723a6488a35d577adc SHA512 942cccc2cbe147572cc2d346ac330d80c86915757b2b7a380829f0b40294d7e4afd4887d5066821af1e059cd78cdb38520fc9d28b55daa7afcd0e5b2e6bd9a5d WHIRLPOOL cc072a64364f38d98187e7102e5be0277011071ce90a510a641aea6a5b3573a436e6539c5688b24d12a9654786892070c1518093e0176e5a40bea57f7dded133
+DIST rsyslog-doc-8.7.0.tar.gz 4105507 SHA256 f131bfb963eed4fe74d7336ee5261876b436004b78994d47523a82c0f7d666a8 SHA512 9b5b6f28a55b58c956ca614301fc9667243d02c321f8b4071264e4040dd8fe79ba7eb5a08912e2a229bdcf12f68eec24f1c65ba7b82ccd60c8e70d34267b8405 WHIRLPOOL 386ad5164768a5a4919ba5acda29f3ef670b78cc9d6845e3c8ee252b43d6622c19c7f8ec1edd7d0f1d111bf2c06d29fb5dbf9af6b46c426932ae6caa0e63c30c
+DIST rsyslog-doc-8.9.0.tar.gz 4100654 SHA256 d3c6747439fabbfa976922ca26ffa695778668e757261e00103f2444cf153afa SHA512 dbc6dfc43f3a75ba671969d2fd59080d96e411a62a2ac91444d076acba548b2c87000f9822fa0af82f22b4f5c098273d407c1e665ce4b24a52dbddfdc9ab981f WHIRLPOOL 550d499ec556a75344d25331aa1df1855f6f70e2e702c086a8ecbf1817eb1f4bc3b94224b77491f3bc1f6c758a22475c248f8afdfc25816132dfedd81c6dfee0
diff --git a/app-admin/rsyslog/files/8-stable/10-respect_CFLAGS-r1.patch b/app-admin/rsyslog/files/8-stable/10-respect_CFLAGS-r1.patch
new file mode 100644
index 00000000000..de89e6708c1
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/10-respect_CFLAGS-r1.patch
@@ -0,0 +1,15 @@
+diff --git a/configure.ac b/configure.ac
+index bebb399..5003f10 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -792,8 +792,8 @@ if test "x$enable_rsyslogrt" = "xyes"; then
+ fi
+ AM_CONDITIONAL(ENABLE_RSYSLOGRT, test x$enable_rsyslogrt = xyes)
+ RSRT_CFLAGS="\$(RSRT_CFLAGS1) \$(LIBESTR_CFLAGS) \$(JSON_C_CFLAGS)"
+-if test "$GCC" = "yes"
+-then RSRT_CFLAGS="$RSRT_CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -Werror=implicit-function-declaration -g"
++if test "$GCC" = "yes"; then
++ RSRT_CFLAGS="$RSRT_CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -Werror=implicit-function-declaration"
+ fi
+ RSRT_LIBS="\$(RSRT_LIBS1) \$(LIBESTR_LIBS) \$(JSON_C_LIBS)"
+ AC_SUBST(RSRT_CFLAGS1)
diff --git a/app-admin/rsyslog/files/8-stable/10-respect_CFLAGS.patch b/app-admin/rsyslog/files/8-stable/10-respect_CFLAGS.patch
new file mode 100644
index 00000000000..c74279bfded
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/10-respect_CFLAGS.patch
@@ -0,0 +1,11 @@
+--- configure.old 2014-10-02 15:41:45.692471540 +0200
++++ configure.ac 2014-10-02 15:42:11.122743182 +0200
+@@ -835,7 +835,7 @@
+ AM_CONDITIONAL(ENABLE_RSYSLOGRT, test x$enable_rsyslogrt = xyes)
+ RSRT_CFLAGS="\$(RSRT_CFLAGS1) \$(LIBESTR_CFLAGS) \$(JSON_C_CFLAGS)"
+ if test "$GCC" = "yes"
+-then RSRT_CFLAGS="$RSRT_CFLAGS -W -std=c99 -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g"
++then RSRT_CFLAGS="$RSRT_CFLAGS -W -std=c99 -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute"
+ fi
+ RSRT_LIBS="\$(RSRT_LIBS1) \$(LIBESTR_LIBS) \$(JSON_C_LIBS)"
+ AC_SUBST(RSRT_CFLAGS1)
diff --git a/app-admin/rsyslog/files/8-stable/50-default.conf b/app-admin/rsyslog/files/8-stable/50-default.conf
new file mode 100644
index 00000000000..9ae8578215b
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/50-default.conf
@@ -0,0 +1,95 @@
+#######################
+### DEFAULT ACTIONS ###
+#######################
+
+auth,authpriv.* action(
+ type="omfile"
+ File="/var/log/auth.log"
+ FileCreateMode="0600"
+ FileOwner="root"
+ FileGroup="adm"
+ Sync="off"
+)
+
+cron.* action(
+ type="omfile"
+ File="/var/log/cron.log"
+ FileOwner="root"
+ FileGroup="adm"
+)
+
+daemon.* action(
+ type="omfile"
+ File="/var/log/daemon.log"
+ FileOwner="root"
+ FileGroup="adm"
+)
+
+kern.* action(
+ type="omfile"
+ File="/var/log/kern.log"
+ FileOwner="root"
+ FileGroup="adm"
+)
+
+lpr.* action(
+ type="omfile"
+ File="/var/log/lpr.log"
+ FileOwner="root"
+ FileGroup="adm"
+)
+
+mail.* action(
+ type="omfile"
+ File="/var/log/mail.log"
+ FileOwner="root"
+ FileGroup="adm"
+)
+
+news.* action(
+ type="omfile"
+ File="/var/log/news.log"
+ FileOwner="root"
+ FileGroup="adm"
+)
+
+user.* action(
+ type="omfile"
+ File="/var/log/user.log"
+ FileOwner="root"
+ FileGroup="adm"
+)
+
+*.=debug;auth,authpriv,news,mail.none action(
+ type="omfile"
+ File="/var/log/debug.log"
+ FileOwner="root"
+ FileGroup="adm"
+)
+
+*.info;auth,authpriv,cron,daemon,lpr,mail,news.none action(
+ type="omfile"
+ File="/var/log/messages"
+ FileOwner="root"
+ FileGroup="adm"
+)
+
+# Uncomment the following directive to re-enable the
+# deprecated "/var/log/syslog" log file (don't forget to re-enable log
+# rotation in "/etc/logrotate.d/rsyslog" if you do that!)
+#*.*;auth,authpriv.none action(
+# type="omfile"
+# File="/var/log/syslog"
+# FileOwner="root"
+# FileGroup="adm"
+#)
+
+*.emerg action(
+ type="omusrmsg"
+ Users="*"
+ action.execOnlyOnceEveryInterval="10"
+)
+
+# Create an additional socket for the default chroot location
+# (used by net-misc/openssh[hpn], see https://bugs.gentoo.org/490744)
+input(type="imuxsock" Socket="/var/empty/dev/log")
diff --git a/app-admin/rsyslog/files/8-stable/50-rsyslog-add-option-to-disable-valgrind-usage-in-testbench.patch b/app-admin/rsyslog/files/8-stable/50-rsyslog-add-option-to-disable-valgrind-usage-in-testbench.patch
new file mode 100644
index 00000000000..77d7919c618
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/50-rsyslog-add-option-to-disable-valgrind-usage-in-testbench.patch
@@ -0,0 +1,56 @@
+From 2945539d12bbb79c44fd4402e87150b4ec58af25 Mon Sep 17 00:00:00 2001
+From: Thomas D.
+Date: Tue, 24 Mar 2015 02:03:13 +0100
+Subject: [PATCH] Add option to disable valgrind usage in testbench
+
+Temporary workaround for https://github.com/rsyslog/rsyslog/issues/263
+
+---
+ configure.ac | 27 +++++++++++++++++++++++----
+ 1 file changed, 23 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0c72f80..cdfdd25 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -13,10 +13,6 @@ AC_CONFIG_HEADERS([config.h])
+
+ AC_USE_SYSTEM_EXTENSIONS
+
+-# check if valgrind is present
+-AC_CHECK_PROG(have_valgrind, [valgrind], [yes])
+-AM_CONDITIONAL(HAVE_VALGRIND, test x$have_valgrind = xyes)
+-
+ # Checks for programs.
+ AC_PROG_LEX
+ AC_PROG_YACC
+@@ -1125,6 +1121,29 @@ if test "x$enable_testbench" = "xyes"; then
+ fi
+
+
++# valgrind-testbench
++AC_ARG_WITH([valgrind_testbench],
++ [AS_HELP_STRING([--without-valgrind-testbench], [Don't use valgrind in testbench])]
++)
++
++if test "x$with_valgrind_testbench" != "xno"; then
++ AC_CHECK_PROG(VALGRIND, [valgrind], [valgrind], [no])
++
++ if test "x$enable_testbench" = "xyes" && test "x$VALGRIND" = "xno"; then
++ if test "x$with_valgrind_testbench" = "xyes"; then
++ AC_MSG_ERROR([valgrind is missing but forced with --with-valgrind-testbench. Either install valgrind or remove the option!])
++ else
++ AC_MSG_WARN([valgrind is missing -- testbench won't use valgrind!])
++ fi
++ else
++ AC_MSG_NOTICE([testbench will use valgrind])
++ fi
++else
++ AC_MSG_NOTICE([testbench won't use valgrind due to set --without-valgrind-testbench option])
++fi
++AM_CONDITIONAL([HAVE_VALGRIND], [test "x$with_valgrind_testbench" != "xno" && test "x$VALGRIND" != "xno"])
++
++
+ # settings for the file input module
+ AC_ARG_ENABLE(imfile,
+ [AS_HELP_STRING([--enable-imfile],[file input module enabled @<:@default=no@:>@])],
diff --git a/app-admin/rsyslog/files/8-stable/50-rsyslog-fix-size-based-legacy-config-statements.patch b/app-admin/rsyslog/files/8-stable/50-rsyslog-fix-size-based-legacy-config-statements.patch
new file mode 100644
index 00000000000..67a2f0616f3
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/50-rsyslog-fix-size-based-legacy-config-statements.patch
@@ -0,0 +1,31 @@
+From 3b7bd0b7a7f0f5f1bf7609bdf34e7d9a32608ea6 Mon Sep 17 00:00:00 2001
+From: Rainer Gerhards <rgerhards@adiscon.com>
+Date: Tue, 17 Mar 2015 11:50:06 +0100
+Subject: [PATCH] bugfix: size-based legacy config statements did not work
+ properly
+
+on some platforms they misadressed memory, which could also lead
+to a segfault on startup. The problem is NOT experience on amd686
+in 64bit builds -- that's probably the reason this bug was uncovered
+very late. We assume, it's present in all v8 versions.
+
+Thanks to Michael Biebl for alerting us of it.
+
+closes https://github.com/rsyslog/rsyslog/issues/270
+---
+ runtime/cfsysline.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/runtime/cfsysline.c b/runtime/cfsysline.c
+index 36d4679..b441a48 100644
+--- a/runtime/cfsysline.c
++++ b/runtime/cfsysline.c
+@@ -161,7 +161,7 @@ static rsRetVal parseIntVal(uchar **pp, int64 *pVal)
+ * param value must be int64!
+ * rgerhards, 2008-01-09
+ */
+-static rsRetVal doGetSize(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *pVal)
++static rsRetVal doGetSize(uchar **pp, rsRetVal (*pSetHdlr)(void*, int64), void *pVal)
+ {
+ DEFiRet;
+ int64 i;
diff --git a/app-admin/rsyslog/files/8-stable/50-rsyslog-run-queue-persist-test-only-once.patch b/app-admin/rsyslog/files/8-stable/50-rsyslog-run-queue-persist-test-only-once.patch
new file mode 100644
index 00000000000..d2ded222898
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/50-rsyslog-run-queue-persist-test-only-once.patch
@@ -0,0 +1,22 @@
+From 31a5edc9be63de42f68825ff8e4d683534664a68 Mon Sep 17 00:00:00 2001
+From: Thomas D.
+Date: Sun, 8 Mar 2015 21:05:03 +0100
+Subject: [PATCH] tests: Run queue-persist.sh only once
+
+queue-persist.sh was called twice in Makefile.
+---
+ tests/Makefile.am | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 7575b84..9824e7e 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -83,7 +83,6 @@ TESTS += \
+ imuxsock_logger_root.sh \
+ imuxsock_traillf_root.sh \
+ imuxsock_ccmiddle_root.sh \
+- queue-persist.sh \
+ discard-rptdmsg.sh \
+ discard-allmark.sh \
+ discard.sh \
diff --git a/app-admin/rsyslog/files/8-stable/README.gentoo b/app-admin/rsyslog/files/8-stable/README.gentoo
new file mode 100644
index 00000000000..9f0666c86b0
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/README.gentoo
@@ -0,0 +1,36 @@
+Introduction
+============
+
+Since rsyslog version 7.6 we are shipping a new default Gentoo
+configuration. See bug #501982 to learn more about what we were trying to
+achieve by rewriting the entire configuration.
+
+
+Important changes
+=================
+
+1. "/var/log/syslog" log file is now deprecated
+
+ Beginning with rsyslog-7.6, the "/var/log/syslog" log file will no
+ longer being written per default. We are considering this file as
+ deprecated/obsolet for the typical user/system.
+ The content from this log file is still availble through other
+ (dedicated) log files, see
+
+ - /var/log/cron.log
+ - /var/log/daemon.log
+ - /var/log/mail.log
+ - /var/log/messages
+
+ If you really need the old "/var/log/syslog" log file, all you have to
+ do is uncommenting the corresponding configuration directive in
+ "/etc/rsyslog.d/50-default.conf".
+
+ If you do so, don't forget to re-enable log rotation in
+ "/etc/logrotate.d/rsyslog", too.
+
+
+2. An additional input socket in "/var/empty/dev/log" (default chroot
+ location) will be created per default
+
+ See bug #490744 for further details.
diff --git a/app-admin/rsyslog/files/8-stable/rsyslog.conf b/app-admin/rsyslog/files/8-stable/rsyslog.conf
new file mode 100644
index 00000000000..da484598a65
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/rsyslog.conf
@@ -0,0 +1,61 @@
+# /etc/rsyslog.conf
+#
+# This configuration is based on RainerScript, the new recommended syntax
+# for RSYSLOG. See http://www.rsyslog.com/doc/rainerscript.html for further
+# details.
+#
+# But if you don't want to learn something new at moment, don't worry: The
+# legacy syntax is still supported.
+#
+# You may want to use the new RSYSLOG configuration builder to create your
+# own more advanced configuration: http://www.rsyslog.com/rsyslog-configuration-builder/
+
+# Check config syntax on startup and abort if unclean (default: off)
+#$AbortOnUncleanConfig on
+
+
+###############
+### MODULES ###
+###############
+
+# Read syslog messages from default Unix socket /dev/log (e.g. via logger command)
+module(load="imuxsock")
+
+# Read messages from the kernel log and submits them to the syslog engine
+module(load="imklog")
+
+# Inject "--MARK--" messages every $Interval (seconds)
+#module(load="immark" Interval="600")
+
+# Read syslog messages from UDP
+#module(load="imudp")
+#input(type="imudp" port="514")
+
+# Read syslog messages from TCP
+#module(load="imtcp")
+#input(type="imtcp" port="514")
+
+
+#########################
+### GLOBAL DIRECTIVES ###
+#########################
+
+# Where to place spool and state files
+$WorkDirectory /var/spool/rsyslog
+
+# Reduce repeating messages (default: off)
+#$RepeatedMsgReduction on
+
+# Set defaults for every output file
+$Umask 0022
+
+module(
+ load="builtin:omfile"
+ Template="RSYSLOG_TraditionalFileFormat"
+ FileCreateMode="0644"
+ DirCreateMode="0755"
+)
+
+
+# Include all conf files in /etc/rsyslog.d/
+$IncludeConfig /etc/rsyslog.d/*.conf
diff --git a/app-admin/rsyslog/files/8-stable/rsyslog.confd b/app-admin/rsyslog/files/8-stable/rsyslog.confd
new file mode 100644
index 00000000000..d8cbe875960
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/rsyslog.confd
@@ -0,0 +1,30 @@
+# /etc/conf.d/rsyslog
+
+# Configuration file
+RSYSLOG_CONFIGFILE="/etc/rsyslog.conf"
+
+# PID file
+# If you should ever change this, remember to update
+# "/etc/logrotate.d/rsyslog", too.
+RSYSLOG_PIDFILE="/run/rsyslogd.pid"
+
+# You can use this configuration option to pass additional options to the
+# start-stop-daemon, see start-stop-daemon(8) for more details.
+# Per default we wait 1000ms after we have started the service to ensure
+# that the daemon is really up and running.
+RSYSLOG_SSDARGS="--wait 1000"
+
+# The termination timeout (start-stop-daemon parameter "retry") ensures
+# that the service will be terminated within a given time (60 + 5 seconds
+# per default) when you are stopping the service.
+# You need to increase the value when you are working with a large queue.
+# See http://www.rsyslog.com/doc/queues.html for further information.
+RSYSLOG_TERMTIMEOUT="TERM/60/KILL/5"
+
+
+# Options to rsyslogd
+# See rsyslogd(8) for more details
+# Notes:
+# * Do not specify another PIDFILE but use the variable above to change the location
+# * Do not specify another CONFIGFILE but use the variable above to change the location
+RSYSLOG_OPTS=""
diff --git a/app-admin/rsyslog/files/8-stable/rsyslog.initd b/app-admin/rsyslog/files/8-stable/rsyslog.initd
new file mode 100644
index 00000000000..a74f218e6a3
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/rsyslog.initd
@@ -0,0 +1,69 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+RSYSLOG_CONFIGFILE=${RSYSLOG_CONFIGFILE:-"/etc/rsyslog.conf"}
+RSYSLOG_PIDFILE=${RSYSLOG_PIDFILE:-"/run/rsyslogd.pid"}
+
+command="/usr/sbin/rsyslogd"
+command_args="${RSYSLOG_OPTS} -f ${RSYSLOG_CONFIGFILE} -i ${RSYSLOG_PIDFILE}"
+start_stop_daemon_args="${RSYSLOG_SSDARGS}"
+pidfile="${RSYSLOG_PIDFILE}"
+retry="${RSYSLOG_TERMTIMEOUT}"
+
+required_files="${RSYSLOG_CONFIGFILE}"
+
+description="RSYSLOG is the rocket-fast system for log processing (syslog replacement)."
+
+extra_commands="configtest"
+extra_started_commands="rotate"
+
+description_configtest="Run rsyslogd's internal config check."
+
+description_rotate="Sends rsyslogd a signal to re-open its log files."
+
+depend() {
+ need clock hostname localmount
+ provide logger
+}
+
+start_pre() {
+ if [ "${RC_CMD}" != "restart" ]; then
+ configtest || return 1
+ fi
+}
+
+stop_pre() {
+ if [ "${RC_CMD}" = "restart" ]; then
+ configtest || return 1
+ fi
+}
+
+stop_post() {
+ rm -f ${RSYSLOG_PIDFILE}
+}
+
+configtest() {
+ # This will currently only detect fatal errors
+ # See https://github.com/rsyslog/rsyslog/issues/79
+
+ local _test_command="${command} -N 999 -f ${RSYSLOG_CONFIGFILE}"
+ local _retval=0
+
+ ebegin "Checking rsyslogd's configuration"
+ ${_test_command} >/dev/null 2>&1
+ _retval=$?
+
+ if [ ${_retval} -ne 0 ]; then
+ ${_test_command}
+ fi
+
+ eend ${_retval} "failed, please correct errors above"
+}
+
+rotate() {
+ ebegin "Re-opening rsyslogd logs"
+ start-stop-daemon --signal SIGHUP --pidfile "${RSYSLOG_PIDFILE}"
+ eend $?
+}
diff --git a/app-admin/rsyslog/files/8-stable/rsyslog.logrotate b/app-admin/rsyslog/files/8-stable/rsyslog.logrotate
new file mode 100644
index 00000000000..1eae30e0d74
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/rsyslog.logrotate
@@ -0,0 +1,37 @@
+# Uncomment the following directive if you have re-enabled
+# "/var/log/syslog" in "/etc/rsyslog.d/50-default.conf"
+#/var/log/syslog
+#{
+# rotate 7
+# daily
+# missingok
+# notifempty
+# delaycompress
+# compress
+# postrotate
+# test -r /run/rsyslogd.pid && kill -HUP $(cat /run/rsyslogd.pid) &>/dev/null
+# endscript
+#}
+
+/var/log/auth.log
+/var/log/cron.log
+/var/log/daemon.log
+/var/log/kern.log
+/var/log/lpr.log
+/var/log/mail.log
+/var/log/news.log
+/var/log/user.log
+/var/log/debug.log
+/var/log/messages
+{
+ rotate 4
+ weekly
+ missingok
+ notifempty
+ compress
+ delaycompress
+ sharedscripts
+ postrotate
+ test -r /run/rsyslogd.pid && kill -HUP $(cat /run/rsyslogd.pid) &>/dev/null
+ endscript
+}
diff --git a/app-admin/rsyslog/metadata.xml b/app-admin/rsyslog/metadata.xml
new file mode 100644
index 00000000000..2be62ca5ed7
--- /dev/null
+++ b/app-admin/rsyslog/metadata.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>ultrabug@gentoo.org</email>
+ <name>Ultrabug</name>
+ <description>Primary Maintainer</description>
+ </maintainer>
+ <maintainer>
+ <email>whissi@whissi.de</email>
+ <name>Thomas D. (Whissi)</name>
+ <description>Proxy-Maintainer, CC. bugs</description>
+ </maintainer>
+ <use>
+ <flag name="dbi">Build the general database output module (requires <pkg>dev-db/libdbi</pkg>)</flag>
+ <flag name="elasticsearch">Build the Elasticsearch output module (requires <pkg>net-misc/curl</pkg>)</flag>
+ <flag name="gcrypt">Add support for encrypted log files using <pkg>dev-libs/libgcrypt</pkg></flag>
+ <flag name="jemalloc">Use <pkg>dev-libs/jemalloc</pkg> for allocations.</flag>
+ <flag name="kerberos">Build the GSSAPI input and output module (requires <pkg>virtual/krb5</pkg>)</flag>
+ <flag name="mongodb">Build the MongoDB output module (requires <pkg>dev-libs/libmongo-client</pkg>)</flag>
+ <flag name="mysql">Build the MySQL databse output module (requires <pkg>virtual/mysql</pkg>)</flag>
+ <flag name="normalize">Build the normalize modify module (requires <pkg>dev-libs/libee</pkg> and <pkg>dev-libs/liblognorm</pkg>)</flag>
+ <flag name="omudpspoof">Build the udpspoof output module (requires <pkg>net-libs/libnet</pkg>)</flag>
+ <flag name="postgres">Build the PostgreSQL database output module (requires <pkg>dev-db/postgresql-base</pkg>)</flag>
+ <flag name="rabbitmq">Build the RabbitMQ output module (requires <pkg>net-libs/rabbitmq-c</pkg>)</flag>
+ <flag name="redis">Build the Redis output module using (requires <pkg>dev-libs/hiredis</pkg>)</flag>
+ <flag name="relp">Build the Reliable Event Logging Protocol (RELP) output module (requires <pkg>dev-libs/librelp</pkg>)</flag>
+ <flag name="rfc3195">Build the rfc3195 input module (requires <pkg>dev-libs/liblogging</pkg>)</flag>
+ <flag name="rfc5424hmac">Build the rfc5424hmac modify module (requires <pkg>dev-libs/openssl</pkg>)</flag>
+ <flag name="snmp">Build the snmp modify and output module (requires <pkg>net-analyzer/net-snmp</pkg>)</flag>
+ <flag name="ssl">Add support for encrypted client/server communication (requires <pkg>net-libs/gnutls</pkg>)</flag>
+ <flag name="systemd">Build the journal input and output module (requires <pkg>sys-apps/systemd</pkg>)</flag>
+ <flag name="usertools">Installs the user tools (rsgtutil, rscryutil...) corresponding to the set USE flags</flag>
+ <flag name="zeromq">Build the ZeroMQ input and output modules (requires <pkg>net-libs/zeromq</pkg>)</flag>
+ </use>
+ <upstream>
+ <bugs-to>https://github.com/rsyslog/rsyslog/issues</bugs-to>
+ <remote-id type="cpe">cpe:/a:rsyslog:rsyslog</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-admin/rsyslog/rsyslog-8.7.0-r2.ebuild b/app-admin/rsyslog/rsyslog-8.7.0-r2.ebuild
new file mode 100644
index 00000000000..1c72272b520
--- /dev/null
+++ b/app-admin/rsyslog/rsyslog-8.7.0-r2.ebuild
@@ -0,0 +1,413 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+AUTOTOOLS_AUTORECONF=1
+
+inherit autotools-utils eutils systemd
+
+DESCRIPTION="An enhanced multi-threaded syslogd with database support and more"
+HOMEPAGE="http://www.rsyslog.com/"
+
+BRANCH="8-stable"
+
+PATCHES=(
+ "${FILESDIR}"/${BRANCH}/10-respect_CFLAGS-r1.patch
+)
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="
+ git://github.com/rsyslog/${PN}.git
+ https://github.com/rsyslog/${PN}.git
+ "
+
+ DOC_REPO_URI="
+ git://github.com/rsyslog/${PN}-doc.git
+ https://github.com/rsyslog/${PN}-doc.git
+ "
+
+ inherit git-r3
+else
+ SRC_URI="
+ http://www.rsyslog.com/files/download/${PN}/${P}.tar.gz
+ doc? ( http://www.rsyslog.com/files/download/${PN}/${PN}-doc-${PV}.tar.gz )
+ "
+ KEYWORDS="amd64 ~arm hppa x86"
+
+ PATCHES+=( "${FILESDIR}"/${BRANCH}/50-rsyslog-run-queue-persist-test-only-once.patch )
+ PATCHES+=( "${FILESDIR}"/${BRANCH}/50-rsyslog-fix-size-based-legacy-config-statements.patch )
+ PATCHES+=( "${FILESDIR}"/${BRANCH}/50-rsyslog-add-option-to-disable-valgrind-usage-in-testbench.patch )
+fi
+
+LICENSE="GPL-3 LGPL-3 Apache-2.0"
+SLOT="0"
+IUSE="dbi debug doc elasticsearch +gcrypt jemalloc kerberos mongodb mysql normalize omudpspoof postgres rabbitmq redis relp rfc3195 rfc5424hmac snmp ssl systemd test usertools zeromq"
+
+RDEPEND="
+ >=dev-libs/json-c-0.11:=
+ >=dev-libs/libestr-0.1.9
+ >=dev-libs/liblogging-1.0.1:=[stdlog]
+ >=sys-libs/zlib-1.2.5
+ dbi? ( >=dev-db/libdbi-0.8.3 )
+ elasticsearch? ( >=net-misc/curl-7.35.0 )
+ gcrypt? ( >=dev-libs/libgcrypt-1.5.3:= )
+ jemalloc? ( >=dev-libs/jemalloc-3.3.1 )
+ kerberos? ( virtual/krb5 )
+ mongodb? ( >=dev-libs/libmongo-client-0.1.4 )
+ mysql? ( virtual/mysql )
+ normalize? (
+ >=dev-libs/libee-0.4.0
+ >=dev-libs/liblognorm-1.1.0:=
+ )
+ omudpspoof? ( >=net-libs/libnet-1.1.6 )
+ postgres? ( >=dev-db/postgresql-8.4.20:= )
+ rabbitmq? ( >=net-libs/rabbitmq-c-0.3.0 )
+ redis? ( >=dev-libs/hiredis-0.11.0 )
+ relp? ( >=dev-libs/librelp-1.2.5 )
+ rfc3195? ( >=dev-libs/liblogging-1.0.1:=[rfc3195] )
+ rfc5424hmac? ( >=dev-libs/openssl-0.9.8y:= )
+ snmp? ( >=net-analyzer/net-snmp-5.7.2 )
+ ssl? ( >=net-libs/gnutls-2.12.23 )
+ systemd? ( >=sys-apps/systemd-208 )
+ zeromq? ( >=net-libs/czmq-1.2.0 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+if [[ ${PV} == "9999" ]]; then
+ DEPEND+=" doc? ( >=dev-python/sphinx-1.1.3-r7 )"
+fi
+
+# Maitainer note : open a bug to upstream
+# showing that building in a separate dir fails
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+AUTOTOOLS_PRUNE_LIBTOOL_FILES="modules"
+
+DOCS=(
+ AUTHORS
+ ChangeLog
+ "${FILESDIR}"/${BRANCH}/README.gentoo
+)
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]]; then
+ git-r3_fetch
+ git-r3_checkout
+ else
+ unpack ${P}.tar.gz
+ fi
+
+ if use doc; then
+ if [[ ${PV} == "9999" ]]; then
+ local _EGIT_BRANCH=
+ if [ -n "${EGIT_BRANCH}" ]; then
+ # Cannot use rsyslog commits/branches for documentation repository
+ _EGIT_BRANCH=${EGIT_BRANCH}
+ unset EGIT_BRANCH
+ fi
+
+ git-r3_fetch "${DOC_REPO_URI}"
+ git-r3_checkout "${DOC_REPO_URI}" "${S}"/docs
+
+ if [ -n "${_EGIT_BRANCH}" ]; then
+ # Restore previous EGIT_BRANCH information
+ EGIT_BRANCH=${_EGIT_BRANCH}
+ fi
+ else
+ local doc_tarball="${PN}-doc-${PV}.tar.gz"
+
+ cd "${S}" || die "Cannot change dir into '$S'"
+ mkdir docs || die "Failed to create docs directory"
+ cd docs || die "Failed to change dir into '${S}/docs'"
+ unpack ${doc_tarball}
+ fi
+ fi
+}
+
+src_configure() {
+ # Maintainer notes:
+ # * Guardtime support is missing because libgt isn't yet available
+ # in portage.
+ # * Hadoop's HDFS file system output module is currently not
+ # supported in Gentoo because nobody is able to test it
+ # (JAVA dependency).
+ # * dev-libs/hiredis doesn't provide pkg-config (see #504614,
+ # upstream PR 129 and 136) so we need to export HIREDIS_*
+ # variables because rsyslog's build system depends on pkg-config.
+
+ if use redis; then
+ export HIREDIS_LIBS="-L${EPREFIX}/usr/$(get_libdir) -lhiredis"
+ export HIREDIS_CFLAGS="-I${EPREFIX}/usr/include"
+ fi
+
+ local myeconfargs=(
+ --disable-generate-man-pages
+ --without-valgrind-testbench
+ $(use_enable test testbench)
+ # Input Plugins without depedencies
+ --enable-imdiag
+ --enable-imfile
+ --enable-impstats
+ --enable-imptcp
+ # Message Modificiation Plugins without depedencies
+ --enable-mmanon
+ --enable-mmaudit
+ --enable-mmfields
+ --enable-mmjsonparse
+ --enable-mmpstrucdata
+ --enable-mmsequence
+ --enable-mmutf8fix
+ # Output Modification Plugins without dependencies
+ --enable-mail
+ --enable-omprog
+ --enable-omruleset
+ --enable-omstdout
+ --enable-omuxsock
+ # Misc
+ --enable-pmaixforwardedfrom
+ --enable-pmciscoios
+ --enable-pmcisconames
+ --enable-pmlastmsg
+ --enable-pmsnare
+ # DB
+ $(use_enable dbi libdbi)
+ $(use_enable mongodb ommongodb)
+ $(use_enable mysql)
+ $(use_enable postgres pgsql)
+ $(use_enable redis omhiredis)
+ # Debug
+ $(use_enable debug)
+ $(use_enable debug diagtools)
+ $(use_enable debug memcheck)
+ $(use_enable debug rtinst)
+ $(use_enable debug valgrind)
+ # Misc
+ $(use_enable elasticsearch)
+ $(use_enable gcrypt libgcrypt)
+ $(use_enable jemalloc)
+ $(use_enable kerberos gssapi-krb5)
+ $(use_enable normalize mmnormalize)
+ $(use_enable omudpspoof)
+ $(use_enable rabbitmq omrabbitmq)
+ $(use_enable relp)
+ $(use_enable rfc3195)
+ $(use_enable rfc5424hmac mmrfc5424addhmac)
+ $(use_enable snmp)
+ $(use_enable snmp mmsnmptrapd)
+ $(use_enable ssl gnutls)
+ $(use_enable systemd imjournal)
+ $(use_enable systemd omjournal)
+ $(use_enable usertools)
+ $(use_enable zeromq imzmq3)
+ $(use_enable zeromq omzmq3)
+ "$(systemd_with_unitdir)"
+ )
+
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile
+
+ if use doc && [[ "${PV}" == "9999" ]]; then
+ einfo "Building documentation ..."
+ local doc_dir="${S}/docs"
+ cd "${doc_dir}" || die "Cannot chdir into \"${doc_dir}\"!"
+ sphinx-build -b html source build || die "Building documentation failed!"
+ fi
+}
+
+src_test() {
+ local _has_increased_ulimit=
+
+ if ulimit -n 3072; then
+ _has_increased_ulimit="true"
+ fi
+
+ if ! emake --jobs 1 check; then
+ eerror "Test suite failed! :("
+
+ if [ -z "${_has_increased_ulimit}" ]; then
+ eerror "Probably because open file limit couldn't be set to 3072."
+ fi
+
+ if has userpriv $FEATURES; then
+ eerror "Please try to reproduce the test suite failure with FEATURES=-userpriv " \
+ "before you submit a bug report."
+ fi
+
+ fi
+}
+
+src_install() {
+ use doc && HTML_DOCS=( "${S}/docs/build/" )
+ autotools-utils_src_install
+
+ newconfd "${FILESDIR}/${BRANCH}/${PN}.confd" ${PN}
+ newinitd "${FILESDIR}/${BRANCH}/${PN}.initd" ${PN}
+
+ keepdir /var/empty/dev
+ keepdir /var/spool/${PN}
+ keepdir /etc/ssl/${PN}
+ keepdir /etc/${PN}.d
+
+ insinto /etc
+ newins "${FILESDIR}/${BRANCH}/${PN}.conf" ${PN}.conf
+
+ insinto /etc/rsyslog.d/
+ doins "${FILESDIR}/${BRANCH}/50-default.conf"
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/${BRANCH}/${PN}.logrotate" ${PN}
+
+ if use mysql; then
+ insinto /usr/share/doc/${PF}/scripts/mysql
+ doins plugins/ommysql/createDB.sql
+ fi
+
+ if use postgres; then
+ insinto /usr/share/doc/${PF}/scripts/pgsql
+ doins plugins/ompgsql/createDB.sql
+ fi
+}
+
+pkg_postinst() {
+ local advertise_readme=0
+
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ # This is a new installation
+
+ advertise_readme=1
+
+ if use mysql || use postgres; then
+ echo
+ elog "Sample SQL scripts for MySQL & PostgreSQL have been installed to:"
+ elog " /usr/share/doc/${PF}/scripts"
+ fi
+
+ if use ssl; then
+ echo
+ elog "To create a default CA and certificates for your server and clients, run:"
+ elog " emerge --config =${PF}"
+ elog "on your logging server. You can run it several times,"
+ elog "once for each logging client. The client certificates will be signed"
+ elog "using the CA certificate generated during the first run."
+ fi
+ fi
+
+ if [[ -z "${REPLACING_VERSIONS}" ]] || [[ ${REPLACING_VERSIONS} < 8.0 ]]; then
+ # Show this message until rsyslog-8.x
+ echo
+ elog "Since ${PN}-7.6.3 we no longer use the catch-all log target"
+ elog "\"/var/log/syslog\" due to its redundancy to the other log targets."
+
+ advertise_readme=1
+ fi
+
+ if [[ ${advertise_readme} -gt 0 ]]; then
+ # We need to show the README file location
+
+ echo ""
+ elog "Please read"
+ elog ""
+ elog " ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"
+ elog ""
+ elog "for more details."
+ fi
+}
+
+pkg_config() {
+ if ! use ssl ; then
+ einfo "There is nothing to configure for rsyslog unless you"
+ einfo "used USE=ssl to build it."
+ return 0
+ fi
+
+ # Make sure the certificates directory exists
+ CERTDIR="${EROOT}/etc/ssl/${PN}"
+ if [ ! -d "${CERTDIR}" ]; then
+ mkdir "${CERTDIR}" || die
+ fi
+ einfo "Your certificates will be stored in ${CERTDIR}"
+
+ # Create a default CA if needed
+ if [ ! -f "${CERTDIR}/${PN}_ca.cert.pem" ]; then
+ einfo "No CA key and certificate found in ${CERTDIR}, creating them for you..."
+ certtool --generate-privkey \
+ --outfile "${CERTDIR}/${PN}_ca.privkey.pem" &>/dev/null
+ chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
+
+ cat > "${T}/${PF}.$$" <<- _EOF
+ cn = Portage automated CA
+ ca
+ cert_signing_key
+ expiration_days = 3650
+ _EOF
+
+ certtool --generate-self-signed \
+ --load-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
+ --outfile "${CERTDIR}/${PN}_ca.cert.pem" \
+ --template "${T}/${PF}.$$" &>/dev/null
+ chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
+
+ # Create the server certificate
+ echo
+ einfon "Please type the Common Name of the SERVER you wish to create a certificate for: "
+ read -r CN
+
+ einfo "Creating private key and certificate for server ${CN}..."
+ certtool --generate-privkey \
+ --outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
+ chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
+
+ cat > "${T}/${PF}.$$" <<- _EOF
+ cn = ${CN}
+ tls_www_server
+ dns_name = ${CN}
+ expiration_days = 3650
+ _EOF
+
+ certtool --generate-certificate \
+ --outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
+ --load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
+ --load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
+ --load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
+ --template "${T}/${PF}.$$" &>/dev/null
+ chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
+
+ else
+ einfo "Found existing ${CERTDIR}/${PN}_ca.cert.pem, skipping CA and SERVER creation."
+ fi
+
+ # Create a client certificate
+ echo
+ einfon "Please type the Common Name of the CLIENT you wish to create a certificate for: "
+ read -r CN
+
+ einfo "Creating private key and certificate for client ${CN}..."
+ certtool --generate-privkey \
+ --outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
+ chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
+
+ cat > "${T}/${PF}.$$" <<- _EOF
+ cn = ${CN}
+ tls_www_client
+ dns_name = ${CN}
+ expiration_days = 3650
+ _EOF
+
+ certtool --generate-certificate \
+ --outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
+ --load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
+ --load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
+ --load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
+ --template "${T}/${PF}.$$" &>/dev/null
+ chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
+
+ rm -f "${T}/${PF}.$$"
+
+ echo
+ einfo "Here is the documentation on how to encrypt your log traffic:"
+ einfo " http://www.rsyslog.com/doc/rsyslog_tls.html"
+}
diff --git a/app-admin/rsyslog/rsyslog-8.9.0.ebuild b/app-admin/rsyslog/rsyslog-8.9.0.ebuild
new file mode 100644
index 00000000000..eca7028bdcc
--- /dev/null
+++ b/app-admin/rsyslog/rsyslog-8.9.0.ebuild
@@ -0,0 +1,409 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+AUTOTOOLS_AUTORECONF=1
+
+inherit autotools-utils eutils systemd
+
+DESCRIPTION="An enhanced multi-threaded syslogd with database support and more"
+HOMEPAGE="http://www.rsyslog.com/"
+
+BRANCH="8-stable"
+
+PATCHES=(
+ "${FILESDIR}"/${BRANCH}/10-respect_CFLAGS-r1.patch
+)
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="
+ git://github.com/rsyslog/${PN}.git
+ https://github.com/rsyslog/${PN}.git
+ "
+
+ DOC_REPO_URI="
+ git://github.com/rsyslog/${PN}-doc.git
+ https://github.com/rsyslog/${PN}-doc.git
+ "
+
+ inherit git-r3
+else
+ SRC_URI="
+ http://www.rsyslog.com/files/download/${PN}/${P}.tar.gz
+ doc? ( http://www.rsyslog.com/files/download/${PN}/${PN}-doc-${PV}.tar.gz )
+ "
+ KEYWORDS="~amd64 ~arm ~hppa ~x86"
+fi
+
+LICENSE="GPL-3 LGPL-3 Apache-2.0"
+SLOT="0"
+IUSE="dbi debug doc elasticsearch +gcrypt jemalloc kerberos mongodb mysql normalize omudpspoof postgres rabbitmq redis relp rfc3195 rfc5424hmac snmp ssl systemd test usertools zeromq"
+
+RDEPEND="
+ >=dev-libs/json-c-0.11:=
+ >=dev-libs/libestr-0.1.9
+ >=dev-libs/liblogging-1.0.1:=[stdlog]
+ >=sys-libs/zlib-1.2.5
+ dbi? ( >=dev-db/libdbi-0.8.3 )
+ elasticsearch? ( >=net-misc/curl-7.35.0 )
+ gcrypt? ( >=dev-libs/libgcrypt-1.5.3:= )
+ jemalloc? ( >=dev-libs/jemalloc-3.3.1 )
+ kerberos? ( virtual/krb5 )
+ mongodb? ( >=dev-libs/libmongo-client-0.1.4 )
+ mysql? ( virtual/mysql )
+ normalize? (
+ >=dev-libs/libee-0.4.0
+ >=dev-libs/liblognorm-1.1.0:=
+ )
+ omudpspoof? ( >=net-libs/libnet-1.1.6 )
+ postgres? ( >=dev-db/postgresql-8.4.20:= )
+ rabbitmq? ( >=net-libs/rabbitmq-c-0.3.0 )
+ redis? ( >=dev-libs/hiredis-0.11.0 )
+ relp? ( >=dev-libs/librelp-1.2.5 )
+ rfc3195? ( >=dev-libs/liblogging-1.0.1:=[rfc3195] )
+ rfc5424hmac? ( >=dev-libs/openssl-0.9.8y:= )
+ snmp? ( >=net-analyzer/net-snmp-5.7.2 )
+ ssl? ( >=net-libs/gnutls-2.12.23 )
+ systemd? ( >=sys-apps/systemd-208 )
+ zeromq? ( >=net-libs/czmq-1.2.0 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+if [[ ${PV} == "9999" ]]; then
+ DEPEND+=" doc? ( >=dev-python/sphinx-1.1.3-r7 )"
+fi
+
+# Maitainer note : open a bug to upstream
+# showing that building in a separate dir fails
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+AUTOTOOLS_PRUNE_LIBTOOL_FILES="modules"
+
+DOCS=(
+ AUTHORS
+ ChangeLog
+ "${FILESDIR}"/${BRANCH}/README.gentoo
+)
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]]; then
+ git-r3_fetch
+ git-r3_checkout
+ else
+ unpack ${P}.tar.gz
+ fi
+
+ if use doc; then
+ if [[ ${PV} == "9999" ]]; then
+ local _EGIT_BRANCH=
+ if [ -n "${EGIT_BRANCH}" ]; then
+ # Cannot use rsyslog commits/branches for documentation repository
+ _EGIT_BRANCH=${EGIT_BRANCH}
+ unset EGIT_BRANCH
+ fi
+
+ git-r3_fetch "${DOC_REPO_URI}"
+ git-r3_checkout "${DOC_REPO_URI}" "${S}"/docs
+
+ if [ -n "${_EGIT_BRANCH}" ]; then
+ # Restore previous EGIT_BRANCH information
+ EGIT_BRANCH=${_EGIT_BRANCH}
+ fi
+ else
+ local doc_tarball="${PN}-doc-${PV}.tar.gz"
+
+ cd "${S}" || die "Cannot change dir into '$S'"
+ mkdir docs || die "Failed to create docs directory"
+ cd docs || die "Failed to change dir into '${S}/docs'"
+ unpack ${doc_tarball}
+ fi
+ fi
+}
+
+src_configure() {
+ # Maintainer notes:
+ # * Guardtime support is missing because libgt isn't yet available
+ # in portage.
+ # * Hadoop's HDFS file system output module is currently not
+ # supported in Gentoo because nobody is able to test it
+ # (JAVA dependency).
+ # * dev-libs/hiredis doesn't provide pkg-config (see #504614,
+ # upstream PR 129 and 136) so we need to export HIREDIS_*
+ # variables because rsyslog's build system depends on pkg-config.
+
+ if use redis; then
+ export HIREDIS_LIBS="-L${EPREFIX}/usr/$(get_libdir) -lhiredis"
+ export HIREDIS_CFLAGS="-I${EPREFIX}/usr/include"
+ fi
+
+ local myeconfargs=(
+ --disable-generate-man-pages
+ --without-valgrind-testbench
+ $(use_enable test testbench)
+ # Input Plugins without depedencies
+ --enable-imdiag
+ --enable-imfile
+ --enable-impstats
+ --enable-imptcp
+ # Message Modificiation Plugins without depedencies
+ --enable-mmanon
+ --enable-mmaudit
+ --enable-mmfields
+ --enable-mmjsonparse
+ --enable-mmpstrucdata
+ --enable-mmsequence
+ --enable-mmutf8fix
+ # Output Modification Plugins without dependencies
+ --enable-mail
+ --enable-omprog
+ --enable-omruleset
+ --enable-omstdout
+ --enable-omuxsock
+ # Misc
+ --enable-pmaixforwardedfrom
+ --enable-pmciscoios
+ --enable-pmcisconames
+ --enable-pmlastmsg
+ --enable-pmsnare
+ # DB
+ $(use_enable dbi libdbi)
+ $(use_enable mongodb ommongodb)
+ $(use_enable mysql)
+ $(use_enable postgres pgsql)
+ $(use_enable redis omhiredis)
+ # Debug
+ $(use_enable debug)
+ $(use_enable debug diagtools)
+ $(use_enable debug memcheck)
+ $(use_enable debug rtinst)
+ $(use_enable debug valgrind)
+ # Misc
+ $(use_enable elasticsearch)
+ $(use_enable gcrypt libgcrypt)
+ $(use_enable jemalloc)
+ $(use_enable kerberos gssapi-krb5)
+ $(use_enable normalize mmnormalize)
+ $(use_enable omudpspoof)
+ $(use_enable rabbitmq omrabbitmq)
+ $(use_enable relp)
+ $(use_enable rfc3195)
+ $(use_enable rfc5424hmac mmrfc5424addhmac)
+ $(use_enable snmp)
+ $(use_enable snmp mmsnmptrapd)
+ $(use_enable ssl gnutls)
+ $(use_enable systemd imjournal)
+ $(use_enable systemd omjournal)
+ $(use_enable usertools)
+ $(use_enable zeromq imzmq3)
+ $(use_enable zeromq omzmq3)
+ "$(systemd_with_unitdir)"
+ )
+
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile
+
+ if use doc && [[ "${PV}" == "9999" ]]; then
+ einfo "Building documentation ..."
+ local doc_dir="${S}/docs"
+ cd "${doc_dir}" || die "Cannot chdir into \"${doc_dir}\"!"
+ sphinx-build -b html source build || die "Building documentation failed!"
+ fi
+}
+
+src_test() {
+ local _has_increased_ulimit=
+
+ if ulimit -n 3072; then
+ _has_increased_ulimit="true"
+ fi
+
+ if ! emake --jobs 1 check; then
+ eerror "Test suite failed! :("
+
+ if [ -z "${_has_increased_ulimit}" ]; then
+ eerror "Probably because open file limit couldn't be set to 3072."
+ fi
+
+ if has userpriv $FEATURES; then
+ eerror "Please try to reproduce the test suite failure with FEATURES=-userpriv " \
+ "before you submit a bug report."
+ fi
+
+ fi
+}
+
+src_install() {
+ use doc && HTML_DOCS=( "${S}/docs/build/" )
+ autotools-utils_src_install
+
+ newconfd "${FILESDIR}/${BRANCH}/${PN}.confd" ${PN}
+ newinitd "${FILESDIR}/${BRANCH}/${PN}.initd" ${PN}
+
+ keepdir /var/empty/dev
+ keepdir /var/spool/${PN}
+ keepdir /etc/ssl/${PN}
+ keepdir /etc/${PN}.d
+
+ insinto /etc
+ newins "${FILESDIR}/${BRANCH}/${PN}.conf" ${PN}.conf
+
+ insinto /etc/rsyslog.d/
+ doins "${FILESDIR}/${BRANCH}/50-default.conf"
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/${BRANCH}/${PN}.logrotate" ${PN}
+
+ if use mysql; then
+ insinto /usr/share/doc/${PF}/scripts/mysql
+ doins plugins/ommysql/createDB.sql
+ fi
+
+ if use postgres; then
+ insinto /usr/share/doc/${PF}/scripts/pgsql
+ doins plugins/ompgsql/createDB.sql
+ fi
+}
+
+pkg_postinst() {
+ local advertise_readme=0
+
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ # This is a new installation
+
+ advertise_readme=1
+
+ if use mysql || use postgres; then
+ echo
+ elog "Sample SQL scripts for MySQL & PostgreSQL have been installed to:"
+ elog " /usr/share/doc/${PF}/scripts"
+ fi
+
+ if use ssl; then
+ echo
+ elog "To create a default CA and certificates for your server and clients, run:"
+ elog " emerge --config =${PF}"
+ elog "on your logging server. You can run it several times,"
+ elog "once for each logging client. The client certificates will be signed"
+ elog "using the CA certificate generated during the first run."
+ fi
+ fi
+
+ if [[ -z "${REPLACING_VERSIONS}" ]] || [[ ${REPLACING_VERSIONS} < 8.0 ]]; then
+ # Show this message until rsyslog-8.x
+ echo
+ elog "Since ${PN}-7.6.3 we no longer use the catch-all log target"
+ elog "\"/var/log/syslog\" due to its redundancy to the other log targets."
+
+ advertise_readme=1
+ fi
+
+ if [[ ${advertise_readme} -gt 0 ]]; then
+ # We need to show the README file location
+
+ echo ""
+ elog "Please read"
+ elog ""
+ elog " ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"
+ elog ""
+ elog "for more details."
+ fi
+}
+
+pkg_config() {
+ if ! use ssl ; then
+ einfo "There is nothing to configure for rsyslog unless you"
+ einfo "used USE=ssl to build it."
+ return 0
+ fi
+
+ # Make sure the certificates directory exists
+ CERTDIR="${EROOT}/etc/ssl/${PN}"
+ if [ ! -d "${CERTDIR}" ]; then
+ mkdir "${CERTDIR}" || die
+ fi
+ einfo "Your certificates will be stored in ${CERTDIR}"
+
+ # Create a default CA if needed
+ if [ ! -f "${CERTDIR}/${PN}_ca.cert.pem" ]; then
+ einfo "No CA key and certificate found in ${CERTDIR}, creating them for you..."
+ certtool --generate-privkey \
+ --outfile "${CERTDIR}/${PN}_ca.privkey.pem" &>/dev/null
+ chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
+
+ cat > "${T}/${PF}.$$" <<- _EOF
+ cn = Portage automated CA
+ ca
+ cert_signing_key
+ expiration_days = 3650
+ _EOF
+
+ certtool --generate-self-signed \
+ --load-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
+ --outfile "${CERTDIR}/${PN}_ca.cert.pem" \
+ --template "${T}/${PF}.$$" &>/dev/null
+ chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
+
+ # Create the server certificate
+ echo
+ einfon "Please type the Common Name of the SERVER you wish to create a certificate for: "
+ read -r CN
+
+ einfo "Creating private key and certificate for server ${CN}..."
+ certtool --generate-privkey \
+ --outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
+ chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
+
+ cat > "${T}/${PF}.$$" <<- _EOF
+ cn = ${CN}
+ tls_www_server
+ dns_name = ${CN}
+ expiration_days = 3650
+ _EOF
+
+ certtool --generate-certificate \
+ --outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
+ --load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
+ --load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
+ --load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
+ --template "${T}/${PF}.$$" &>/dev/null
+ chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
+
+ else
+ einfo "Found existing ${CERTDIR}/${PN}_ca.cert.pem, skipping CA and SERVER creation."
+ fi
+
+ # Create a client certificate
+ echo
+ einfon "Please type the Common Name of the CLIENT you wish to create a certificate for: "
+ read -r CN
+
+ einfo "Creating private key and certificate for client ${CN}..."
+ certtool --generate-privkey \
+ --outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
+ chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
+
+ cat > "${T}/${PF}.$$" <<- _EOF
+ cn = ${CN}
+ tls_www_client
+ dns_name = ${CN}
+ expiration_days = 3650
+ _EOF
+
+ certtool --generate-certificate \
+ --outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
+ --load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
+ --load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
+ --load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
+ --template "${T}/${PF}.$$" &>/dev/null
+ chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
+
+ rm -f "${T}/${PF}.$$"
+
+ echo
+ einfo "Here is the documentation on how to encrypt your log traffic:"
+ einfo " http://www.rsyslog.com/doc/rsyslog_tls.html"
+}