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

Collapse All | Expand All

(-)old/app-admin/rsyslog/files/8-stable/20-rsyslog-json_tokener_errors.patch (+49 lines)
Line 0 Link Here
1
From 6b47dd542d07ed557f02af9970d1004eb262e1c1 Mon Sep 17 00:00:00 2001
2
From: Rainer Gerhards <rgerhards@adiscon.com>
3
Date: Tue, 19 Aug 2014 11:33:41 +0200
4
Subject: [PATCH] bugfix: build failure on systems which don't have
5
 json_tokener_errors
6
7
Older versions of json-c need to use a different API (which don't exists
8
on newer versions, unfortunately...)
9
Thanks to Thomas D. for reporting this problem.
10
---
11
 ChangeLog     | 6 ++++++
12
 runtime/msg.c | 6 +++++-
13
 2 files changed, 11 insertions(+), 1 deletion(-)
14
15
diff --git a/ChangeLog b/ChangeLog
16
index 177387d..cb09b6c 100644
17
--- a/ChangeLog
18
+++ b/ChangeLog
19
@@ -1,4 +1,10 @@
20
 ---------------------------------------------------------------------------
21
+Version 8.4.1 [v8-stable] 2014-08-??
22
+- bugfix: build failure on systems which don't have json_tokener_errors
23
+  Older versions of json-c need to use a different API (which don't exists
24
+  on newer versions, unfortunately...)
25
+  Thanks to Thomas D. for reporting this problem.
26
+---------------------------------------------------------------------------
27
 Version 8.4.0 [v8-stable] 2014-08-18
28
 - this is the new stable branch, which incorporates all enhancements of
29
   rsyslog 8.3.
30
diff --git a/runtime/msg.c b/runtime/msg.c
31
index 66c3b7b..81b13f9 100644
32
--- a/runtime/msg.c
33
+++ b/runtime/msg.c
34
@@ -4074,7 +4074,11 @@ MsgSetPropsViaJSON(msg_t *__restrict__ const pMsg, const uchar *__restrict__ con
35
 
36
 			err = tokener->err;
37
 			if(err != json_tokener_continue)
38
-				errMsg = json_tokener_errors[err];
39
+#				if HAVE_JSON_TOKENER_ERROR_DESC
40
+					errMsg = json_tokener_error_desc(err);
41
+#				else
42
+					errMsg = json_tokener_errors[err];
43
+#				endif
44
 			else
45
 				errMsg = "Unterminated input";
46
 		} else if(!json_object_is_type(json, json_type_object))
47
-- 
48
2.0.3
49
(-)old/app-admin/rsyslog/files/8-stable/30-rsyslog-imuxsock-shrink.patch (+55 lines)
Line 0 Link Here
1
From ef18451ff518c870575622be159e30561c90087a Mon Sep 17 00:00:00 2001
2
From: Alex Deymo <deymo@chromium.org>
3
Date: Fri, 6 Jun 2014 22:57:46 -0700
4
Subject: [PATCH] plugins: Remove $(RSRT_LIBS) from imuxsock's LIBADD
5
6
imuxsock.c plugin uses some functions from sd-daemon.h that are
7
compiled as part of librsyslog.a. Including $(RSRT_LIB) to the LIBADD
8
variable on these plugins means that we are linking librsyslog.a
9
statically into that plugin. Nevertheless, the rsyslogd binary
10
already includes most of the librsyslog.a and exposes its symbols.
11
Because of this, we can let those functions undefined in the plugin
12
.so file and let dlopen() link those undefined functions against the
13
global symbols from rsyslogd.
14
15
This patch removes the static library from imuxsock.so and ensures
16
that all the objects from the librsyslog.a are included on rsyslogd.
17
---
18
 plugins/imuxsock/Makefile.am | 2 +-
19
 tools/Makefile.am            | 7 ++++---
20
 2 files changed, 5 insertions(+), 4 deletions(-)
