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/
Date: Wed, 26 Aug 2020 13:31:12
Message-Id: 1598448663.315b728b0159a12ee256cb75bf2669a4aa54ad64.whissi@gentoo
1 commit: 315b728b0159a12ee256cb75bf2669a4aa54ad64
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 26 12:20:12 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 26 13:31:03 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=315b728b
7
8 app-admin/rsyslog: bump to v8.2008.0
9
10 Package-Manager: Portage-3.0.4, Repoman-3.0.1
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 app-admin/rsyslog/Manifest | 2 +
14 app-admin/rsyslog/rsyslog-8.2008.0.ebuild | 462 ++++++++++++++++++++++++++++++
15 2 files changed, 464 insertions(+)
16
17 diff --git a/app-admin/rsyslog/Manifest b/app-admin/rsyslog/Manifest
18 index ce4303a038d..6da206756c1 100644
19 --- a/app-admin/rsyslog/Manifest
20 +++ b/app-admin/rsyslog/Manifest
21 @@ -1,4 +1,6 @@
22 DIST rsyslog-8.2004.0.tar.gz 3002704 BLAKE2B b5049448e0d09e048a45f067b5f8de453721ac5d63233f251e6e24fe2a722469cb19a91e83aa405ffc21245942b824e0a28ecd4e6df431517c8775e7a322bcd3 SHA512 1d7fac65cc97975a6765a55732d413e892502e53566c6fb7c1bfc0107b173eae77dd04c0c9a7471296dff998ceb2fd5a2374368a5a8528f8eb0a89d1915b0214
23 DIST rsyslog-8.2006.0.tar.gz 3047140 BLAKE2B 00599341ae579b4d56388c27dd0f2b61dd8b335cfcbc130607d11f692b8b9943b36b377d0aeaed36966960dcd095cc22d03f6ebb4afb69abfac3011d58653f25 SHA512 576a2cfa21e89352de2750f0832bd84348822cc84ce67e1b51bf6a162414bdc7f5ac8320c503454789a576172060efc734c26fa305a7ce849c2ebb95dfb85a09
24 +DIST rsyslog-8.2008.0.tar.gz 3051049 BLAKE2B abf9b7ec81cf62841c448f22c7aff45bc85ea6cdc7552e74295aac752c86380039bb28836e78e35e6eba3d0a062a0ae99ea22ba3d6e978175411a43ec9af6f9a SHA512 a077832de7076ac5e7d4c8f33edd044d0c18fd171a697ef68c1cd0f81f1938b3f008cddc1a61084181de512b643c15004744f0e79e6a44e9d239cec3d35f74fe
25 DIST rsyslog-doc-8.2004.0.tar.gz 8323570 BLAKE2B 76b6acc7614f1cbe0a4f99a2a27ff44e2706d1a570afb7d92c628154d49bde5b00a7a4ae1c7d9639f67270f3080a6637cbebb14eaa43484655b322def11b367f SHA512 1a95b334bfe4c2a1d4844983cf32e44205ec6b7cabf1a6914a9ebb335d3d8f78655caf2a55a8cf444352af7d9ae92daa09e8fdf36e520554ed4807a4ed5fd393
26 DIST rsyslog-doc-8.2006.0.tar.gz 8365252 BLAKE2B f7c6a2e153e84193b48481c9b7417170794fae0873bf9924eb6d4276f07955c2fecc78660a432dc82e23f6b3b575c81c157109a6f819ff57bda220411db36047 SHA512 03d16caef4fa77613eccd682247c1ce58b8c0ef794145c10f18da7bffad437b6b8231eb85cc0986f46b5795b6b24802b19ce0f59bec169ec67c9627e45266df7
27 +DIST rsyslog-doc-8.2008.0.tar.gz 8378149 BLAKE2B 0f6bc116a03821899d33c7960e517725487b89ea2aabc7f5d0fbd4962d82a06558737bcee67af02105006c670ec736eb5ba0b7811b25a1e627a99555121b2999 SHA512 5b8bed19017c65469eb8ea7725ef162595b30f520605f37447498ab69b5cfe8f939cee7e7915ecbf3c025871408fd7af6d45ba960a83096f83a397df4cefef09
28
29 diff --git a/app-admin/rsyslog/rsyslog-8.2008.0.ebuild b/app-admin/rsyslog/rsyslog-8.2008.0.ebuild
30 new file mode 100644
31 index 00000000000..7b351b3a307
32 --- /dev/null
33 +++ b/app-admin/rsyslog/rsyslog-8.2008.0.ebuild
34 @@ -0,0 +1,462 @@
35 +# Copyright 1999-2020 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI="6"
39 +PYTHON_COMPAT=( python{3_6,3_7,3_8} )
40 +
41 +inherit autotools eutils linux-info ltprune python-any-r1 systemd
42 +
43 +DESCRIPTION="An enhanced multi-threaded syslogd with database support and more"
44 +HOMEPAGE="https://www.rsyslog.com/"
45 +
46 +if [[ ${PV} == "9999" ]]; then
47 + EGIT_REPO_URI="https://github.com/rsyslog/${PN}.git"
48 +
49 + DOC_REPO_URI="https://github.com/rsyslog/${PN}-doc.git"
50 +
51 + inherit git-r3
52 +else
53 + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~x86"
54 +
55 + SRC_URI="
56 + https://www.rsyslog.com/files/download/${PN}/${P}.tar.gz
57 + doc? ( https://www.rsyslog.com/files/download/${PN}/${PN}-doc-${PV}.tar.gz )
58 + "
59 +fi
60 +
61 +LICENSE="GPL-3 LGPL-3 Apache-2.0"
62 +SLOT="0"
63 +IUSE="curl dbi debug doc elasticsearch +gcrypt gnutls jemalloc kafka kerberos kubernetes libressl mdblookup"
64 +IUSE+=" mongodb mysql normalize clickhouse omhttp omhttpfs omudpspoof openssl postgres"
65 +IUSE+=" rabbitmq redis relp rfc3195 rfc5424hmac snmp ssl systemd test usertools +uuid xxhash zeromq"
66 +RESTRICT="!test? ( test )"
67 +
68 +RDEPEND="
69 + >=dev-libs/libfastjson-0.99.8:=
70 + >=dev-libs/libestr-0.1.9
71 + >=sys-libs/zlib-1.2.5
72 + curl? ( >=net-misc/curl-7.35.0 )
73 + dbi? ( >=dev-db/libdbi-0.8.3 )
74 + elasticsearch? ( >=net-misc/curl-7.35.0 )
75 + gcrypt? ( >=dev-libs/libgcrypt-1.5.3:= )
76 + jemalloc? ( >=dev-libs/jemalloc-3.3.1:= )
77 + kafka? ( >=dev-libs/librdkafka-0.9.0.99:= )
78 + kerberos? ( virtual/krb5 )
79 + kubernetes? ( >=net-misc/curl-7.35.0 )
80 + mdblookup? ( dev-libs/libmaxminddb:= )
81 + mongodb? ( >=dev-libs/mongo-c-driver-1.1.10:= )
82 + mysql? ( dev-db/mysql-connector-c:= )
83 + normalize? (
84 + >=dev-libs/liblognorm-2.0.3:=
85 + )
86 + clickhouse? ( >=net-misc/curl-7.35.0 )
87 + omhttpfs? ( >=net-misc/curl-7.35.0 )
88 + omudpspoof? ( >=net-libs/libnet-1.1.6 )
89 + postgres? ( >=dev-db/postgresql-8.4.20:= )
90 + rabbitmq? ( >=net-libs/rabbitmq-c-0.3.0:= )
91 + redis? ( >=dev-libs/hiredis-0.11.0:= )
92 + relp? ( >=dev-libs/librelp-1.2.17:= )
93 + rfc3195? ( >=dev-libs/liblogging-1.0.1:=[rfc3195] )
94 + rfc5424hmac? (
95 + !libressl? ( >=dev-libs/openssl-0.9.8y:0= )
96 + libressl? ( dev-libs/libressl:= )
97 + )
98 + snmp? ( >=net-analyzer/net-snmp-5.7.2 )
99 + ssl? (
100 + gnutls? ( >=net-libs/gnutls-2.12.23:0= )
101 + openssl? (
102 + !libressl? ( dev-libs/openssl:0= )
103 + libressl? ( dev-libs/libressl:0= )
104 + )
105 + )
106 + systemd? ( >=sys-apps/systemd-234 )
107 + uuid? ( sys-apps/util-linux:0= )
108 + xxhash? ( dev-libs/xxhash:= )
109 + zeromq? (
110 + >=net-libs/czmq-4:=[drafts]
111 + )"
112 +DEPEND="${RDEPEND}
113 + >=sys-devel/autoconf-archive-2015.02.24
114 + virtual/pkgconfig
115 + elibc_musl? ( sys-libs/queue-standalone )
116 + test? (
117 + >=dev-libs/liblogging-1.0.1[stdlog]
118 + jemalloc? ( <sys-libs/libfaketime-0.9.7 )
119 + !jemalloc? ( sys-libs/libfaketime )
120 + ${PYTHON_DEPS}
121 + )"
122 +
123 +REQUIRED_USE="
124 + kubernetes? ( normalize )
125 + ssl? ( || ( gnutls openssl ) )
126 +"
127 +
128 +if [[ ${PV} == "9999" ]]; then
129 + DEPEND+=" doc? ( >=dev-python/sphinx-1.1.3-r7 )"
130 + DEPEND+=" >=sys-devel/flex-2.5.39-r1"
131 + DEPEND+=" >=sys-devel/bison-2.4.3"
132 + DEPEND+=" >=dev-python/docutils-0.12"
133 +fi
134 +
135 +CONFIG_CHECK="~INOTIFY_USER"
136 +WARNING_INOTIFY_USER="CONFIG_INOTIFY_USER isn't set. Imfile module on this system will only support polling mode!"
137 +
138 +pkg_setup() {
139 + use test && python-any-r1_pkg_setup
140 +}
141 +
142 +src_unpack() {
143 + if [[ ${PV} == "9999" ]]; then
144 + git-r3_fetch
145 + git-r3_checkout
146 + else
147 + unpack ${P}.tar.gz
148 + fi
149 +
150 + if use doc; then
151 + if [[ ${PV} == "9999" ]]; then
152 + local _EGIT_BRANCH=
153 + if [[ -n "${EGIT_BRANCH}" ]]; then
154 + # Cannot use rsyslog commits/branches for documentation repository
155 + _EGIT_BRANCH=${EGIT_BRANCH}
156 + unset EGIT_BRANCH
157 + fi
158 +
159 + git-r3_fetch "${DOC_REPO_URI}"
160 + git-r3_checkout "${DOC_REPO_URI}" "${S}"/docs
161 +
162 + if [[ -n "${_EGIT_BRANCH}" ]]; then
163 + # Restore previous EGIT_BRANCH information
164 + EGIT_BRANCH=${_EGIT_BRANCH}
165 + fi
166 + else
167 + cd "${S}" || die "Cannot change dir into '${S}'"
168 + mkdir docs || die "Failed to create docs directory"
169 + cd docs || die "Failed to change dir into '${S}/docs'"
170 + unpack ${PN}-doc-${PV}.tar.gz
171 + fi
172 + fi
173 +}
174 +
175 +src_prepare() {
176 + default
177 +
178 + # https://github.com/rsyslog/rsyslog/issues/3626
179 + sed -i \
180 + -e '\|^#!/bin/bash$|a exit 77' \
181 + tests/mmkubernetes-cache-expir*.sh \
182 + || die "Failed to disabled known test failure mmkubernetes-cache-expir*.sh"
183 +
184 + eautoreconf
185 +}
186 +
187 +src_configure() {
188 + # Maintainer notes:
189 + # * Guardtime support is missing because libgt isn't yet available
190 + # in portage.
191 + # * Hadoop's HDFS file system output module is currently not
192 + # supported in Gentoo because nobody is able to test it
193 + # (JAVA dependency).
194 + # * dev-libs/hiredis doesn't provide pkg-config (see #504614,
195 + # upstream PR 129 and 136) so we need to export HIREDIS_*
196 + # variables because rsyslog's build system depends on pkg-config.
197 +
198 + if use redis; then
199 + export HIREDIS_LIBS="-L${EPREFIX}/usr/$(get_libdir) -lhiredis"
200 + export HIREDIS_CFLAGS="-I${EPREFIX}/usr/include"
201 + fi
202 +
203 + local myeconfargs=(
204 + --disable-debug-symbols
205 + --disable-generate-man-pages
206 + --without-valgrind-testbench
207 + --disable-liblogging-stdlog
208 + $(use_enable test testbench)
209 + $(use_enable test libfaketime)
210 + $(use_enable test extended-tests)
211 + # Input Plugins without depedencies
212 + --enable-imdiag
213 + --enable-imfile
214 + --enable-impstats
215 + --enable-imptcp
216 + # Message Modificiation Plugins without depedencies
217 + --enable-mmanon
218 + --enable-mmaudit
219 + --enable-mmcount
220 + --enable-mmfields
221 + --enable-mmjsonparse
222 + --enable-mmpstrucdata
223 + --enable-mmrm1stspace
224 + --enable-mmsequence
225 + --enable-mmutf8fix
226 + # Output Modification Plugins without dependencies
227 + --enable-mail
228 + --enable-omprog
229 + --enable-omruleset
230 + --enable-omstdout
231 + --enable-omuxsock
232 + # Misc
233 + --enable-fmhash
234 + $(use_enable xxhash fmhash-xxhash)
235 + --enable-pmaixforwardedfrom
236 + --enable-pmciscoios
237 + --enable-pmcisconames
238 + --enable-pmlastmsg
239 + $(use_enable normalize pmnormalize)
240 + --enable-pmnull
241 + --enable-pmpanngfw
242 + --enable-pmsnare
243 + # DB
244 + $(use_enable dbi libdbi)
245 + $(use_enable mongodb ommongodb)
246 + $(use_enable mysql)
247 + $(use_enable postgres pgsql)
248 + $(use_enable redis omhiredis)
249 + # Debug
250 + $(use_enable debug)
251 + $(use_enable debug diagtools)
252 + $(use_enable debug valgrind)
253 + # Misc
254 + $(use_enable clickhouse)
255 + $(use_enable curl fmhttp)
256 + $(use_enable elasticsearch)
257 + $(use_enable gcrypt libgcrypt)
258 + $(use_enable jemalloc)
259 + $(use_enable kafka imkafka)
260 + $(use_enable kafka omkafka)
261 + $(use_enable kerberos gssapi-krb5)
262 + $(use_enable kubernetes mmkubernetes)
263 + $(use_enable normalize mmnormalize)
264 + $(use_enable mdblookup mmdblookup)
265 + $(use_enable omhttp)
266 + $(use_enable omhttpfs)
267 + $(use_enable omudpspoof)
268 + $(use_enable rabbitmq omrabbitmq)
269 + $(use_enable relp)
270 + $(use_enable rfc3195)
271 + $(use_enable rfc5424hmac mmrfc5424addhmac)
272 + $(use_enable snmp)
273 + $(use_enable snmp mmsnmptrapd)
274 + $(use_enable gnutls)
275 + $(use_enable openssl)
276 + $(use_enable systemd imjournal)
277 + $(use_enable systemd omjournal)
278 + $(use_enable usertools)
279 + $(use_enable uuid)
280 + $(use_enable zeromq imczmq)
281 + $(use_enable zeromq omczmq)
282 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
283 + )
284 +
285 + econf "${myeconfargs[@]}"
286 +}
287 +
288 +src_compile() {
289 + default
290 +
291 + if use doc && [[ "${PV}" == "9999" ]]; then
292 + einfo "Building documentation ..."
293 + local doc_dir="${S}/docs"
294 + cd "${doc_dir}" || die "Cannot chdir into \"${doc_dir}\"!"
295 + sphinx-build -b html source build || die "Building documentation failed!"
296 + fi
297 +}
298 +
299 +src_test() {
300 + local _has_increased_ulimit=
301 +
302 + # Sometimes tests aren't executable (i.e. when added via patch)
303 + einfo "Adjusting permissions of test scripts ..."
304 + find "${S}"/tests -type f -name '*.sh' \! -perm -111 -exec chmod a+x '{}' \; || \
305 + die "Failed to adjust test scripts permission"
306 +
307 + if ulimit -n 3072; then
308 + _has_increased_ulimit="true"
309 + fi
310 +
311 + if ! emake --jobs 1 check; then
312 + eerror "Test suite failed! :("
313 +
314 + if [[ -z "${_has_increased_ulimit}" ]]; then
315 + eerror "Probably because open file limit couldn't be set to 3072."
316 + fi
317 +
318 + if has userpriv ${FEATURES}; then
319 + eerror "Please try to reproduce the test suite failure with FEATURES=-userpriv " \
320 + "before you submit a bug report."
321 + fi
322 +
323 + fi
324 +}
325 +
326 +src_install() {
327 + local DOCS=(
328 + AUTHORS
329 + ChangeLog
330 + "${FILESDIR}"/README.gentoo
331 + )
332 +
333 + use doc && local HTML_DOCS=( "${S}/docs/build/." )
334 +
335 + default
336 +
337 + newconfd "${FILESDIR}/${PN}.confd-r1" ${PN}
338 + newinitd "${FILESDIR}/${PN}.initd-r1" ${PN}
339 +
340 + keepdir /var/empty/dev
341 + keepdir /var/spool/${PN}
342 + keepdir /etc/ssl/${PN}
343 + keepdir /etc/${PN}.d
344 +
345 + insinto /etc
346 + newins "${FILESDIR}/${PN}.conf" ${PN}.conf
347 +
348 + insinto /etc/rsyslog.d/
349 + newins "${FILESDIR}/50-default-r1.conf" 50-default.conf
350 +
351 + insinto /etc/logrotate.d/
352 + newins "${FILESDIR}/${PN}-r1.logrotate" ${PN}
353 +
354 + if use mysql; then
355 + insinto /usr/share/${PN}/scripts/mysql
356 + doins plugins/ommysql/createDB.sql
357 + fi
358 +
359 + if use postgres; then
360 + insinto /usr/share/${PN}/scripts/pgsql
361 + doins plugins/ompgsql/createDB.sql
362 + fi
363 +
364 + prune_libtool_files --modules
365 +}
366 +
367 +pkg_postinst() {
368 + local advertise_readme=0
369 +
370 + if [[ -z "${REPLACING_VERSIONS}" ]]; then
371 + # This is a new installation
372 +
373 + advertise_readme=1
374 +
375 + if use mysql || use postgres; then
376 + echo
377 + elog "Sample SQL scripts for MySQL & PostgreSQL have been installed to:"
378 + elog " /usr/share/doc/${PF}/scripts"
379 + fi
380 +
381 + if use ssl; then
382 + echo
383 + elog "To create a default CA and certificates for your server and clients, run:"
384 + elog " emerge --config =${PF}"
385 + elog "on your logging server. You can run it several times,"
386 + elog "once for each logging client. The client certificates will be signed"
387 + elog "using the CA certificate generated during the first run."
388 + fi
389 + fi
390 +
391 + if [[ ${advertise_readme} -gt 0 ]]; then
392 + # We need to show the README file location
393 +
394 + echo ""
395 + elog "Please read"
396 + elog ""
397 + elog " ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"
398 + elog ""
399 + elog "for more details."
400 + fi
401 +}
402 +
403 +pkg_config() {
404 + if ! use ssl ; then
405 + einfo "There is nothing to configure for rsyslog unless you"
406 + einfo "used USE=ssl to build it."
407 + return 0
408 + fi
409 +
410 + # Make sure the certificates directory exists
411 + local CERTDIR="${EROOT}/etc/ssl/${PN}"
412 + if [[ ! -d "${CERTDIR}" ]]; then
413 + mkdir "${CERTDIR}" || die
414 + fi
415 + einfo "Your certificates will be stored in ${CERTDIR}"
416 +
417 + # Create a default CA if needed
418 + if [[ ! -f "${CERTDIR}/${PN}_ca.cert.pem" ]]; then
419 + einfo "No CA key and certificate found in ${CERTDIR}, creating them for you..."
420 + certtool --generate-privkey \
421 + --outfile "${CERTDIR}/${PN}_ca.privkey.pem" &>/dev/null
422 + chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
423 +
424 + cat > "${T}/${PF}.$$" <<- _EOF
425 + cn = Portage automated CA
426 + ca
427 + cert_signing_key
428 + expiration_days = 3650
429 + _EOF
430 +
431 + certtool --generate-self-signed \
432 + --load-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
433 + --outfile "${CERTDIR}/${PN}_ca.cert.pem" \
434 + --template "${T}/${PF}.$$" &>/dev/null
435 + chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
436 +
437 + # Create the server certificate
438 + echo
439 + einfon "Please type the Common Name of the SERVER you wish to create a certificate for: "
440 + read -r CN
441 +
442 + einfo "Creating private key and certificate for server ${CN}..."
443 + certtool --generate-privkey \
444 + --outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
445 + chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
446 +
447 + cat > "${T}/${PF}.$$" <<- _EOF
448 + cn = ${CN}
449 + tls_www_server
450 + dns_name = ${CN}
451 + expiration_days = 3650
452 + _EOF
453 +
454 + certtool --generate-certificate \
455 + --outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
456 + --load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
457 + --load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
458 + --load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
459 + --template "${T}/${PF}.$$" &>/dev/null
460 + chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
461 +
462 + else
463 + einfo "Found existing ${CERTDIR}/${PN}_ca.cert.pem, skipping CA and SERVER creation."
464 + fi
465 +
466 + # Create a client certificate
467 + echo
468 + einfon "Please type the Common Name of the CLIENT you wish to create a certificate for: "
469 + read -r CN
470 +
471 + einfo "Creating private key and certificate for client ${CN}..."
472 + certtool --generate-privkey \
473 + --outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
474 + chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
475 +
476 + cat > "${T}/${PF}.$$" <<- _EOF
477 + cn = ${CN}
478 + tls_www_client
479 + dns_name = ${CN}
480 + expiration_days = 3650
481 + _EOF
482 +
483 + certtool --generate-certificate \
484 + --outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
485 + --load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
486 + --load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
487 + --load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
488 + --template "${T}/${PF}.$$" &>/dev/null
489 + chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
490 +
491 + rm -f "${T}/${PF}.$$"
492 +
493 + echo
494 + einfo "Here is the documentation on how to encrypt your log traffic:"
495 + einfo " https://www.rsyslog.com/doc/rsyslog_tls.html"
496 +}