Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 501988 | Differences between
and this patch

Collapse All | Expand All

(-)old/app-admin/rsyslog/files/7-stable/bugfix_52.patch (+100 lines)
Line 0 Link Here
1
From b017e29aad70702c69e6016b07a932b7825a83e5 Mon Sep 17 00:00:00 2001
2
From: Thomas D <whissi@whissi.de>
3
Date: Sat, 3 May 2014 14:45:25 +0200
4
Subject: [PATCH] Remove "--enable-cached-man-pages" switch and make rst2man
5
 optional when required man pages already exist
6
7
This commit backports the bugfix for issue #52 for the v7-stable branch.
8
---
9
 configure.ac | 61 +++++++++++++++++++++++++++++++++++-------------------------
10
 1 file changed, 36 insertions(+), 25 deletions(-)
11
12
diff --git a/configure.ac b/configure.ac
13
index 0dd40c2..07d96dd 100644
14
--- a/configure.ac
15
+++ b/configure.ac
16
@@ -1087,30 +1087,6 @@ fi
17
 AM_CONDITIONAL(ENABLE_GUARDTIME, test x$enable_guardtime = xyes)
18
 
19
 
20
-# Support using cached man file copies, to avoid the need for rst2man
21
-# in the build environment
22
-AC_ARG_ENABLE(cached_man_pages,
23
-        [AS_HELP_STRING([--enable-cached-man-pages],[Enable using cached versions of man files (avoid rst2man) @<:@default=no@:>@])],
24
-        [case "${enableval}" in
25
-         yes) enable_cached_man_pages="yes" ;;
26
-          no) enable_cached_man_pages="no" ;;
27
-           *) AC_MSG_ERROR(bad value ${enableval} for --enable-cached-man-pages) ;;
28
-         esac],
29
-        [enable_cached_man_pages=no]
30
-)
31
-if test "x$enable_cached_man_pages" = "xno"; then
32
-# obtain path for rst2man
33
-  if test "x$enable_libgcrypt" = "xyes" || \
34
-     test "x$enable_guardtime" = "xyes"; then
35
-        AC_PATH_PROG([RST2MAN], [rst2man])
36
-        if test "x${RST2MAN}" == "x"; then
37
-            AC_MSG_FAILURE([rst2man not found in PATH])
38
-        fi
39
-  fi
40
-fi
41
-
42
-
43
-
44
 # RFC 3195 support