21
22
diff --git a/plugins/imuxsock/Makefile.am b/plugins/imuxsock/Makefile.am
23
index 28f9f9e..f21d150 100644
24
--- a/plugins/imuxsock/Makefile.am
25
+++ b/plugins/imuxsock/Makefile.am
26
@@ -3,4 +3,4 @@ pkglib_LTLIBRARIES = imuxsock.la
27
 imuxsock_la_SOURCES = imuxsock.c
28
 imuxsock_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
29
 imuxsock_la_LDFLAGS = -module -avoid-version
30
-imuxsock_la_LIBADD = $(RSRT_LIBS)
31
+imuxsock_la_LIBADD =
32
diff --git a/tools/Makefile.am b/tools/Makefile.am
33
index 253cd5f..8f34289 100644
34
--- a/tools/Makefile.am
35
+++ b/tools/Makefile.am
36
@@ -39,12 +39,13 @@ rsyslogd_SOURCES = \
37
 	pidfile.h \
38
 	\
39
 	../dirty.h
40
-rsyslogd_CPPFLAGS =  $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
41
+rsyslogd_CPPFLAGS =  $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -DSD_EXPORT_SYMBOLS
42
 # note: it looks like librsyslog.la must be explicitely given on LDDADD,
43
-# otherwise dependencies are not properly calculated (resulting in a 
44
+# otherwise dependencies are not properly calculated (resulting in a
45
 # potentially incomplete build, a problem we had several times...)
46
 rsyslogd_LDADD = ../grammar/libgrammar.la ../runtime/librsyslog.la $(ZLIB_LIBS) $(PTHREADS_LIBS) $(RSRT_LIBS) $(SOL_LIBS) $(LIBUUID_LIBS) $(LIBLOGGING_STDLOG_LIBS)
47
-rsyslogd_LDFLAGS = -export-dynamic
48
+rsyslogd_LDFLAGS = -export-dynamic \
49
+	-Wl,--whole-archive,$(top_builddir)/runtime/.libs/librsyslog.a,--no-whole-archive
50
 
51
 EXTRA_DIST = $(man_MANS) \
52
 	rsgtutil.rst \
53
-- 
54
2.0.4
55
(-)old/app-admin/rsyslog/files/8-stable/40-rsyslog-fix-building-without-atomic-instructions.patch (+26 lines)
Line 0 Link Here
1
From 09ce215f66ad32b97f279152343bda4dd855ee25 Mon Sep 17 00:00:00 2001
2
From: Rainer Gerhards <rgerhards@adiscon.com>
3
Date: Tue, 19 Aug 2014 16:04:52 +0200
4
Subject: [PATCH] fix build problem on platforms without atomic instructions
5
6
Thanks to Michael Biebl for his very helpful analysis of the bug.
7
---
8
 runtime/atomic.h | 2 +-
9
 1 file changed, 1 insertion(+), 1 deletion(-)
10
11
diff --git a/runtime/atomic.h b/runtime/atomic.h
12
index 49c17d8..d59858a 100644
13
--- a/runtime/atomic.h
14
+++ b/runtime/atomic.h
15
@@ -221,7 +221,7 @@
16
 		return(val);
17
 	}
18
 
19
-#	define DEF_ATOMIC_HELPER_MUT64(x)  pthread_mutex_t x
20
+#	define DEF_ATOMIC_HELPER_MUT64(x)  pthread_mutex_t x;
21
 #	define INIT_ATOMIC_HELPER_MUT64(x) pthread_mutex_init(&(x), NULL)
22
 #	define DESTROY_ATOMIC_HELPER_MUT64(x) pthread_mutex_destroy(&(x))
23
 #endif /* #ifdef HAVE_ATOMIC_BUILTINS64 */
