Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/rsyslog/, app-admin/rsyslog/files/8-stable/
Date: Tue, 20 Feb 2018 20:39:24
Message-Id: 1519159136.d15a6d9a7f78fda28c89d09d426f2f0ae440aea0.whissi@gentoo
1 commit: d15a6d9a7f78fda28c89d09d426f2f0ae440aea0
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 20 20:38:36 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 20 20:38:56 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d15a6d9a
7
8 app-admin/rsyslog: Bump to v8.33.0
9
10 Package-Manager: Portage-2.3.24, Repoman-2.3.6
11
12 app-admin/rsyslog/Manifest | 2 +
13 .../8-stable/rsyslog-8.33.0-missing-files.patch | 80 ++++
14 app-admin/rsyslog/rsyslog-8.33.0.ebuild | 459 +++++++++++++++++++++
15 3 files changed, 541 insertions(+)
16
17 diff --git a/app-admin/rsyslog/Manifest b/app-admin/rsyslog/Manifest
18 index 1c2e73a510a..7d39f2c0d64 100644
19 --- a/app-admin/rsyslog/Manifest
20 +++ b/app-admin/rsyslog/Manifest
21 @@ -8,6 +8,7 @@ DIST rsyslog-8.29.0.tar.gz 2447907 BLAKE2B dd3a34e4c1b4edc989d58369933b94b11d89c
22 DIST rsyslog-8.30.0.tar.gz 2468224 BLAKE2B 3c5c94661abc2e34d688ca08d6dea0d2bcca9f287f45328a0d1b240bcb1b9223800207ce8759da823fa3acd974fcc70f01565f95fbcec108f8f71c7cb14a2409 SHA512 90e172d08ba7548252fc9744f71259dadf5a40afef405516e7b1601620913ca4b2ffc4859b16f369b9c1974ea10f4e41bc2d987e3d6bf9aabeb979f7de6aefe0
23 DIST rsyslog-8.31.0.tar.gz 2498675 BLAKE2B 8b80394ea3919dba29a431f3c5c1fc337a9e60a886a3c258c3895eb4341a941d8af6370ceb0d2e212934f64ab38c7238e99f40e1dc27e648bd4b75e158586a28 SHA512 aab888dda8df3ad7ff404767a58539cdc0bb92d0e537b703cf5833555688dd6d8223889b8d70bf8c594339a51831b57df7a65b397d8b40cded608dfb007befe7
24 DIST rsyslog-8.32.0.tar.gz 2478990 BLAKE2B 21bfc93b55da107bec2eddb89cb42d76990ced2675caeb6e73183a109f9bc8293bde43f202bb56007f9ea4e49de385b004c158059cb13e8d3d376bf050ca445a SHA512 eea85d77bf3624fbad6f0838fa2a4af7c14d853c8f120f14cf697cdfda7f7e0692dab684d2ddd07fe44a0bcd50cf91baf69af1bb63dc9d60e19146f1150155ac
25 +DIST rsyslog-8.33.0.tar.gz 2487783 BLAKE2B 2bb38007ee911ee3198818968053fd2ed97cd962d0761c4bc9be571d95eda9bdfd63dae4b8b724dbb5d87cbcbacfdeff5ed2529342af9678b064f2e2b1422cc6 SHA512 b0fd0c5976325bee9b29534c6f6dfad2f70d22e2fc4a7d5f28563116b7360290c7e31aa77ee5ecdf25e726b45d03899b00e4d653d0954284b88e8be918e0f333
26 DIST rsyslog-docs-8.19.0.tar.gz 4271094 BLAKE2B c866f66fc1ae9ef8c227a2e03bab4a815e408ccaafe9da97f8b6b6f6b89bb33d0c8a9e004552d5a1287a19bc8f3677517259a4f9bcebffbbeff506d80454945b SHA512 120f229a641119649fc897948fb0934039a95d0ef63e68b10ab635620d84988d794fd5dc33617353028e786513a86b3a1cd0c4fef9c755dab5bedd8e0246532e
27 DIST rsyslog-docs-8.24.0.tar.gz 4344877 BLAKE2B a3d9ea90580c3e24e3c40c07f871740cdf33ad4206627586bfb42523a758cbd18f5303f35f2fa036e492dece9a83d9c151b60023aed99f63c42ed8f9bf7da9f1 SHA512 b55cde1485a7baec6d4c4928107c22a078cf412a2994c0dfcbb12c47b49c3b263af8a64011b1329567cf86e04927b9e383581dc868eaea81d554adada6b3786b
28 DIST rsyslog-docs-8.25.0.tar.gz 4359583 BLAKE2B 349e057d3c94ca6fc92753459f8fca011927e82a787cc50685ebe1c5a40a624e4f74764b04cf00f5c250cd65eb6e2862d7225790cc029cd7256c072d63db1726 SHA512 e0068ec00bbda2d1cf7f14105ad83e82bea9291ed5d5fda3ffcff2db32747b65e7b6d65743a3221aeca03be9c6efcee1db7f03c2da115a3aed60848556befa71
29 @@ -18,3 +19,4 @@ DIST rsyslog-docs-8.29.0.tar.gz 4473644 BLAKE2B 18fc4aea0551f1ad770cd882aaf51242
30 DIST rsyslog-docs-8.30.0.tar.gz 4487378 BLAKE2B 7d39fc7642ec2122f254dd6660a13efa4b214ee669fe5772b4d68a8ce94ed5ac3ca2500c23b5752924b5befca2a66c228b6f2bb48c7b9f72a2a4b98e2a14810b SHA512 8068bb9bb8408447bff49730e9aac105eab1bd610592dd524e7639b668b2d05a4836d3a9862622445a0bb8d8b140db67c861dad6ec207d11049ac368e363684d
31 DIST rsyslog-docs-8.31.0.tar.gz 4484950 BLAKE2B 8ee4346a095942133bb473509f275c625fdb4a1aa81293a15604bdb95670ff0676677fe5481be3bc2ea7097b2c8de7fd3b0eb8033701522b372bffe44325a10a SHA512 51a63fa520d8176e183afa44ccf889374810dddfd5fdb363ed06b134bfbe0d1a94085e4836cf3bb2a07cb83564bbb87cef3763ac9429a5efc50aff276542defa
32 DIST rsyslog-docs-8.32.0.tar.gz 5368254 BLAKE2B 6d1efb191698bb1cfb03660167e5dcf9eea8f2fd2e459c350cd55aa24afcc5fb44d2bc0ef5590c6951326fbd0215aecbd59a6122e88ff449f566b37d1ee00d56 SHA512 e64eba3c40eab35e266826fb7e183418f38eb008f2a21ddf2c523d1e42aacaa20f882a561e5df67a979463048b58232fa82759645a21dc6962f6836ac8f57bce
33 +DIST rsyslog-docs-8.33.0.tar.gz 6770247 BLAKE2B e850ed0cc0c61c1d97c488b37034a0ce56d6fb41f324c4de4c56cbd13a5157ad35fa34062cc883ffdf1ad2d08b764490dbfd04c03571a3e549f28adba97e46e9 SHA512 fd1e21ce5b7e69058273e9232b682541faee21554fb83e3c1c6f4b88cc21ce00e56e199eb0e0a554b1290fbc456f989f65632cf94653005e0c25e311dedb6733
34
35 diff --git a/app-admin/rsyslog/files/8-stable/rsyslog-8.33.0-missing-files.patch b/app-admin/rsyslog/files/8-stable/rsyslog-8.33.0-missing-files.patch
36 new file mode 100644
37 index 00000000000..9b0b24e8957
38 --- /dev/null
39 +++ b/app-admin/rsyslog/files/8-stable/rsyslog-8.33.0-missing-files.patch
40 @@ -0,0 +1,80 @@
41 +https://github.com/rsyslog/rsyslog/issues/2493
42 +
43 +--- /dev/null
44 ++++ b/tests/omstdout-basic.sh
45 +@@ -0,0 +1,27 @@
46 ++#!/bin/bash
47 ++# add 2016-11-22 by Pascal Withopf, released under ASL 2.0
48 ++. $srcdir/diag.sh init
49 ++. $srcdir/diag.sh generate-conf
50 ++. $srcdir/diag.sh add-conf '
51 ++module(load="../plugins/imtcp/.libs/imtcp")
52 ++module(load="../plugins/omstdout/.libs/omstdout")
53 ++input(type="imtcp" port="13514")
54 ++
55 ++template(name="outfmt" type="string" string="-%msg%-\n")
56 ++action(type="omstdout" template="outfmt")
57 ++
58 ++'
59 ++. $srcdir/diag.sh startup > rsyslog.out.log
60 ++. $srcdir/diag.sh tcpflood -m1
61 ++. $srcdir/diag.sh shutdown-when-empty
62 ++. $srcdir/diag.sh wait-shutdowna
63 ++
64 ++grep "msgnum:00000000:" rsyslog.out.log > /dev/null
65 ++if [ $? -ne 0 ]; then
66 ++ echo
67 ++ echo "FAIL: expected message not found. rsyslog.out.log is:"
68 ++ cat rsyslog.out.log
69 ++ . $srcdir/diag.sh error-exit 1
70 ++fi
71 ++
72 ++. $srcdir/diag.sh exit
73 +--- /dev/null
74 ++++ b/tests/template-const-jsonf.sh
75 +@@ -0,0 +1,18 @@
76 ++#!/bin/bash
77 ++# added 2018-02-10 by Rainer Gerhards; Released under ASL 2.0
78 ++. $srcdir/diag.sh init
79 ++. $srcdir/diag.sh generate-conf
80 ++. $srcdir/diag.sh add-conf '
81 ++template(name="outfmt" type="list") {
82 ++ constant(outname="@version" value="1" format="jsonf")
83 ++ constant(value="\n")
84 ++}
85 ++
86 ++local4.* action(type="omfile" file="rsyslog.out.log" template="outfmt")
87 ++'
88 ++. $srcdir/diag.sh startup
89 ++. $srcdir/diag.sh injectmsg 0 1
90 ++. $srcdir/diag.sh shutdown-when-empty
91 ++. $srcdir/diag.sh wait-shutdown
92 ++. $srcdir/diag.sh content-cmp '"@version": "1"'
93 ++. $srcdir/diag.sh exit
94 +--- /dev/null
95 ++++ b/tests/template-pure-json.sh
96 +@@ -0,0 +1,18 @@
97 ++#!/bin/bash
98 ++# added 2018-02-10 by Rainer Gerhards; Released under ASL 2.0
99 ++. $srcdir/diag.sh init
100 ++. $srcdir/diag.sh generate-conf
101 ++. $srcdir/diag.sh add-conf '
102 ++template(name="outfmt" type="list" option.jsonf="on") {
103 ++ property(outname="message" name="msg" format="jsonf")
104 ++ constant(outname="@version" value="1" format="jsonf")
105 ++}
106 ++
107 ++local4.* action(type="omfile" file="rsyslog.out.log" template="outfmt")
108 ++'
109 ++. $srcdir/diag.sh startup
110 ++. $srcdir/diag.sh injectmsg 0 1
111 ++. $srcdir/diag.sh shutdown-when-empty
112 ++. $srcdir/diag.sh wait-shutdown
113 ++. $srcdir/diag.sh content-cmp '{"message":" msgnum:00000000:", "@version": "1"}'
114 ++. $srcdir/diag.sh exit
115 +--- /dev/null
116 ++++ b/tests/testsuites/include-std-omfile-action.conf
117 +@@ -0,0 +1,3 @@
118 ++# this include provides our standard omfile action. It is primarily
119 ++# used for include() tests, but may have other uses as well.
120 ++action(type="omfile" template="outfmt" file="rsyslog.out.log")
121
122 diff --git a/app-admin/rsyslog/rsyslog-8.33.0.ebuild b/app-admin/rsyslog/rsyslog-8.33.0.ebuild
123 new file mode 100644
124 index 00000000000..b69e229a28b
125 --- /dev/null
126 +++ b/app-admin/rsyslog/rsyslog-8.33.0.ebuild
127 @@ -0,0 +1,459 @@
128 +# Copyright 1999-2018 Gentoo Foundation
129 +# Distributed under the terms of the GNU General Public License v2
130 +
131 +EAPI="6"
132 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
133 +
134 +inherit autotools eutils linux-info python-any-r1 systemd
135 +
136 +DESCRIPTION="An enhanced multi-threaded syslogd with database support and more"
137 +HOMEPAGE="http://www.rsyslog.com/"
138 +
139 +BRANCH="8-stable"
140 +
141 +if [[ ${PV} == "9999" ]]; then
142 + EGIT_REPO_URI="https://github.com/rsyslog/${PN}.git"
143 +
144 + DOC_REPO_URI="https://github.com/rsyslog/${PN}-doc.git"
145 +
146 + inherit git-r3
147 +else
148 + MY_PV=${PV%_rc*}
149 + MY_FILENAME="${PN}-${PV}.tar.gz"
150 + MY_FILENAME_DOCS="${PN}-docs-${PV}.tar.gz"
151 + S="${WORKDIR}/${PN}-${MY_PV}"
152 +
153 + # Upstream URL schema:
154 + # RC: http://www.rsyslog.com/files/download/rsyslog/rc/rsyslog-8.18.0.tar.gz
155 + # http://www.rsyslog.com/files/download/rsyslog/rc2/rsyslog-8.18.0.tar.gz
156 + # Release: http://www.rsyslog.com/files/download/rsyslog/rsyslog-8.18.0.tar.gz
157 +
158 + MY_URL_PREFIX=
159 + if [[ ${PV} = *_rc* ]]; then
160 + _tmp_last_index=$(($(get_last_version_component_index ${PV})+1))
161 + _tmp_suffix=$(get_version_component_range ${_tmp_last_index} ${PV})
162 + if [[ ${_tmp_suffix} = *rc* ]]; then
163 + MY_URL_PREFIX="${_tmp_suffix}/"
164 + fi
165 +
166 + # Cleaning up temporary variables
167 + unset _tmp_last_index
168 + unset _tmp_suffix
169 + else
170 + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~x86"
171 + fi
172 +
173 + SRC_URI="
174 + http://www.rsyslog.com/files/download/${PN}/${MY_URL_PREFIX}${PN}-${MY_PV}.tar.gz -> ${MY_FILENAME}
175 + doc? ( http://www.rsyslog.com/files/download/${PN}/${MY_URL_PREFIX}${PN}-doc-${MY_PV}.tar.gz -> ${MY_FILENAME_DOCS} )
176 + "
177 +
178 + PATCHES=( "${FILESDIR}"/8-stable/${P}-missing-files.patch )
179 +fi
180 +
181 +LICENSE="GPL-3 LGPL-3 Apache-2.0"
182 +SLOT="0"
183 +IUSE="curl dbi debug doc elasticsearch +gcrypt grok jemalloc kafka kerberos libressl mdblookup mongodb mysql normalize omhttpfs"
184 +IUSE+=" omudpspoof postgres rabbitmq redis relp rfc3195 rfc5424hmac snmp ssl systemd test usertools +uuid zeromq"
185 +
186 +RDEPEND="
187 + >=dev-libs/libfastjson-0.99.8:=
188 + >=dev-libs/libestr-0.1.9
189 + >=dev-libs/liblogging-1.0.1:=[stdlog]
190 + >=sys-libs/zlib-1.2.5
191 + curl? ( >=net-misc/curl-7.35.0 )
192 + dbi? ( >=dev-db/libdbi-0.8.3 )
193 + elasticsearch? ( >=net-misc/curl-7.35.0 )
194 + gcrypt? ( >=dev-libs/libgcrypt-1.5.3:= )
195 + grok? ( >=dev-libs/grok-0.9.2 )
196 + jemalloc? ( >=dev-libs/jemalloc-3.3.1:= )
197 + kafka? ( >=dev-libs/librdkafka-0.9.0.99:= )
198 + kerberos? ( virtual/krb5 )
199 + mdblookup? ( dev-libs/libmaxminddb:= )
200 + mongodb? ( >=dev-libs/mongo-c-driver-1.1.10:= )
201 + mysql? ( virtual/mysql )
202 + normalize? (
203 + >=dev-libs/libee-0.4.0
204 + >=dev-libs/liblognorm-2.0.3:=
205 + )
206 + omhttpfs? ( >=net-misc/curl-7.35.0 )
207 + omudpspoof? ( >=net-libs/libnet-1.1.6 )
208 + postgres? ( >=dev-db/postgresql-8.4.20:= )
209 + rabbitmq? ( >=net-libs/rabbitmq-c-0.3.0:= )
210 + redis? ( >=dev-libs/hiredis-0.11.0:= )
211 + relp? ( >=dev-libs/librelp-1.2.14:= )
212 + rfc3195? ( >=dev-libs/liblogging-1.0.1:=[rfc3195] )
213 + rfc5424hmac? (
214 + !libressl? ( >=dev-libs/openssl-0.9.8y:0= )
215 + libressl? ( dev-libs/libressl:= )
216 + )
217 + snmp? ( >=net-analyzer/net-snmp-5.7.2 )
218 + ssl? ( >=net-libs/gnutls-2.12.23:0= )
219 + systemd? ( >=sys-apps/systemd-234 )
220 + uuid? ( sys-apps/util-linux:0= )
221 + zeromq? (
222 + >=net-libs/czmq-3.0.2
223 + )"
224 +DEPEND="${RDEPEND}
225 + >=sys-devel/autoconf-archive-2015.02.24
226 + virtual/pkgconfig
227 + test? (
228 + jemalloc? ( <sys-libs/libfaketime-0.9.7 )
229 + !jemalloc? ( sys-libs/libfaketime )
230 + ${PYTHON_DEPS}
231 + )"
232 +
233 +if [[ ${PV} == "9999" ]]; then
234 + DEPEND+=" doc? ( >=dev-python/sphinx-1.1.3-r7 )"
235 + DEPEND+=" >=sys-devel/flex-2.5.39-r1"
236 + DEPEND+=" >=sys-devel/bison-2.4.3"
237 + DEPEND+=" >=dev-python/docutils-0.12"
238 +fi
239 +
240 +CONFIG_CHECK="~INOTIFY_USER"
241 +WARNING_INOTIFY_USER="CONFIG_INOTIFY_USER isn't set. Imfile module on this system will only support polling mode!"
242 +
243 +pkg_setup() {
244 + use test && python-any-r1_pkg_setup
245 +}
246 +
247 +src_unpack() {
248 + if [[ ${PV} == "9999" ]]; then
249 + git-r3_fetch
250 + git-r3_checkout
251 + else
252 + unpack ${P}.tar.gz
253 + fi
254 +
255 + if use doc; then
256 + if [[ ${PV} == "9999" ]]; then
257 + local _EGIT_BRANCH=
258 + if [[ -n "${EGIT_BRANCH}" ]]; then
259 + # Cannot use rsyslog commits/branches for documentation repository
260 + _EGIT_BRANCH=${EGIT_BRANCH}
261 + unset EGIT_BRANCH
262 + fi
263 +
264 + git-r3_fetch "${DOC_REPO_URI}"
265 + git-r3_checkout "${DOC_REPO_URI}" "${S}"/docs
266 +
267 + if [[ -n "${_EGIT_BRANCH}" ]]; then
268 + # Restore previous EGIT_BRANCH information
269 + EGIT_BRANCH=${_EGIT_BRANCH}
270 + fi
271 + else
272 + cd "${S}" || die "Cannot change dir into '${S}'"
273 + mkdir docs || die "Failed to create docs directory"
274 + cd docs || die "Failed to change dir into '${S}/docs'"
275 + unpack ${MY_FILENAME_DOCS}
276 + fi
277 + fi
278 +}
279 +
280 +src_prepare() {
281 + default
282 +
283 + eautoreconf
284 +}
285 +
286 +src_configure() {
287 + # Maintainer notes:
288 + # * Guardtime support is missing because libgt isn't yet available
289 + # in portage.
290 + # * Hadoop's HDFS file system output module is currently not
291 + # supported in Gentoo because nobody is able to test it
292 + # (JAVA dependency).
293 + # * dev-libs/hiredis doesn't provide pkg-config (see #504614,
294 + # upstream PR 129 and 136) so we need to export HIREDIS_*
295 + # variables because rsyslog's build system depends on pkg-config.
296 +
297 + if use redis; then
298 + export HIREDIS_LIBS="-L${EPREFIX}/usr/$(get_libdir) -lhiredis"
299 + export HIREDIS_CFLAGS="-I${EPREFIX}/usr/include"
300 + fi
301 +
302 + local myeconfargs=(
303 + --disable-debug-symbols
304 + --disable-generate-man-pages
305 + --without-valgrind-testbench
306 + $(use_enable test testbench)
307 + $(use_enable curl libcurl)
308 + # Input Plugins without depedencies
309 + --enable-imdiag
310 + --enable-imfile
311 + --enable-impstats
312 + --enable-imptcp
313 + # Message Modificiation Plugins without depedencies
314 + --enable-mmanon
315 + --enable-mmaudit
316 + --enable-mmcount
317 + --enable-mmfields
318 + --enable-mmjsonparse
319 + --enable-mmpstrucdata
320 + --enable-mmrm1stspace
321 + --enable-mmsequence
322 + --enable-mmutf8fix
323 + # Output Modification Plugins without dependencies
324 + --enable-mail
325 + --enable-omprog
326 + --enable-omruleset
327 + --enable-omstdout
328 + --enable-omuxsock
329 + # Misc
330 + --enable-pmaixforwardedfrom
331 + --enable-pmciscoios
332 + --enable-pmcisconames
333 + --enable-pmlastmsg
334 + --enable-pmsnare
335 + # DB
336 + $(use_enable dbi libdbi)
337 + $(use_enable mongodb ommongodb)
338 + $(use_enable mysql)
339 + $(use_enable postgres pgsql)
340 + $(use_enable redis omhiredis)
341 + # Debug
342 + $(use_enable debug)
343 + $(use_enable debug diagtools)
344 + $(use_enable debug memcheck)
345 + $(use_enable debug rtinst)
346 + $(use_enable debug valgrind)
347 + # Misc
348 + $(use_enable elasticsearch)
349 + $(use_enable gcrypt libgcrypt)
350 + $(use_enable jemalloc)
351 + $(use_enable kafka imkafka)
352 + $(use_enable kafka omkafka)
353 + $(use_enable kerberos gssapi-krb5)
354 + $(use_enable normalize mmnormalize)
355 + $(use_enable mdblookup mmdblookup)
356 + $(use_enable grok mmgrok)
357 + $(use_enable omhttpfs)
358 + $(use_enable omudpspoof)
359 + $(use_enable rabbitmq omrabbitmq)
360 + $(use_enable relp)
361 + $(use_enable rfc3195)
362 + $(use_enable rfc5424hmac mmrfc5424addhmac)
363 + $(use_enable snmp)
364 + $(use_enable snmp mmsnmptrapd)
365 + $(use_enable ssl gnutls)
366 + $(use_enable systemd imjournal)
367 + $(use_enable systemd omjournal)
368 + $(use_enable usertools)
369 + $(use_enable uuid)
370 + $(use_enable zeromq imczmq)
371 + $(use_enable zeromq omczmq)
372 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
373 + )
374 +
375 + econf "${myeconfargs[@]}"
376 +}
377 +
378 +src_compile() {
379 + default
380 +
381 + if use doc && [[ "${PV}" == "9999" ]]; then
382 + einfo "Building documentation ..."
383 + local doc_dir="${S}/docs"
384 + cd "${doc_dir}" || die "Cannot chdir into \"${doc_dir}\"!"
385 + sphinx-build -b html source build || die "Building documentation failed!"
386 + fi
387 +}
388 +
389 +src_test() {
390 + local _has_increased_ulimit=
391 +
392 + # Sometimes tests aren't executable (i.e. when added via patch)
393 + einfo "Adjusting permissions of test scripts ..."
394 + find "${S}"/tests -type f -name '*.sh' \! -perm -111 -exec chmod a+x '{}' \; || \
395 + die "Failed to adjust test scripts permission"
396 +
397 + if ulimit -n 3072; then
398 + _has_increased_ulimit="true"
399 + fi
400 +
401 + if ! emake --jobs 1 check; then
402 + eerror "Test suite failed! :("
403 +
404 + if [[ -z "${_has_increased_ulimit}" ]]; then
405 + eerror "Probably because open file limit couldn't be set to 3072."
406 + fi
407 +
408 + if has userpriv ${FEATURES}; then
409 + eerror "Please try to reproduce the test suite failure with FEATURES=-userpriv " \
410 + "before you submit a bug report."
411 + fi
412 +
413 + fi
414 +}
415 +
416 +src_install() {
417 + local DOCS=(
418 + AUTHORS
419 + ChangeLog
420 + "${FILESDIR}"/${BRANCH}/README.gentoo
421 + )
422 +
423 + use doc && local HTML_DOCS=( "${S}/docs/build/." )
424 +
425 + default
426 +
427 + newconfd "${FILESDIR}/${BRANCH}/${PN}.confd-r1" ${PN}
428 + newinitd "${FILESDIR}/${BRANCH}/${PN}.initd-r1" ${PN}
429 +
430 + keepdir /var/empty/dev
431 + keepdir /var/spool/${PN}
432 + keepdir /etc/ssl/${PN}
433 + keepdir /etc/${PN}.d
434 +
435 + insinto /etc
436 + newins "${FILESDIR}/${BRANCH}/${PN}.conf" ${PN}.conf
437 +
438 + insinto /etc/rsyslog.d/
439 + newins "${FILESDIR}/${BRANCH}/50-default-r1.conf" 50-default.conf
440 +
441 + insinto /etc/logrotate.d/
442 + newins "${FILESDIR}/${BRANCH}/${PN}.logrotate" ${PN}
443 +
444 + if use mysql; then
445 + insinto /usr/share/doc/${PF}/scripts/mysql
446 + doins plugins/ommysql/createDB.sql
447 + fi
448 +
449 + if use postgres; then
450 + insinto /usr/share/doc/${PF}/scripts/pgsql
451 + doins plugins/ompgsql/createDB.sql
452 + fi
453 +
454 + prune_libtool_files --modules
455 +}
456 +
457 +pkg_postinst() {
458 + local advertise_readme=0
459 +
460 + if [[ -z "${REPLACING_VERSIONS}" ]]; then
461 + # This is a new installation
462 +
463 + advertise_readme=1
464 +
465 + if use mysql || use postgres; then
466 + echo
467 + elog "Sample SQL scripts for MySQL & PostgreSQL have been installed to:"
468 + elog " /usr/share/doc/${PF}/scripts"
469 + fi
470 +
471 + if use ssl; then
472 + echo
473 + elog "To create a default CA and certificates for your server and clients, run:"
474 + elog " emerge --config =${PF}"
475 + elog "on your logging server. You can run it several times,"
476 + elog "once for each logging client. The client certificates will be signed"
477 + elog "using the CA certificate generated during the first run."
478 + fi
479 + fi
480 +
481 + if [[ ${advertise_readme} -gt 0 ]]; then
482 + # We need to show the README file location
483 +
484 + echo ""
485 + elog "Please read"
486 + elog ""
487 + elog " ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"
488 + elog ""
489 + elog "for more details."
490 + fi
491 +}
492 +
493 +pkg_config() {
494 + if ! use ssl ; then
495 + einfo "There is nothing to configure for rsyslog unless you"
496 + einfo "used USE=ssl to build it."
497 + return 0
498 + fi
499 +
500 + # Make sure the certificates directory exists
501 + local CERTDIR="${EROOT}/etc/ssl/${PN}"
502 + if [[ ! -d "${CERTDIR}" ]]; then
503 + mkdir "${CERTDIR}" || die
504 + fi
505 + einfo "Your certificates will be stored in ${CERTDIR}"
506 +
507 + # Create a default CA if needed
508 + if [[ ! -f "${CERTDIR}/${PN}_ca.cert.pem" ]]; then
509 + einfo "No CA key and certificate found in ${CERTDIR}, creating them for you..."
510 + certtool --generate-privkey \
511 + --outfile "${CERTDIR}/${PN}_ca.privkey.pem" &>/dev/null
512 + chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
513 +
514 + cat > "${T}/${PF}.$$" <<- _EOF
515 + cn = Portage automated CA
516 + ca
517 + cert_signing_key
518 + expiration_days = 3650
519 + _EOF
520 +
521 + certtool --generate-self-signed \
522 + --load-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
523 + --outfile "${CERTDIR}/${PN}_ca.cert.pem" \
524 + --template "${T}/${PF}.$$" &>/dev/null
525 + chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
526 +
527 + # Create the server certificate
528 + echo
529 + einfon "Please type the Common Name of the SERVER you wish to create a certificate for: "
530 + read -r CN
531 +
532 + einfo "Creating private key and certificate for server ${CN}..."
533 + certtool --generate-privkey \
534 + --outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
535 + chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
536 +
537 + cat > "${T}/${PF}.$$" <<- _EOF
538 + cn = ${CN}
539 + tls_www_server
540 + dns_name = ${CN}
541 + expiration_days = 3650
542 + _EOF
543 +
544 + certtool --generate-certificate \
545 + --outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
546 + --load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
547 + --load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
548 + --load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
549 + --template "${T}/${PF}.$$" &>/dev/null
550 + chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
551 +
552 + else
553 + einfo "Found existing ${CERTDIR}/${PN}_ca.cert.pem, skipping CA and SERVER creation."
554 + fi
555 +
556 + # Create a client certificate
557 + echo
558 + einfon "Please type the Common Name of the CLIENT you wish to create a certificate for: "
559 + read -r CN
560 +
561 + einfo "Creating private key and certificate for client ${CN}..."
562 + certtool --generate-privkey \
563 + --outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
564 + chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
565 +
566 + cat > "${T}/${PF}.$$" <<- _EOF
567 + cn = ${CN}
568 + tls_www_client
569 + dns_name = ${CN}
570 + expiration_days = 3650
571 + _EOF
572 +
573 + certtool --generate-certificate \
574 + --outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
575 + --load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
576 + --load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
577 + --load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
578 + --template "${T}/${PF}.$$" &>/dev/null
579 + chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
580 +
581 + rm -f "${T}/${PF}.$$"
582 +
583 + echo
584 + einfo "Here is the documentation on how to encrypt your log traffic:"
585 + einfo " http://www.rsyslog.com/doc/rsyslog_tls.html"
586 +}