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