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/fix-omruleset-default-value.patch (+32 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
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/rsyslog.conf (+158 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
###############
61
### ACTIONS ###
62
###############
63
64
auth,authpriv.* action(
65
	type="omfile"
66
	File="/var/log/auth.log"
67
	FileCreateMode="0600"
68
	FileOwner="root"
69
	FileGroup="adm"
70
	Sync="off"
71
)
72
73
cron.* action(
74
	type="omfile"
75
	File="/var/log/cron.log"
76
	FileOwner="root"
77
	FileGroup="adm"
78
)
79
80
daemon.* action(
81
	type="omfile"
82
	File="/var/log/daemon.log"
83
	FileOwner="root"
84
	FileGroup="adm"
85
)
86
87
kern.* action(
88
	type="omfile"
89
	File="/var/log/kern.log"
90
	FileOwner="root"
91
	FileGroup="adm"
92
)
93
94
lpr.* action(
95
	type="omfile"
96
	File="/var/log/lpr.log"
97
	FileOwner="root"
98
	FileGroup="adm"
99
)
100
101
mail.* action(
102
	type="omfile"
103
	File="/var/log/mail.log"
104
	FileOwner="root"
105
	FileGroup="adm"
106
)
107
108
news.* action(
109
	type="omfile"
110
	File="/var/log/news.log"
111
	FileOwner="root"
112
	FileGroup="adm"
113
)
114
115
user.* action(
116
	type="omfile"
117
	File="/var/log/user.log"
118
	FileOwner="root"
119
	FileGroup="adm"
120
)
121
122
*.=debug;auth,authpriv,news,mail.none action(
123
	type="omfile"
124
	File="/var/log/debug.log"
125
	FileOwner="root"
126
	FileGroup="adm"
127
)
128
129
*.info;auth,authpriv,cron,daemon,lpr,mail,news.none action(
130
	type="omfile"
131
	File="/var/log/messages"
132
	FileOwner="root"
133
	FileGroup="adm"
134
)
135
136
# Uncomment the following directive to re-enable the
137
# deprecated "/var/log/syslog" log file (don't forget to re-enable log
138
# rotation in "/etc/logrotate.d/rsyslog" if you do that!)
139
#*.*;auth,authpriv.none action(
140
#	type="omfile"
141
#	File="/var/log/syslog"
142
#	FileOwner="root"
143
#	FileGroup="adm"
144
#)
145
146
*.emerg action(
147
	type="omusrmsg"
148
	Users="*"
149
	action.execOnlyOnceEveryInterval="10"
150
)
151
152
# Create an additional socket for the default chroot location
153
# (used by net-misc/openssh[hpn], see https://bugs.gentoo.org/490744)
154
input(type="imuxsock" Socket="/var/empty/dev/log")
155
156
157
# Include all conf files in /etc/rsyslog.d/
158
$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 -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
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.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 (+304 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=(AUTHORS ChangeLog doc/rsyslog-example.conf)
62
63
PATCHES=(
64
	"${FILESDIR}"/${BRANCH}/${PN}-7.x-mmjsonparse.patch
65
	"${FILESDIR}"/${BRANCH}/fix-omruleset-default-value.patch
66
	"${FILESDIR}"/${BRANCH}/bugfix_52.patch
67
	"${FILESDIR}"/${BRANCH}/bugfix_73.patch
68
)
69
70
src_configure() {
71
	# Maintainer notes:
72
	# * Guardtime support is missing because libgt isn't yet available
73
	#   in portage.
74
	# * Hadoop's HDFS file system output module is currently not
75
	#   supported in Gentoo because nobody is able to test it
76
	#   (JAVA dependency).
77
	# * dev-libs/hiredis doesn't provide pkg-config (see #504614,
78
	#   upstream PR 129 and 136) so we need to export HIREDIS_*
79
	#   variables because rsyslog's build system depends on pkg-config.
80
81
	if use redis; then
82
		export HIREDIS_LIBS="-L${EPREFIX}/usr/$(get_libdir) -lhiredis"
83
		export HIREDIS_CFLAGS="-I${EPREFIX}/usr/include"
84
	fi
85
86
	local myeconfargs=(
87
		# Input Plugins without depedencies
88
		--enable-imfile
89
		--enable-impstats
90
		--enable-imptcp
91
		--enable-imttcp
92
		# Message Modificiation Plugins without depedencies
93
		--enable-mmanon
94
		--enable-mmaudit
95
		--enable-mmcount
96
		--enable-mmfields
97
		--enable-mmjsonparse
98
		--enable-mmpstrucdata
99
		--enable-mmsequence
100
		--enable-mmutf8fix
101
		# Output Modification Plugins without dependencies
102
		--enable-mail
103
		--enable-omprog
104
		--enable-omruleset
105
		--enable-omstdout
106
		--enable-omuxsock
107
		# Misc
108
		--enable-pmaixforwardedfrom
109
		--enable-pmcisconames
110
		--enable-pmlastmsg
111
		--enable-pmrfc3164sd
112
		--enable-pmsnare
113
		--enable-sm_cust_bindcdr
114
		# DB
115
		$(use_enable dbi libdbi)
116
		$(use_enable mongodb ommongodb)
117
		$(use_enable mysql)
118
		$(use_enable oracle)
119
		$(use_enable postgres pgsql)
120
		$(use_enable redis omhiredis)
121
		# Debug
122
		$(use_enable debug)
123
		$(use_enable debug diagtools)
124
		$(use_enable debug imdiag)
125
		$(use_enable debug memcheck)
126
		$(use_enable debug rtinst)
127
		$(use_enable debug valgrind)
128
		# Misc
129
		$(use_enable elasticsearch)
130
		$(use_enable gcrypt libgcrypt)
131
		$(use_enable kerberos gssapi-krb5)
132
		$(use_enable normalize mmnormalize)
133
		$(use_enable omudpspoof)
134
		$(use_enable rabbitmq omrabbitmq)
135
		$(use_enable relp)
136
		$(use_enable rfc3195)
137
		$(use_enable rfc5424hmac mmrfc5424addhmac)
138
		$(use_enable snmp)
139
		$(use_enable snmp mmsnmptrapd)
140
		$(use_enable ssl gnutls)
141
		$(use_enable systemd imjournal)
142
		$(use_enable systemd omjournal)
143
		$(use_enable usertools)
144
		$(use_enable zeromq imzmq3)
145
		$(use_enable zeromq omzmq3)
146
		"$(systemd_with_unitdir)"
147
	)
148
149
	autotools-utils_src_configure
150
}
151
152
src_install() {
153
	use doc && HTML_DOCS=( "${S}"/doc/ )
154
	autotools-utils_src_install
155
156
	insinto /etc
157
	newins "${FILESDIR}/${BRANCH}/${PN}.conf" ${PN}.conf
158
	newconfd "${FILESDIR}/${BRANCH}/${PN}.confd-r1" ${PN}
159
	newinitd "${FILESDIR}/${BRANCH}/${PN}.initd-r1" ${PN}
160
	keepdir /var/empty/dev
161
	keepdir /var/spool/${PN}
162
	keepdir /etc/ssl/${PN}
163
	keepdir /etc/${PN}.d
164
165
	if use mysql; then
166
		insinto /usr/share/doc/${PF}/scripts/mysql
167
		doins plugins/ommysql/{createDB.sql,contrib/delete_mysql}
168
	fi
169
170
	if use postgres; then
171
		insinto /usr/share/doc/${PF}/scripts/pgsql
172
		doins plugins/ompgsql/createDB.sql
173
	fi
174
175
	insinto /etc/logrotate.d/
176
	newins "${FILESDIR}/${BRANCH}/${PN}.logrotate-r1" ${PN}
177
}
178
179
pkg_postinst() {
180
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
181
		# This is a new installation
182
183
		if use mysql || use postgres; then
184
			echo
185
			elog "Sample SQL scripts for MySQL & PostgreSQL have been installed to:"
186
			elog "  /usr/share/doc/${PF}/scripts"
187
		fi
188
189
		if use ssl; then
190
			echo
191
			elog "To create a default CA and certificates for your server and clients, run:"
192
			elog "  emerge --config =${PF}"
193
			elog "on your logging server. You can run it several times,"
194
			elog "once for each logging client. The client certificates will be signed"
195
			elog "using the CA certificate generated during the first run."
196
		fi
197
	fi
198
199
	if [[ -z "${REPLACING_VERSIONS}" ]] || [[ ${REPLACING_VERSIONS} < 8.0 ]]; then
200
		# Show this message until rsyslog-8.x
201
		echo
202
		elog "Since ${PN}-7.6.3 we no longer use the catch-all log target"
203
		elog "\"/var/log/syslog\" due to its redundancy to the other log targets."
204
		elog ""
205
		elog "You can re-enable the deprecated log file by uncommenting the"
206
		elog "corresponding directive in \"/etc/rsyslog.conf\"."
207
		elog "If you decide to do that, don't forget to adjust \"/etc/logrotate.d/rsyslog\", too."
208
	fi
209
}
210
211
pkg_config() {
212
	if ! use ssl ; then
213
		einfo "There is nothing to configure for rsyslog unless you"
214
		einfo "used USE=ssl to build it."
215
		return 0
216
	fi
217
218
	# Make sure the certificates directory exists
219
	CERTDIR="${EROOT}/etc/ssl/${PN}"
220
	if [ ! -d "${CERTDIR}" ]; then
221
		mkdir "${CERTDIR}" || die
222
	fi
223
	einfo "Your certificates will be stored in ${CERTDIR}"
224
225
	# Create a default CA if needed
226
	if [ ! -f "${CERTDIR}/${PN}_ca.cert.pem" ]; then
227
		einfo "No CA key and certificate found in ${CERTDIR}, creating them for you..."
228
		certtool --generate-privkey \
229
			--outfile "${CERTDIR}/${PN}_ca.privkey.pem" &>/dev/null
230
		chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
231
232
		cat > "${T}/${PF}.$$" <<- _EOF
233
		cn = Portage automated CA
234
		ca
235
		cert_signing_key
236
		expiration_days = 3650
237
		_EOF
238
239
		certtool --generate-self-signed \
240
			--load-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
241
			--outfile "${CERTDIR}/${PN}_ca.cert.pem" \
242
			--template "${T}/${PF}.$$" &>/dev/null
243
		chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
244
245
		# Create the server certificate
246
		echo
247
		einfon "Please type the Common Name of the SERVER you wish to create a certificate for: "
248
		read -r CN
249
250
		einfo "Creating private key and certificate for server ${CN}..."
251
		certtool --generate-privkey \
252
			--outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
253
		chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
254
255
		cat > "${T}/${PF}.$$" <<- _EOF
256
		cn = ${CN}
257
		tls_www_server
258
		dns_name = ${CN}
259
		expiration_days = 3650
260
		_EOF
261
262
		certtool --generate-certificate \
263
			--outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
264
			--load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
265
			--load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
266
			--load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
267
			--template "${T}/${PF}.$$" &>/dev/null
268
		chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
269
270
	else
271
		einfo "Found existing ${CERTDIR}/${PN}_ca.cert.pem, skipping CA and SERVER creation."
272
	fi
273
274
	# Create a client certificate
275
	echo
276
	einfon "Please type the Common Name of the CLIENT you wish to create a certificate for: "
277
	read -r CN
278
279
	einfo "Creating private key and certificate for client ${CN}..."
280
	certtool --generate-privkey \
281
		--outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
282
	chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
283
284
	cat > "${T}/${PF}.$$" <<- _EOF
285
	cn = ${CN}
286
	tls_www_client
287
	dns_name = ${CN}
288
	expiration_days = 3650
289
	_EOF
290
291
	certtool --generate-certificate \
292
		--outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
293
		--load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
294
		--load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
295
		--load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
296
		--template "${T}/${PF}.$$" &>/dev/null
297
	chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
298
299
	rm -f "${T}/${PF}.$$"
300
301
	echo
302
	einfo "Here is the documentation on how to encrypt your log traffic:"
303
	einfo " http://www.rsyslog.com/doc/rsyslog_tls.html"
304
}

Return to bug 501988