24
-- 
25
2.0.4
26
(-)old/app-admin/rsyslog/files/8-stable/41-rsyslog-gcc-pedantic-fixes.patch (+69 lines)
Line 0 Link Here
1
From bbd0f0143892045e48cbc49ef7dd9e3510750cb3 Mon Sep 17 00:00:00 2001
2
From: Rainer Gerhards <rgerhards@adiscon.com>
3
Date: Tue, 19 Aug 2014 16:55:33 +0200
4
Subject: [PATCH] remove a couple of gcc --pedantic messages
5
6
---
7
 plugins/mmfields/mmfields.c | 2 +-
8
 runtime/prop.h              | 2 +-
9
 runtime/wti.h               | 2 +-
10
 runtime/wtp.h               | 4 ++--
11
 4 files changed, 5 insertions(+), 5 deletions(-)
12
13
diff --git a/plugins/mmfields/mmfields.c b/plugins/mmfields/mmfields.c
14
index c408a6c..cdce199 100644
15
--- a/plugins/mmfields/mmfields.c
16
+++ b/plugins/mmfields/mmfields.c
17
@@ -43,7 +43,7 @@ MODULE_TYPE_NOKEEP
18
 MODULE_CNFNAME("mmfields")
19
 
20
 
21
-DEFobjCurrIf(errmsg);
22
+DEFobjCurrIf(errmsg)
23
 DEF_OMOD_STATIC_DATA
24
 
25
 /* config variables */
26
diff --git a/runtime/prop.h b/runtime/prop.h
27
index 7cb2743..38d801d 100644
28
--- a/runtime/prop.h
29
+++ b/runtime/prop.h
30
@@ -33,7 +33,7 @@ struct prop_s {
31
 		uchar sz[CONF_PROP_BUFSIZE];
32
 	} szVal;
33
 	int len;		/* we use int intentionally, otherwise we may get some troubles... */
34
-	DEF_ATOMIC_HELPER_MUT(mutRefCount);
35
+	DEF_ATOMIC_HELPER_MUT(mutRefCount)
36
 };
37
 
38
 /* interfaces */
