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