45
 AC_ARG_ENABLE(rfc3195,
46
         [AS_HELP_STRING([--enable-rfc3195],[Enable RFC3195 support @<:@default=no@:>@])],
47
@@ -1519,6 +1495,41 @@ AM_CONDITIONAL(ENABLE_OMHIREDIS, test x$enable_omhiredis = xyes)
48
 
49
 # END HIREDIS SUPPORT
50
 
51
+
52
+AC_CHECKING([if required man pages already exist])
53
+have_to_generate_man_pages="no"
54
+
55
+# man pages for libgcrypt module
56
+if test "x$enable_usertools" = "xyes" && test "x$enable_libgcrypt" = "xyes"; then
57
+    AC_CHECK_FILES(["tools/rscryutil.1" "tools/rsgtutil.1"],
58
+        [],
59
+        [have_to_generate_man_pages="yes"]
60
+    )
61
+fi
62
+
63
+# man pages for GuardTime module
64
+if test "x$enable_usertools" = "xyes" && test "x$enable_guardtime" = "xyes"; then
65
+    AC_CHECK_FILES(["tools/rscryutil.1" "tools/rsgtutil.1"],
66
+        [],
67
+        [have_to_generate_man_pages="yes"]
68
+    )
69
+fi
70
+
71
+if test "x$have_to_generate_man_pages" = "xyes"; then
72
+    AC_MSG_RESULT([Some man pages are missing. We need rst2man to generate the missing man pages from source...])
73
+else
74
+    AC_MSG_RESULT([All required man pages found. We don't need rst2man!])
75
+fi
76
+
77
+if test "x$have_to_generate_man_pages" = "xyes"; then
78
+    # We need rst2man to generate our man pages
79
+    AC_CHECK_PROGS([RST2MAN], [rst2man rst2man.py], [])
80
+    if test -z "$RST2MAN"; then
81
+        AC_MSG_ERROR([rst2man is required to build man pages. You can use the release tarball with pregenerated man pages to avoid this depedency.])
82
+    fi
83
+fi
84
+
85
+
86
 AC_CONFIG_FILES([Makefile \
87
 		runtime/Makefile \
88
 		compat/Makefile \
89
@@ -1594,7 +1605,7 @@ echo "    Zlib compression support enabled:         $enable_zlib"
90
 echo "    rsyslog runtime will be built:            $enable_rsyslogrt"
91
 echo "    rsyslogd will be built:                   $enable_rsyslogd"
92
 echo "    GUI components will be built:             $enable_gui"
93
-echo "    cached man files will be used:            $enable_cached_man_pages"
94
+echo "    have to generate man pages:               $have_to_generate_man_pages"
95
 echo "    Unlimited select() support enabled:       $enable_unlimited_select"
96
 echo "    uuid support enabled:                     $enable_uuid"
97
 echo "    Log file signing support:                 $enable_guardtime"
98
-- 
99
1.9.2
100
(-)old/app-admin/rsyslog/files/7-stable/default.conf (+102 lines)
Line 0 Link Here
1
This patch will update the pre-generated rscryutil man page from the release
2
tarball so we don't need to depend on dev-python/docutils.
3
4
https://github.com/rsyslog/rsyslog/issues/73
5
6
diff -rupN old/rsyslog-7.6.3/tools/rscryutil.1 new/rsyslog-7.6.3/tools/rscryutil.1
7
--- old/rsyslog-7.6.3/tools/rscryutil.1	2013-10-29 16:31:21.000000000 +0100
Line 0 Link Here
1
#######################
2
### DEFAULT ACTIONS ###
3
#######################
4
5
auth,authpriv.* action(
6
	type="omfile"
7
	File="/var/log/auth.log"
8
	FileCreateMode="0600"
9
	FileOwner="root"
10
	FileGroup="adm"
11
	Sync="off"
12
)
13
14
cron.* action(
15
	type="omfile"
16
	File="/var/log/cron.log"
17
	FileOwner="root"
18
	FileGroup="adm"
19
)
20
21
daemon.* action(
22
	type="omfile"
23
	File="/var/log/daemon.log"
24
	FileOwner="root"
25
	FileGroup="adm"
26
)
27
28
kern.* action(
29
	type="omfile"
30
	File="/var/log/kern.log"
31
	FileOwner="root"
32
	FileGroup="adm"
33
)
34
35
lpr.* action(
36
	type="omfile"
37
	File="/var/log/lpr.log"
38
	FileOwner="root"
39
	FileGroup="adm"
40
)
41
42
mail.* action(
43
	type="omfile"
44
	File="/var/log/mail.log"
45
	FileOwner="root"
46
	FileGroup="adm"
47
)
48
49
news.* action(
50
	type="omfile"
51
	File="/var/log/news.log"
52
	FileOwner="root"
53
	FileGroup="adm"
54
)
55
56
user.* action(
57
	type="omfile"
58
	File="/var/log/user.log"
59
	FileOwner="root"
60
	FileGroup="adm"
61
)
62
63
*.=debug;auth,authpriv,news,mail.none action(
64
	type="omfile"
65
	File="/var/log/debug.log"
66
	FileOwner="root"
67
	FileGroup="adm"
68
)
69
70
*.info;auth,authpriv,cron,daemon,lpr,mail,news.none action(
71
	type="omfile"
72
	File="/var/log/messages"
73
	FileOwner="root"
74
	FileGroup="adm"
75
)
76
77
# Uncomment the following directive to re-enable the
78
# deprecated "/var/log/syslog" log file (don't forget to re-enable log
79
# rotation in "/etc/logrotate.d/rsyslog" if you do that!)
80
#*.*;auth,authpriv.none action(
81
#	type="omfile"
82
#	File="/var/log/syslog"
83
#	FileOwner="root"
84
#	FileGroup="adm"
85
#)
86
87
*.emerg action(
88
	type="omusrmsg"
89
	Users="*"
90
	action.execOnlyOnceEveryInterval="10"
91
)
92
93
# Create an additional socket for the default chroot location
94
# (used by net-misc/openssh[hpn], see https://bugs.gentoo.org/490744)
95
input(type="imuxsock" Socket="/var/empty/dev/log")
(-)old/app-admin/rsyslog/files/7-stable/fix-omruleset-default-value.patch (+25 lines)
Line 0 Link Here
1
From 14f3b45151864aa4170de515f406a69ad2931eba Mon Sep 17 00:00:00 2001
2
From: Rainer Gerhards <rgerhards@adiscon.com>
3
Date: Thu, 31 Oct 2013 18:21:47 +0100
4
Subject: [PATCH] module omruleset is no longer enabled by default.
5
6
Note that it has been deprecated in v7 and been replaced by the "call"
7
statement. Also, it can still be build without problems, the option must
8
just explicitely be given.
9
---
10
diff --git a/configure.ac b/configure.ac
11
index 3abd559..de4c3ea 100644
12
--- a/configure.ac
13
+++ b/configure.ac
14
@@ -1353,7 +1353,7 @@ AC_ARG_ENABLE(omruleset,
15
           no) enable_omruleset="no" ;;
16
            *) AC_MSG_ERROR(bad value ${enableval} for --enable-omruleset) ;;
17
          esac],
18
-        [enable_omruleset=yes]
19
+        [enable_omruleset=no]
20
 )
21
 AM_CONDITIONAL(ENABLE_OMRULESET, test x$enable_omruleset = xyes)
22
 
23
-- 
24
1.9.1
25
(-)old/app-admin/rsyslog/files/7-stable/README.gentoo (+36 lines)
Line 0 Link Here
1
Introduction
2
============
3
4
Since rsyslog version 7.6 we are shipping a new default Gentoo
5
configuration. See bug #501982 to learn more about what we were trying to
6
achieve by rewriting the entire configuration.
7
8
9
Important changes
10
=================
11
12
1. "/var/log/syslog" log file is now deprecated
13
14
   Beginning with rsyslog-7.6, the "/var/log/syslog" log file will no
15
   longer being written per default. We are considering this file as
16
   deprecated/obsolet for the typical user/system.
17
   The content from this log file is still availble through other
18
   (dedicated) log files, see
19
   
20
     - /var/log/cron.log
21
     - /var/log/daemon.log
22
     - /var/log/mail.log
23
     - /var/log/messages
24
   
25
   If you really need the old "/var/log/syslog" log file, all you have to
26
   do is uncommenting the corresponding configuration directive in
27
   "/etc/rsyslog.d/50-default.conf".
28
   
29
   If you do so, don't forget to re-enable log rotation in
30
   "/etc/logrotate.d/rsyslog", too.
31
32
33
2. An additional input socket in "/var/empty/dev/log" (default chroot
34
   location) will be created per default
35
36
   See bug #490744 for further details.
(-)old/app-admin/rsyslog/files/7-stable/rsyslog.conf (+61 lines)
Line 0 Link Here
1
# /etc/rsyslog.conf
2
# 
3
# This configuration is based on RainerScript, the new recommended syntax
4
# for RSYSLOG. See http://www.rsyslog.com/doc/rainerscript.html for further
5
# details.
6
# 
7
# But if you don't want to learn something new at moment, don't worry: The
8
# legacy syntax is still supported.
9
# 
10
# You may want to use the new RSYSLOG configuration builder to create your
11
# own more advanced configuration: http://www.rsyslog.com/rsyslog-configuration-builder/
12
13
# Check config syntax on startup and abort if unclean (default: off)
14
#$AbortOnUncleanConfig on
15
16
17
###############
18
### MODULES ###
19
###############
20
21
# Read syslog messages from default Unix socket /dev/log (e.g. via logger command)
22
module(load="imuxsock")
23
24
# Read messages from the kernel log and submits them to the syslog engine
25
module(load="imklog")
26
27
# Inject "--MARK--" messages every $Interval (seconds)
28
#module(load="immark" Interval="600")
29
30
# Read syslog messages from UDP
31
#module(load="imudp")
32
#input(type="imudp" port="514")
33
34
# Read syslog messages from TCP
35
#module(load="imtcp")
36
#input(type="imtcp" port="514")
37
38
39
#########################
40
### GLOBAL DIRECTIVES ###
41
#########################
42
43
# Where to place spool and state files
44
$WorkDirectory /var/spool/rsyslog
45
46
# Reduce repeating messages (default: off)
47
#$RepeatedMsgReduction on
48
49
# Set defaults for every output file
50
$Umask 0022
51
52
module(
53
	load="builtin:omfile"
54
	Template="RSYSLOG_TraditionalFileFormat"
55
	FileCreateMode="0644"
56
	DirCreateMode="0755"
57
)
58
59
60
# Include all conf files in /etc/rsyslog.d/
61
$IncludeConfig /etc/rsyslog.d/*.conf
(-)old/app-admin/rsyslog/files/7-stable/rsyslog.confd-r1 (+30 lines)
Line 0 Link Here
1
# /etc/conf.d/rsyslog
2
3
# Configuration file
4
RSYSLOG_CONFIGFILE="/etc/rsyslog.conf"
5
6
# PID file
7
# If you should ever change this, remember to update
8
# "/etc/logrotate.d/rsyslog", too.
9
RSYSLOG_PIDFILE="/run/rsyslogd.pid"
10
11
# You can use this configuration option to pass additional options to the
12
# start-stop-daemon, see start-stop-daemon(8) for more details.
13
# Per default we wait 1000ms after we have started the service to ensure
14
# that the daemon is really up and running.
15
RSYSLOG_SSDARGS="--wait 1000"
16
17
# The termination timeout (start-stop-daemon parameter "retry") ensures
18
# that the service will be terminated within a given time (60 + 5 seconds
19
# per default) when you are stopping the service.
20
# You need to increase the value when you are working with a large queue.
21
# See http://www.rsyslog.com/doc/queues.html for further information.
22
RSYSLOG_TERMTIMEOUT="TERM/60/KILL/5"
23
24
25
# Options to rsyslogd
26
# See rsyslogd(8) for more details
27
# Notes:
28
# * Do not specify another PIDFILE but use the variable above to change the location
29
# * Do not specify another CONFIGFILE but use the variable above to change the location
30
RSYSLOG_OPTS=""
(-)old/app-admin/rsyslog/files/7-stable/rsyslog.initd-r1 (+69 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2014 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: $
5
6
RSYSLOG_CONFIGFILE=${RSYSLOG_CONFIGFILE:-"/etc/rsyslog.conf"}
7
RSYSLOG_PIDFILE=${RSYSLOG_PIDFILE:-"/run/rsyslogd.pid"}
8
9
command="/usr/sbin/rsyslogd"
10
command_args="${RSYSLOG_OPTS} -f ${RSYSLOG_CONFIGFILE} -i ${RSYSLOG_PIDFILE}"
11
start_stop_daemon_args="${RSYSLOG_SSDARGS}"
12
pidfile="${RSYSLOG_PIDFILE}"
13
retry="${RSYSLOG_TERMTIMEOUT}"
14
15
required_files=( "${RSYSLOG_CONFIGFILE}" )
16
17
description="RSYSLOG is the rocket-fast system for log processing (syslog replacement)."
18
19
extra_commands="configtest"
20
extra_started_commands="rotate"
21
22
description_configtest="Run rsyslogd's internal config check."
23
24
description_rotate="Sends rsyslogd a signal to re-open its log files."
25
26
depend() {
27
	need clock hostname localmount
28
	provide logger
29
}
30
31
start_pre() {
32
	if [ "${RC_CMD}" != "restart" ]; then
33
		configtest || return 1
34
	fi
35
}
36
37
stop_pre() {
38
	if [ "${RC_CMD}" = "restart" ]; then
39
		configtest || return 1
40
	fi
41
}
42
43
stop_post() {
44
	rm --force ${RSYSLOG_PIDFILE}
45
}
46
47
configtest() {
48
	# This will currently only detect fatal errors
49
	# See https://github.com/rsyslog/rsyslog/issues/79
50
51
	local _test_command="${command} -N 999 -f ${RSYSLOG_CONFIGFILE}"
52
	local _retval=0
53
54
	ebegin "Checking rsyslogd's configuration"
55
	${_test_command} &>/dev/null
56
	_retval=$?
57
58
	if [ ${_retval} -ne 0 ]; then
59
		${_test_command}
60
	fi
61
62
	eend ${_retval} "failed, please correct errors above"
63
}
64
65
rotate() {
66
	ebegin "Re-opening rsyslogd logs"
67
	start-stop-daemon --signal SIGHUP --pidfile "${RSYSLOG_PIDFILE}"
68
	eend $?
69
}
(-)old/app-admin/rsyslog/files/7-stable/rsyslog.logrotate-r1 (+37 lines)
Line 0 Link Here
1
# Uncomment the following directive if you have re-enabled
2
# "/var/log/syslog" in "/etc/rsyslog.d/50-default.conf"
3
#/var/log/syslog
4
#{
5
#	rotate 7
6
#	daily
7
#	missingok
8
#	notifempty
9
#	delaycompress
10
#	compress
11
#	postrotate
12
#		test -r /run/rsyslogd.pid && kill -HUP $(cat /run/rsyslogd.pid) &>/dev/null
13
#	endscript
14
#}
15
16
/var/log/auth.log
17
/var/log/cron.log
18
/var/log/daemon.log
19
/var/log/kern.log
20
/var/log/lpr.log
21
/var/log/mail.log
22
/var/log/news.log
23
/var/log/user.log
24
/var/log/debug.log
25
/var/log/messages
26
{
27
	rotate 4
28
	weekly
29
	missingok
30
	notifempty
31
	compress
32
	delaycompress
33
	sharedscripts
34
	postrotate
35
		test -r /run/rsyslogd.pid && kill -HUP $(cat /run/rsyslogd.pid) &>/dev/null
36
	endscript
37
}
(-)old/app-admin/rsyslog/metadata.xml (-19 / +37 lines)
Lines 1-23 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
3
<pkgmetadata>
4
  <maintainer>
4
	<maintainer>
5
    <email>ultrabug@gentoo.org</email>
5
		<email>ultrabug@gentoo.org</email>
6
    <name>Ultrabug</name>
6
		<name>Ultrabug</name>
7
    <description>Primary Maintainer</description>
7
		<description>Primary Maintainer</description>
8
  </maintainer>
8
	</maintainer>
9
  <maintainer>
9
	<maintainer>
10
    <email>whissi@whissi.de</email>
10
		<email>whissi@whissi.de</email>
11
    <name>Thomas D. (Whissi)</name>
11
		<name>Thomas D. (Whissi)</name>
12
    <description>Proxy-Maintainer, CC. bugs</description>
12
		<description>Proxy-Maintainer, CC. bugs</description>
13
  </maintainer>
13
	</maintainer>
14
  <use>
14
	<use>
15
    <flag name="extras">Add support for the UDP spoofing module (omudpspoof) using <pkg>net-libs/libnet</pkg></flag>
15
		<flag name="dbi">Build the general database output module (requires <pkg>dev-db/libdbi</pkg>)</flag>
16
    <flag name="mongodb">Add support for the MongoDB output template module using <pkg>dev-libs/libmongo-client</pkg></flag>
16
		<flag name="elasticsearch">Build the Elasticsearch output module (requires <pkg>net-misc/curl</pkg>)</flag>
17
    <flag name="relp">Add support for the Reliable Event Logging Protocol using <pkg>dev-libs/librelp</pkg></flag>
17
		<flag name="extras">Add support for the UDP spoofing module (omudpspoof) using <pkg>net-libs/libnet</pkg></flag>
18
    <flag name="zeromq">Add support for the ZeroMQ input and output plugins using <pkg>net-libs/zeromq</pkg></flag>
18
		<flag name="gcrypt">Add support for encrypted log files using <pkg>dev-libs/libgcrypt</pkg></flag>
19
  </use>
19
		<flag name="kerberos">Build the GSSAPI input and output module (requires <pkg>virtual/krb5</pkg>)</flag>
20
  <upstream>
20
		<flag name="mongodb">Build the MongoDB output module (requires <pkg>dev-libs/libmongo-client</pkg>)</flag>
21
    <remote-id type="cpe">cpe:/a:rsyslog:rsyslog</remote-id>
21
		<flag name="mysql">Build the MySQL databse output module (requires <pkg>virtual/mysql</pkg>)</flag>
22
  </upstream>
22
		<flag name="normalize">Build the normalize modify module (requires <pkg>dev-libs/libee</pkg> and <pkg>dev-libs/liblognorm</pkg>)</flag>
23
		<flag name="omudpspoof">Build the udpspoof output module (requires <pkg>net-libs/libnet</pkg>)</flag>
24
		<flag name="oracle">Build the Oracle database output module (requires <pkg>dev-db/oracle-instantclient-basic</pkg>)</flag>
25
		<flag name="postgres">Build the PostgreSQL database output module (requires <pkg>dev-db/postgresql-base</pkg>)</flag>
26
		<flag name="rabbitmq">Build the RabbitMQ output module (requires <pkg>net-libs/rabbitmq-c</pkg>)</flag>
27
		<flag name="redis">Build the Redis output module using (requires <pkg>dev-libs/hiredis</pkg>)</flag>
28
		<flag name="relp">Build the Reliable Event Logging Protocol (RELP) output module (requires <pkg>dev-libs/librelp</pkg>)</flag>
29
		<flag name="rfc3195">Build the rfc3195 input module (requires <pkg>dev-libs/liblogging</pkg>)</flag>
30
		<flag name="rfc5424hmac">Build the rfc5424hmac modify module (requires <pkg>dev-libs/openssl</pkg>)</flag>
31
		<flag name="snmp">Build the snmp modify and output module (requires <pkg>net-analyzer/net-snmp</pkg>)</flag>
32
		<flag name="ssl">Add support for encrypted client/server communication (requires <pkg>net-libs/gnutls</pkg>)</flag>
33
		<flag name="systemd">Build the journal input and output module (requires <pkg>sys-apps/systemd</pkg>)</flag>
34
		<flag name="usertools">Installs the user tools (rsgtutil, rscryutil...) corresponding to the set USE flags</flag>
35
		<flag name="zeromq">Build the ZeroMQ input and output modules (requires <pkg>net-libs/zeromq</pkg>)</flag>
36
	</use>
37
	<upstream>
38
		<bugs-to>https://github.com/rsyslog/rsyslog/issues</bugs-to>
39
		<remote-id type="cpe">cpe:/a:rsyslog:rsyslog</remote-id>
40
	</upstream>
23
</pkgmetadata>
41
</pkgmetadata>
(-)old/app-admin/rsyslog/rsyslog-7.6.3.ebuild (+327 lines)
Line 0 Link Here
1
# Copyright 1999-2014 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: $
4
5
EAPI=5
6
AUTOTOOLS_AUTORECONF=1
7
8
inherit autotools-utils eutils systemd
9
10
DESCRIPTION="An enhanced multi-threaded syslogd with database support and more"
11
HOMEPAGE="http://www.rsyslog.com/"
12
SRC_URI="http://www.rsyslog.com/files/download/${PN}/${P}.tar.gz"
13
14
LICENSE="GPL-3 LGPL-3 Apache-2.0"
15
KEYWORDS="~amd64 ~arm ~hppa ~x86"
16
SLOT="0"
17
IUSE="dbi debug doc elasticsearch +gcrypt kerberos mongodb mysql normalize omudpspoof oracle postgres rabbitmq redis relp rfc3195 rfc5424hmac snmp ssl systemd usertools zeromq"
18
19
RDEPEND="
20
	>=dev-libs/json-c-0.11:=
21
	>=dev-libs/libestr-0.1.9
22
	>=dev-libs/liblogging-1.0.1:=[stdlog]
23
	>=sys-libs/zlib-1.2.5
24
	dbi? ( >=dev-db/libdbi-0.8.3 )
25
	elasticsearch? ( >=net-misc/curl-7.35.0 )
26
	gcrypt? ( >=dev-libs/libgcrypt-1.5.3:= )
27
	kerberos? ( virtual/krb5 )
28
	mongodb? ( >=dev-libs/libmongo-client-0.1.4 )
29
	mysql? ( virtual/mysql )
30
	normalize? (
31
		>=dev-libs/libee-0.4.0
32
		>=dev-libs/liblognorm-0.3.1:=
33
		!>=dev-libs/liblognorm-1.0.0
34
	)
35
	omudpspoof? ( >=net-libs/libnet-1.1.6 )
36
	oracle? ( >=dev-db/oracle-instantclient-basic-10.2 )
37
	postgres? ( >=dev-db/postgresql-base-8.4.20 )
38
	rabbitmq? ( >=net-libs/rabbitmq-c-0.3.0 )
39
	redis? ( >=dev-libs/hiredis-0.11.0 )
40
	relp? ( >=dev-libs/librelp-1.2.5 )
41
	rfc3195? ( >=dev-libs/liblogging-1.0.1:=[rfc3195] )
42
	rfc5424hmac? ( >=dev-libs/openssl-0.9.8y )
43
	snmp? ( >=net-analyzer/net-snmp-5.7.2 )
44
	ssl? ( >=net-libs/gnutls-2.12.23 )
45
	systemd? ( >=sys-apps/systemd-208 )
46
	zeromq? ( >=net-libs/czmq-1.2.0 )"
47
DEPEND="${RDEPEND}
48
	virtual/pkgconfig"
49
50
BRANCH="7-stable"
51
52
# Test suite requires a special setup or will always fail
53
RESTRICT="test"
54
55
# Maitainer note : open a bug to upstream
56
# showing that building in a separate dir fails
57
AUTOTOOLS_IN_SOURCE_BUILD=1
58
59
AUTOTOOLS_PRUNE_LIBTOOL_FILES="modules"
60
61
DOCS=(
62
	AUTHORS
63
	ChangeLog
64
	doc/rsyslog-example.conf
65
	"${FILESDIR}"/${BRANCH}/README.gentoo
66
)
67
68
PATCHES=(
69
	"${FILESDIR}"/${BRANCH}/${PN}-7.x-mmjsonparse.patch
70
	"${FILESDIR}"/${BRANCH}/fix-omruleset-default-value.patch
71
	"${FILESDIR}"/${BRANCH}/bugfix_52.patch
72
	"${FILESDIR}"/${BRANCH}/bugfix_73.patch
73
)
74
75
src_configure() {
76
	# Maintainer notes:
77
	# * Guardtime support is missing because libgt isn't yet available
78
	#   in portage.
79
	# * Hadoop's HDFS file system output module is currently not
80
	#   supported in Gentoo because nobody is able to test it
81
	#   (JAVA dependency).
82
	# * dev-libs/hiredis doesn't provide pkg-config (see #504614,
83
	#   upstream PR 129 and 136) so we need to export HIREDIS_*
84
	#   variables because rsyslog's build system depends on pkg-config.
85
86
	if use redis; then
87
		export HIREDIS_LIBS="-L${EPREFIX}/usr/$(get_libdir) -lhiredis"
88
		export HIREDIS_CFLAGS="-I${EPREFIX}/usr/include"
89
	fi
90
91
	local myeconfargs=(
92
		# Input Plugins without depedencies
93
		--enable-imfile
94
		--enable-impstats
95
		--enable-imptcp
96
		--enable-imttcp
97
		# Message Modificiation Plugins without depedencies
98
		--enable-mmanon
99
		--enable-mmaudit
100
		--enable-mmcount
101
		--enable-mmfields
102
		--enable-mmjsonparse
103
		--enable-mmpstrucdata
104
		--enable-mmsequence
105
		--enable-mmutf8fix
106
		# Output Modification Plugins without dependencies
107
		--enable-mail
108
		--enable-omprog
109
		--enable-omruleset
110
		--enable-omstdout
111
		--enable-omuxsock
112
		# Misc
113
		--enable-pmaixforwardedfrom
114
		--enable-pmcisconames
115
		--enable-pmlastmsg
116
		--enable-pmrfc3164sd
117
		--enable-pmsnare
118
		--enable-sm_cust_bindcdr
119
		# DB
120
		$(use_enable dbi libdbi)
121
		$(use_enable mongodb ommongodb)
122
		$(use_enable mysql)
123
		$(use_enable oracle)
124
		$(use_enable postgres pgsql)
125
		$(use_enable redis omhiredis)
126
		# Debug
127
		$(use_enable debug)
128
		$(use_enable debug diagtools)
129
		$(use_enable debug imdiag)
130
		$(use_enable debug memcheck)
131
		$(use_enable debug rtinst)
132
		$(use_enable debug valgrind)
133
		# Misc
134
		$(use_enable elasticsearch)
135
		$(use_enable gcrypt libgcrypt)
136
		$(use_enable kerberos gssapi-krb5)
137
		$(use_enable normalize mmnormalize)
138
		$(use_enable omudpspoof)
139
		$(use_enable rabbitmq omrabbitmq)
140
		$(use_enable relp)
141
		$(use_enable rfc3195)
142
		$(use_enable rfc5424hmac mmrfc5424addhmac)
143
		$(use_enable snmp)
144
		$(use_enable snmp mmsnmptrapd)
145
		$(use_enable ssl gnutls)
146
		$(use_enable systemd imjournal)
147
		$(use_enable systemd omjournal)
148
		$(use_enable usertools)
149
		$(use_enable zeromq imzmq3)
150
		$(use_enable zeromq omzmq3)
151
		"$(systemd_with_unitdir)"
152
	)
153
154
	autotools-utils_src_configure
155
}
156
157
src_install() {
158
	use doc && HTML_DOCS=( "${S}"/doc/ )
159
	autotools-utils_src_install
160
161
	newconfd "${FILESDIR}/${BRANCH}/${PN}.confd-r1" ${PN}
162
	newinitd "${FILESDIR}/${BRANCH}/${PN}.initd-r1" ${PN}
163
164
	keepdir /var/empty/dev
165
	keepdir /var/spool/${PN}
166
	keepdir /etc/ssl/${PN}
167
	keepdir /etc/${PN}.d
168
169
	insinto /etc
170
	newins "${FILESDIR}/${BRANCH}/${PN}.conf" ${PN}.conf
171
172
	insinto /etc/rsyslog.d/
173
	newins "${FILESDIR}/${BRANCH}/default.conf" 50-default.conf
174
175
	insinto /etc/logrotate.d/
176
	newins "${FILESDIR}/${BRANCH}/${PN}.logrotate-r1" ${PN}
177
178
	if use mysql; then
179
		insinto /usr/share/doc/${PF}/scripts/mysql
180
		doins plugins/ommysql/{createDB.sql,contrib/delete_mysql}
181
	fi
182
183
	if use postgres; then
184
		insinto /usr/share/doc/${PF}/scripts/pgsql
185
		doins plugins/ompgsql/createDB.sql
186
	fi
187
}
188
189
pkg_postinst() {
190
	local advertise_readme=0
191
192
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
193
		# This is a new installation
194
195
		advertise_readme=1
196
197
		if use mysql || use postgres; then
198
			echo
199
			elog "Sample SQL scripts for MySQL & PostgreSQL have been installed to:"
200
			elog "  /usr/share/doc/${PF}/scripts"
201
		fi
202
203
		if use ssl; then
204
			echo
205
			elog "To create a default CA and certificates for your server and clients, run:"
206
			elog "  emerge --config =${PF}"
207
			elog "on your logging server. You can run it several times,"
208
			elog "once for each logging client. The client certificates will be signed"
209
			elog "using the CA certificate generated during the first run."
210
		fi
211
	fi
212
213
	if [[ -z "${REPLACING_VERSIONS}" ]] || [[ ${REPLACING_VERSIONS} < 8.0 ]]; then
214
		# Show this message until rsyslog-8.x
215
		echo
216
		elog "Since ${PN}-7.6.3 we no longer use the catch-all log target"
217
		elog "\"/var/log/syslog\" due to its redundancy to the other log targets."
218
219
		advertise_readme=1
220
	fi
221
222
	if [[ ${advertise_readme} -gt 0 ]]; then
223
		# We need to show the README file location
224
225
		echo ""
226
		elog "Please read"
227
		elog ""
228
		elog "  ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"
229
		elog ""
230
		elog "for more details."
231
	fi
232
}
233
234
pkg_config() {
235
	if ! use ssl ; then
236
		einfo "There is nothing to configure for rsyslog unless you"
237
		einfo "used USE=ssl to build it."
238
		return 0
239
	fi
240
241
	# Make sure the certificates directory exists
242
	CERTDIR="${EROOT}/etc/ssl/${PN}"
243
	if [ ! -d "${CERTDIR}" ]; then
244
		mkdir "${CERTDIR}" || die
245
	fi
246
	einfo "Your certificates will be stored in ${CERTDIR}"
247
248
	# Create a default CA if needed
249
	if [ ! -f "${CERTDIR}/${PN}_ca.cert.pem" ]; then
250
		einfo "No CA key and certificate found in ${CERTDIR}, creating them for you..."
251
		certtool --generate-privkey \
252
			--outfile "${CERTDIR}/${PN}_ca.privkey.pem" &>/dev/null
253
		chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
254
255
		cat > "${T}/${PF}.$$" <<- _EOF
256
		cn = Portage automated CA
257
		ca
258
		cert_signing_key
259
		expiration_days = 3650
260
		_EOF
261
262
		certtool --generate-self-signed \
263
			--load-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
264
			--outfile "${CERTDIR}/${PN}_ca.cert.pem" \
265
			--template "${T}/${PF}.$$" &>/dev/null
266
		chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
267
268
		# Create the server certificate
269
		echo
270
		einfon "Please type the Common Name of the SERVER you wish to create a certificate for: "
271
		read -r CN
272
273
		einfo "Creating private key and certificate for server ${CN}..."
274
		certtool --generate-privkey \
275
			--outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
276
		chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
277
278
		cat > "${T}/${PF}.$$" <<- _EOF
279
		cn = ${CN}
280
		tls_www_server
281
		dns_name = ${CN}
282
		expiration_days = 3650
283
		_EOF
284
285
		certtool --generate-certificate \
286
			--outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
287
			--load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
288
			--load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
289
			--load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
290
			--template "${T}/${PF}.$$" &>/dev/null
291
		chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
292
293
	else
294
		einfo "Found existing ${CERTDIR}/${PN}_ca.cert.pem, skipping CA and SERVER creation."
295
	fi
296
297
	# Create a client certificate
298
	echo
299
	einfon "Please type the Common Name of the CLIENT you wish to create a certificate for: "
300
	read -r CN
301
302
	einfo "Creating private key and certificate for client ${CN}..."
303
	certtool --generate-privkey \
304
		--outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
305
	chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
306
307
	cat > "${T}/${PF}.$$" <<- _EOF
308
	cn = ${CN}
309
	tls_www_client
310
	dns_name = ${CN}
311
	expiration_days = 3650
312
	_EOF
313
314
	certtool --generate-certificate \
315
		--outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
316
		--load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
317
		--load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
318
		--load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
319
		--template "${T}/${PF}.$$" &>/dev/null
320
	chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
321
322
	rm -f "${T}/${PF}.$$"
323
324
	echo
325
	einfo "Here is the documentation on how to encrypt your log traffic:"
326
	einfo " http://www.rsyslog.com/doc/rsyslog_tls.html"
327
}

Return to bug 501988