39
diff --git a/runtime/wti.h b/runtime/wti.h
40
index 487abb7..496ef23 100644
41
--- a/runtime/wti.h
42
+++ b/runtime/wti.h
43
@@ -72,7 +72,7 @@ struct wti_s {
44
 	actWrkrInfo_t *actWrkrInfo; /* *array* of action wrkr infos for all actions
45
 				      (sized for max nbr of actions in config!) */
46
 	pthread_cond_t pcondBusy; /* condition to wake up the worker, protected by pmutUsr in wtp */
47
-	DEF_ATOMIC_HELPER_MUT(mutIsRunning);
48
+	DEF_ATOMIC_HELPER_MUT(mutIsRunning)
49
 	struct {
50
 		uint8_t bPrevWasSuspended;
51
 		uint8_t bDoAutoCommit; /* do a commit after each message
52
diff --git a/runtime/wtp.h b/runtime/wtp.h
53
index 4bc284c..531355f 100644
54
--- a/runtime/wtp.h
55
+++ b/runtime/wtp.h
56
@@ -63,8 +63,8 @@ struct wtp_s {
57
 	rsRetVal (*pfDoWork)(void *pUsr, void *pWti);
58
 	/* end user objects */
59
 	uchar *pszDbgHdr;	/* header string for debug messages */
60
-	DEF_ATOMIC_HELPER_MUT(mutCurNumWrkThrd);
61
-	DEF_ATOMIC_HELPER_MUT(mutWtpState);
62
+	DEF_ATOMIC_HELPER_MUT(mutCurNumWrkThrd)
63
+	DEF_ATOMIC_HELPER_MUT(mutWtpState)
64
 };
65
 
66
 /* some symbolic constants for easier reference */
67
-- 
68
2.0.4
69
(-)old/app-admin/rsyslog/files/8-stable/50-default.conf (+95 lines)
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/8-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/8-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/8-stable/rsyslog.confd (+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/8-stable/rsyslog.initd (+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 -f ${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 2>&1
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/8-stable/rsyslog.logrotate (+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 (-1 / +1 lines)
Lines 1-7 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
	<herd>proxy-maintainers</herd>
5
	<maintainer>
4
	<maintainer>
6
		<email>ultrabug@gentoo.org</email>
5
		<email>ultrabug@gentoo.org</email>
7
		<name>Ultrabug</name>
6
		<name>Ultrabug</name>
Lines 17-22 Link Here
17
		<flag name="elasticsearch">Build the Elasticsearch output module (requires <pkg>net-misc/curl</pkg>)</flag>
16
		<flag name="elasticsearch">Build the Elasticsearch output module (requires <pkg>net-misc/curl</pkg>)</flag>
18
		<flag name="extras">Add support for the UDP spoofing module (omudpspoof) using <pkg>net-libs/libnet</pkg></flag>
17
		<flag name="extras">Add support for the UDP spoofing module (omudpspoof) using <pkg>net-libs/libnet</pkg></flag>
19
		<flag name="gcrypt">Add support for encrypted log files using <pkg>dev-libs/libgcrypt</pkg></flag>
18
		<flag name="gcrypt">Add support for encrypted log files using <pkg>dev-libs/libgcrypt</pkg></flag>
19
		<flag name="jemalloc">Use <pkg>dev-libs/jemalloc</pkg> for allocations.</flag>
20
		<flag name="kerberos">Build the GSSAPI input and output module (requires <pkg>virtual/krb5</pkg>)</flag>
20
		<flag name="kerberos">Build the GSSAPI input and output module (requires <pkg>virtual/krb5</pkg>)</flag>
21
		<flag name="mongodb">Build the MongoDB output module (requires <pkg>dev-libs/libmongo-client</pkg>)</flag>
21
		<flag name="mongodb">Build the MongoDB output module (requires <pkg>dev-libs/libmongo-client</pkg>)</flag>
22
		<flag name="mysql">Build the MySQL databse output module (requires <pkg>virtual/mysql</pkg>)</flag>
22
		<flag name="mysql">Build the MySQL databse output module (requires <pkg>virtual/mysql</pkg>)</flag>
(-)old/app-admin/rsyslog/rsyslog-8.4.0.ebuild (+344 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="
13
	http://www.rsyslog.com/files/download/${PN}/${P}.tar.gz
14
	doc? ( http://www.rsyslog.com/files/download/${PN}/${PN}-doc-${PV}.tar.gz )
15
"
16
17
LICENSE="GPL-3 LGPL-3 Apache-2.0"
18
KEYWORDS="~amd64 ~arm ~hppa ~x86"
19
SLOT="0"
20
IUSE="dbi debug doc elasticsearch +gcrypt jemalloc kerberos mongodb mysql normalize omudpspoof oracle postgres rabbitmq redis relp rfc3195 rfc5424hmac snmp ssl systemd usertools zeromq"
21
22
RDEPEND="
23
	>=dev-libs/json-c-0.11:=
24
	>=dev-libs/libestr-0.1.9
25
	>=dev-libs/liblogging-1.0.1:=[stdlog]
26
	>=sys-libs/zlib-1.2.5
27
	dbi? ( >=dev-db/libdbi-0.8.3 )
28
	elasticsearch? ( >=net-misc/curl-7.35.0 )
29
	gcrypt? ( >=dev-libs/libgcrypt-1.5.3:= )
30
	jemalloc? ( >=dev-libs/jemalloc-3.3.1 )
31
	kerberos? ( virtual/krb5 )
32
	mongodb? ( >=dev-libs/libmongo-client-0.1.4 )
33
	mysql? ( virtual/mysql )
34
	normalize? (
35
		>=dev-libs/libee-0.4.0
36
		>=dev-libs/liblognorm-1.0.0:=
37
	)
38
	omudpspoof? ( >=net-libs/libnet-1.1.6 )
39
	oracle? ( >=dev-db/oracle-instantclient-basic-10.2 )
40
	postgres? ( >=dev-db/postgresql-base-8.4.20 )
41
	rabbitmq? ( >=net-libs/rabbitmq-c-0.3.0 )
42
	redis? ( >=dev-libs/hiredis-0.11.0 )
43
	relp? ( >=dev-libs/librelp-1.2.5 )
44
	rfc3195? ( >=dev-libs/liblogging-1.0.1:=[rfc3195] )
45
	rfc5424hmac? ( >=dev-libs/openssl-0.9.8y )
46
	snmp? ( >=net-analyzer/net-snmp-5.7.2 )
47
	ssl? ( >=net-libs/gnutls-2.12.23 )
48
	systemd? ( >=sys-apps/systemd-208 )
49
	zeromq? ( >=net-libs/czmq-1.2.0 )"
50
DEPEND="${RDEPEND}
51
	virtual/pkgconfig"
52
53
BRANCH="8-stable"
54
55
# Test suite requires a special setup or will always fail
56
RESTRICT="test"
57
58
# Maitainer note : open a bug to upstream
59
# showing that building in a separate dir fails
60
AUTOTOOLS_IN_SOURCE_BUILD=1
61
62
AUTOTOOLS_PRUNE_LIBTOOL_FILES="modules"
63
64
DOCS=(
65
	AUTHORS
66
	ChangeLog
67
	"${FILESDIR}"/${BRANCH}/README.gentoo
68
)
69
70
src_unpack() {
71
	unpack ${P}.tar.gz
72
73
	if use doc; then
74
		local doc_tarball="${PN}-doc-${PV}.tar.gz"
75
76
		cd "${S}" || die "Cannot change dir into '$S'"
77
		mkdir docs || die "Failed to create docs directory"
78
		cd docs || die "Failed to change dir into '${S}/docs'"
79
		unpack ${doc_tarball}
80
	fi
81
}
82
83
src_prepare() {
84
	epatch "${FILESDIR}"/${BRANCH}/20-rsyslog-json_tokener_errors.patch
85
	epatch "${FILESDIR}"/${BRANCH}/30-rsyslog-imuxsock-shrink.patch
86
	epatch "${FILESDIR}"/${BRANCH}/40-rsyslog-fix-building-without-atomic-instructions.patch
87
	epatch "${FILESDIR}"/${BRANCH}/41-rsyslog-gcc-pedantic-fixes.patch
88
}
89
90
src_configure() {
91
	# Maintainer notes:
92
	# * Guardtime support is missing because libgt isn't yet available
93
	#   in portage.
94
	# * Hadoop's HDFS file system output module is currently not
95
	#   supported in Gentoo because nobody is able to test it
96
	#   (JAVA dependency).
97
	# * dev-libs/hiredis doesn't provide pkg-config (see #504614,
98
	#   upstream PR 129 and 136) so we need to export HIREDIS_*
99
	#   variables because rsyslog's build system depends on pkg-config.
100
101
	if use redis; then
102
		export HIREDIS_LIBS="-L${EPREFIX}/usr/$(get_libdir) -lhiredis"
103
		export HIREDIS_CFLAGS="-I${EPREFIX}/usr/include"
104
	fi
105
106
	local myeconfargs=(
107
		--disable-generate-man-pages
108
		# Input Plugins without depedencies
109
		--enable-imfile
110
		--enable-impstats
111
		--enable-imptcp
112
		--enable-imttcp
113
		# Message Modificiation Plugins without depedencies
114
		--enable-mmanon
115
		--enable-mmaudit
116
		--enable-mmcount
117
		--enable-mmfields
118
		--enable-mmjsonparse
119
		--enable-mmpstrucdata
120
		--enable-mmsequence
121
		--enable-mmutf8fix
122
		# Output Modification Plugins without dependencies
123
		--enable-mail
124
		--enable-omprog
125
		--enable-omruleset
126
		--enable-omstdout
127
		--enable-omuxsock
128
		# Misc
129
		--enable-pmaixforwardedfrom
130
		--enable-pmciscoios
131
		--enable-pmcisconames
132
		--enable-pmlastmsg
133
		--enable-pmrfc3164sd
134
		--enable-pmsnare
135
		# DB
136
		$(use_enable dbi libdbi)
137
		$(use_enable mongodb ommongodb)
138
		$(use_enable mysql)
139
		$(use_enable oracle)
140
		$(use_enable postgres pgsql)
141
		$(use_enable redis omhiredis)
142
		# Debug
143
		$(use_enable debug)
144
		$(use_enable debug diagtools)
145
		$(use_enable debug imdiag)
146
		$(use_enable debug memcheck)
147
		$(use_enable debug rtinst)
148
		$(use_enable debug valgrind)
149
		# Misc
150
		$(use_enable elasticsearch)
151
		$(use_enable gcrypt libgcrypt)
152
		$(use_enable jemalloc)
153
		$(use_enable kerberos gssapi-krb5)
154
		$(use_enable normalize mmnormalize)
155
		$(use_enable omudpspoof)
156
		$(use_enable rabbitmq omrabbitmq)
157
		$(use_enable relp)
158
		$(use_enable rfc3195)
159
		$(use_enable rfc5424hmac mmrfc5424addhmac)
160
		$(use_enable snmp)
161
		$(use_enable snmp mmsnmptrapd)
162
		$(use_enable ssl gnutls)
163
		$(use_enable systemd imjournal)
164
		$(use_enable systemd omjournal)
165
		$(use_enable usertools)
166
		$(use_enable zeromq imzmq3)
167
		$(use_enable zeromq omzmq3)
168
		"$(systemd_with_unitdir)"
169
	)
170
171
	autotools-utils_src_configure
172
}
173
174
src_install() {
175
	use doc && HTML_DOCS=( "${S}/docs/build/" )
176
	autotools-utils_src_install
177
178
	newconfd "${FILESDIR}/${BRANCH}/${PN}.confd" ${PN}
179
	newinitd "${FILESDIR}/${BRANCH}/${PN}.initd" ${PN}
180
181
	keepdir /var/empty/dev
182
	keepdir /var/spool/${PN}
183
	keepdir /etc/ssl/${PN}
184
	keepdir /etc/${PN}.d
185
186
	insinto /etc
187
	newins "${FILESDIR}/${BRANCH}/${PN}.conf" ${PN}.conf
188
189
	insinto /etc/rsyslog.d/
190
	doins "${FILESDIR}/${BRANCH}/50-default.conf"
191
192
	insinto /etc/logrotate.d/
193
	newins "${FILESDIR}/${BRANCH}/${PN}.logrotate" ${PN}
194
195
	if use mysql; then
196
		insinto /usr/share/doc/${PF}/scripts/mysql
197
		doins plugins/ommysql/{createDB.sql,contrib/delete_mysql}
198
	fi
199
200
	if use postgres; then
201
		insinto /usr/share/doc/${PF}/scripts/pgsql
202
		doins plugins/ompgsql/createDB.sql
203
	fi
204
}
205
206
pkg_postinst() {
207
	local advertise_readme=0
208
209
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
210
		# This is a new installation
211
212
		advertise_readme=1
213
214
		if use mysql || use postgres; then
215
			echo
216
			elog "Sample SQL scripts for MySQL & PostgreSQL have been installed to:"
217
			elog "  /usr/share/doc/${PF}/scripts"
218
		fi
219
220
		if use ssl; then
221
			echo
222
			elog "To create a default CA and certificates for your server and clients, run:"
223
			elog "  emerge --config =${PF}"
224
			elog "on your logging server. You can run it several times,"
225
			elog "once for each logging client. The client certificates will be signed"
226
			elog "using the CA certificate generated during the first run."
227
		fi
228
	fi
229
230
	if [[ -z "${REPLACING_VERSIONS}" ]] || [[ ${REPLACING_VERSIONS} < 8.0 ]]; then
231
		# Show this message until rsyslog-8.x
232
		echo
233
		elog "Since ${PN}-7.6.3 we no longer use the catch-all log target"
234
		elog "\"/var/log/syslog\" due to its redundancy to the other log targets."
235
236
		advertise_readme=1
237
	fi
238
239
	if [[ ${advertise_readme} -gt 0 ]]; then
240
		# We need to show the README file location
241
242
		echo ""
243
		elog "Please read"
244
		elog ""
245
		elog "  ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"
246
		elog ""
247
		elog "for more details."
248
	fi
249
}
250
251
pkg_config() {
252
	if ! use ssl ; then
253
		einfo "There is nothing to configure for rsyslog unless you"
254
		einfo "used USE=ssl to build it."
255
		return 0
256
	fi
257
258
	# Make sure the certificates directory exists
259
	CERTDIR="${EROOT}/etc/ssl/${PN}"
260
	if [ ! -d "${CERTDIR}" ]; then
261
		mkdir "${CERTDIR}" || die
262
	fi
263
	einfo "Your certificates will be stored in ${CERTDIR}"
264
265
	# Create a default CA if needed
266
	if [ ! -f "${CERTDIR}/${PN}_ca.cert.pem" ]; then
267
		einfo "No CA key and certificate found in ${CERTDIR}, creating them for you..."
268
		certtool --generate-privkey \
269
			--outfile "${CERTDIR}/${PN}_ca.privkey.pem" &>/dev/null
270
		chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
271
272
		cat > "${T}/${PF}.$$" <<- _EOF
273
		cn = Portage automated CA
274
		ca
275
		cert_signing_key
276
		expiration_days = 3650
277
		_EOF
278
279
		certtool --generate-self-signed \
280
			--load-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
281
			--outfile "${CERTDIR}/${PN}_ca.cert.pem" \
282
			--template "${T}/${PF}.$$" &>/dev/null
283
		chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
284
285
		# Create the server certificate
286
		echo
287
		einfon "Please type the Common Name of the SERVER you wish to create a certificate for: "
288
		read -r CN
289
290
		einfo "Creating private key and certificate for server ${CN}..."
291
		certtool --generate-privkey \
292
			--outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
293
		chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
294
295
		cat > "${T}/${PF}.$$" <<- _EOF
296
		cn = ${CN}
297
		tls_www_server
298
		dns_name = ${CN}
299
		expiration_days = 3650
300
		_EOF
301
302
		certtool --generate-certificate \
303
			--outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
304
			--load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
305
			--load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
306
			--load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
307
			--template "${T}/${PF}.$$" &>/dev/null
308
		chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
309
310
	else
311
		einfo "Found existing ${CERTDIR}/${PN}_ca.cert.pem, skipping CA and SERVER creation."
312
	fi
313
314
	# Create a client certificate
315
	echo
316
	einfon "Please type the Common Name of the CLIENT you wish to create a certificate for: "
317
	read -r CN
318
319
	einfo "Creating private key and certificate for client ${CN}..."
320
	certtool --generate-privkey \
321
		--outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
322
	chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
323
324
	cat > "${T}/${PF}.$$" <<- _EOF
325
	cn = ${CN}
326
	tls_www_client
327
	dns_name = ${CN}
328
	expiration_days = 3650
329
	_EOF
330
331
	certtool --generate-certificate \
332
		--outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
333
		--load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
334
		--load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
335
		--load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
336
		--template "${T}/${PF}.$$" &>/dev/null
337
	chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
338
339
	rm -f "${T}/${PF}.$$"
340
341
	echo
342
	einfo "Here is the documentation on how to encrypt your log traffic:"
343
	einfo " http://www.rsyslog.com/doc/rsyslog_tls.html"
344
}

Return to bug 520328