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