commit:     cb8d44f44ac283f7b7e7fd1d4d5fe0e35649deed
Author:     callmetango <callmetango <AT> users <DOT> noreply <DOT> github 
<DOT> com>
AuthorDate: Wed Jan 25 19:31:26 2017 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sun Jan 29 11:15:54 2017 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=cb8d44f4

app-admin/rsyslog: added version 8.24.0 with patches from Alpine Linux

 app-admin/rsyslog/Manifest                         |  12 +
 app-admin/rsyslog/files/8-stable/50-default.conf   |  95 ++++
 .../8-stable/50-rsyslog-8.18.0-musl-fix.patch      |  13 +
 .../50-rsyslog-8.18.0-musl-imptcp-queue.patch      | 594 +++++++++++++++++++++
 app-admin/rsyslog/files/8-stable/README.gentoo     |  36 ++
 app-admin/rsyslog/files/8-stable/rsyslog.conf      |  61 +++
 app-admin/rsyslog/files/8-stable/rsyslog.confd-r1  |  30 ++
 app-admin/rsyslog/files/8-stable/rsyslog.initd-r1  |  73 +++
 app-admin/rsyslog/files/8-stable/rsyslog.logrotate |  37 ++
 app-admin/rsyslog/metadata.xml                     |  40 ++
 app-admin/rsyslog/rsyslog-8.24.0.ebuild            | 458 ++++++++++++++++
 11 files changed, 1449 insertions(+)

diff --git a/app-admin/rsyslog/Manifest b/app-admin/rsyslog/Manifest
new file mode 100644
index 0000000..1ba3d5e
--- /dev/null
+++ b/app-admin/rsyslog/Manifest
@@ -0,0 +1,12 @@
+AUX 8-stable/50-default.conf 1701 SHA256 
61c1dd1450f574a21a8d8375faaf3e42f9856df91011150ff13c0cfddc86ed41 SHA512 
33e4e63239b9112fec1a37115ac80ab8dbd6e7189d9d29b1bc743c433e0124ea0d1a4cf6f7ada9e5b92e9b0025b6617a1a16f4c491e743bbf4327a5f376a1ea9
 WHIRLPOOL 
d33b83bb690e78b5e5f7cfc090d21da03615c891a287b1f3a92a51514dcad1f5dfe8d2ceed867b3007768d47f48d207fac43a1ff33a85b24c21a5531cdf9d311
+AUX 8-stable/50-rsyslog-8.18.0-musl-fix.patch 300 SHA256 
5b8420570bef57aeba55965bbbddb29f966b60a33ef9e7fc5f921820274080b0 SHA512 
20967235e8233588210071a7157a81fe02a1e88d7c7f55855fcc2fe34295269a6e3e3bfccb3d4dd83a6a48da28948c92d6ce47a0c5d817f6b6a4030635f4f896
 WHIRLPOOL 
e8a07737f7e282905bf92112b2d94303605cb2f8da0d5c0598f41bdb8d060a18f5d6f2b70a8f5f3feec5cb0a24109fdf4f2e1ebd0517e8063d72c763e345501f
+AUX 8-stable/50-rsyslog-8.18.0-musl-imptcp-queue.patch 20588 SHA256 
8d6dda439c79dffac2a5d17e3d9a28355cfb8fc264175a871e27304ace259daa SHA512 
de8b82781af2dfef67b2215782721cca2ee5db9d08ed3260f4e3390353a59bf4bd76701df682c4bf537ce817eabf79b062c4b2a3e20e4175e7d77ca08c5a700f
 WHIRLPOOL 
cf1d3c2e434c7843e9874b8138ecb3777cc4e384477b2c3936b9d5c10e13e2493461c433c58760a35ba20638c5acd1e03c7fae718f5d2a6b0017ea34e66b0a67
+AUX 8-stable/README.gentoo 1126 SHA256 
29b4c68f521f2f1f138f44c4635da1a270fed9cbd4a780569754080987aa777c SHA512 
46fdf3350e2005d3ef588d50dfc6d474a1b5d3010329b656879a43cbbd7be0cd91944b88d3838f45f69c830fc28c42e7fac2cd52e0a4b24bb6780562d59ae384
 WHIRLPOOL 
a1a3ec8b887110a01e8c1c1320f25493dd8ff343e4b08780c30c9bc3bb842afa0ef79db08195db876697c1a69807f49a8b3793609d25f78559fa534507fc195e
+AUX 8-stable/rsyslog.conf 1562 SHA256 
fc70a94213b5eb519febf9aa7d758ee9526433bcc5683bcb7451d16e65a2f5b0 SHA512 
1720174fab020e2de590f3d6bbb03784aca1928fe05f7e75e02fb4597cb8b2ee755e6deb8e8f989060511044ae483f791f496f24e0eecaf27eb9e0b5e20a2c7a
 WHIRLPOOL 
97cf3fdee62a9339b412ebe93b71b2d6804df60aad9cb7e71779fcaddb01d489e38bbb353557864ea38aba384e664e6da636812c3c078ed9e22e261ed7b78cba
+AUX 8-stable/rsyslog.confd-r1 1145 SHA256 
0be3575df8010523de6b37e98c417192e8ec481292ca9fb47c8d2211795e03a6 SHA512 
a7f8621bdd490596b09f9a7583dd0c992006c55335b2e6e687bef4141bb18cd4bb43e23f590a138e9c8d5a3cbac0cc46c3b01c7d3ff9f9dd3c53418b13b0dd4a
 WHIRLPOOL 
05079ab1a55aca9b68c81c8b7da66ff029f72c7168bd15faebf7d7172dddc69f6ffb2864e1fcd8c1f2dbb51416bea89fab3667a34ed7295b3abafc6a93883d3e
+AUX 8-stable/rsyslog.initd-r1 1765 SHA256 
2c8800c31b8411899b49036bd51ed58a625ee8b7bd523b18d6ad8b7399da0324 SHA512 
07a73ddd6e50b9d4ae7d9633c71b6e96e86f3348e242506d9f6a86a0f367e6bc671bed559f9d69232096e7dce7a062be7107794fc2564829d53f42d4d30d8daf
 WHIRLPOOL 
734780723ae73f573c3104c35460e8ef9e5915433012c1a2ca987bea7de37a3a423315ca6f1da06dbf0af6fabc14051c89f7e682592d6ccaa1e39432d5648477
+AUX 8-stable/rsyslog.logrotate 682 SHA256 
89cc8f13c1f7a3ae446b40da7b31cdf471e2c9e2d3d5b8f48e524f7a82fbff89 SHA512 
6c58abd2f02157177a61695f53eccbf201c514821b0c551a4812621e8d3dd2da9b5cd651d93860cb51ebdbdc7056d0ef0dde99c2a57ac3c43aa968a141805912
 WHIRLPOOL 
9d29c2c9351252887c3dad78962df942bb1cd7387eb44e3c98764319f82d90c42d255a5642c55bb37811fb903e1c5314ca536bc9d32ccfd0535f0579f4e25ff0
+DIST rsyslog-8.24.0.tar.gz 2374240 SHA256 
37f32ce33e32a88e1bea0511e8e557d90b7378b81520e3236a9af5ba6ea993d7 SHA512 
b25b8ae72133376f732f54863c97aea3c8dfbf37c62c6a61840932996913c9d4e63155a24ffc577db48a18514f3e35b6fb109b1864380ba93ddf3fa6d84d728d
 WHIRLPOOL 
c5895d50143c21d446d760f5179b47fdae4ec34867711c942cd671b88789588e7244fb8511745efdb701954f7bc390403d30736a1e54af13dca4876f989928df
+DIST rsyslog-docs-8.24.0.tar.gz 4344877 SHA256 
f5e3c27c5b65abdd600b8ad8d99d1f2fe9f0ffca02d6af3c12db5fc10dd889b2 SHA512 
b55cde1485a7baec6d4c4928107c22a078cf412a2994c0dfcbb12c47b49c3b263af8a64011b1329567cf86e04927b9e383581dc868eaea81d554adada6b3786b
 WHIRLPOOL 
e8b2d10b0de3c33189f859f08db58e319730e709e5a5008909f2166a061952290b0bf96163cdf6e0b3829896916f712ba5d8a2a98f02d796e9174d8919190f8d
+EBUILD rsyslog-8.24.0.ebuild 12535 SHA256 
f28ffdca451c8aa25b0d0ac0ddaa67020b97a3bccff808cf5e70f23a7aa2d7e1 SHA512 
0771d4393c5d8810bfebacd1cd02551b43fabd6735b97d19eb981bc5f12de570c936dcc904c7b0c033fc82c3b17ed50e01002cf135efbabecf38fe26dccadfb7
 WHIRLPOOL 
5517de203346ac9df20dffa8380856247c9363cc4ca07fc528a0d38660a1a641dc38ecaf09044a5d9099c6bf4405b207e684351524bf86f781a785e7782afb30
+MISC metadata.xml 3208 SHA256 
fea8bfdbfdb071e0829580a8f4eec63f4f610f5601476d5797c41912810d62e2 SHA512 
6cfc5d8c80c34336eb96eee711d5d58ff66f15f3241c6ad3cacdebffc3700eecb6dde131b46b3e3d1b817c7e30d700ff2baf536595aa1087d2622df4215faf4c
 WHIRLPOOL 
ae0be1b1c1c84b75720ba3c7c5d8a1c4ab00b33bda8879ef2863f1727fe83c2c5dbfa065d9dbfb50eb9f93db73a3a3c8589846bd100cef1bc41dcbcfc044eafa

diff --git a/app-admin/rsyslog/files/8-stable/50-default.conf 
b/app-admin/rsyslog/files/8-stable/50-default.conf
new file mode 100644
index 0000000..9ae8578
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/50-default.conf
@@ -0,0 +1,95 @@
+#######################
+### DEFAULT ACTIONS ###
+#######################
+
+auth,authpriv.* action(
+       type="omfile"
+       File="/var/log/auth.log"
+       FileCreateMode="0600"
+       FileOwner="root"
+       FileGroup="adm"
+       Sync="off"
+)
+
+cron.* action(
+       type="omfile"
+       File="/var/log/cron.log"
+       FileOwner="root"
+       FileGroup="adm"
+)
+
+daemon.* action(
+       type="omfile"
+       File="/var/log/daemon.log"
+       FileOwner="root"
+       FileGroup="adm"
+)
+
+kern.* action(
+       type="omfile"
+       File="/var/log/kern.log"
+       FileOwner="root"
+       FileGroup="adm"
+)
+
+lpr.* action(
+       type="omfile"
+       File="/var/log/lpr.log"
+       FileOwner="root"
+       FileGroup="adm"
+)
+
+mail.* action(
+       type="omfile"
+       File="/var/log/mail.log"
+       FileOwner="root"
+       FileGroup="adm"
+)
+
+news.* action(
+       type="omfile"
+       File="/var/log/news.log"
+       FileOwner="root"
+       FileGroup="adm"
+)
+
+user.* action(
+       type="omfile"
+       File="/var/log/user.log"
+       FileOwner="root"
+       FileGroup="adm"
+)
+
+*.=debug;auth,authpriv,news,mail.none action(
+       type="omfile"
+       File="/var/log/debug.log"
+       FileOwner="root"
+       FileGroup="adm"
+)
+
+*.info;auth,authpriv,cron,daemon,lpr,mail,news.none action(
+       type="omfile"
+       File="/var/log/messages"
+       FileOwner="root"
+       FileGroup="adm"
+)
+
+# Uncomment the following directive to re-enable the
+# deprecated "/var/log/syslog" log file (don't forget to re-enable log
+# rotation in "/etc/logrotate.d/rsyslog" if you do that!)
+#*.*;auth,authpriv.none action(
+#      type="omfile"
+#      File="/var/log/syslog"
+#      FileOwner="root"
+#      FileGroup="adm"
+#)
+
+*.emerg action(
+       type="omusrmsg"
+       Users="*"
+       action.execOnlyOnceEveryInterval="10"
+)
+
+# Create an additional socket for the default chroot location
+# (used by net-misc/openssh[hpn], see https://bugs.gentoo.org/490744)
+input(type="imuxsock" Socket="/var/empty/dev/log")

diff --git a/app-admin/rsyslog/files/8-stable/50-rsyslog-8.18.0-musl-fix.patch 
b/app-admin/rsyslog/files/8-stable/50-rsyslog-8.18.0-musl-fix.patch
new file mode 100644
index 0000000..bfd20b5
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/50-rsyslog-8.18.0-musl-fix.patch
@@ -0,0 +1,13 @@
+--- rsyslog-8.16.0/runtime/rsyslog.h
++++ rsyslog-8.16.0-musl/runtime/rsyslog.h
+@@ -643,3 +643,10 @@
+ #endif
+
+ #endif /* multi-include protection */
++
++/*  musl patches for alpine */
++#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)
++#define GLOB_BRACE 0
++#ifndef WAIT_ANY
++#define WAIT_ANY (-1)
++#endif

diff --git 
a/app-admin/rsyslog/files/8-stable/50-rsyslog-8.18.0-musl-imptcp-queue.patch 
b/app-admin/rsyslog/files/8-stable/50-rsyslog-8.18.0-musl-imptcp-queue.patch
new file mode 100644
index 0000000..863fbd2
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/50-rsyslog-8.18.0-musl-imptcp-queue.patch
@@ -0,0 +1,594 @@
+--- rsyslog-8.18.0/plugins/imptcp/imptcp.c
++++ rsyslog-8.18.0-b/plugins/imptcp/imptcp.c
+@@ -50,13 +50,13 @@
+ #include <sys/socket.h>
+ #include <sys/un.h>
+ #include <sys/epoll.h>
+-#include <sys/queue.h>
+ #include <netinet/tcp.h>
+ #include <stdint.h>
+ #include <zlib.h>
+ #if HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
++#include "queue.h"
+ #include "rsyslog.h"
+ #include "cfsysline.h"
+ #include "prop.h"
+--- /dev/null
++++ rsyslog-8.18.0-b/plugins/imptcp/queue.h
+@@ -0,0 +1,574 @@
++/*
++ * Copyright (c) 1991, 1993
++ *    The Regents of the University of California.  All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the University nor the names of its contributors
++ *    may be used to endorse or promote products derived from this software
++ *    without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ *    @(#)queue.h     8.5 (Berkeley) 8/20/94
++ */
++
++#ifndef       _SYS_QUEUE_H_
++#define       _SYS_QUEUE_H_
++
++/*
++ * This file defines five types of data structures: singly-linked lists,
++ * lists, simple queues, tail queues, and circular queues.
++ *
++ * A singly-linked list is headed by a single forward pointer. The
++ * elements are singly linked for minimum space and pointer manipulation
++ * overhead at the expense of O(n) removal for arbitrary elements. New
++ * elements can be added to the list after an existing element or at the
++ * head of the list.  Elements being removed from the head of the list
++ * should use the explicit macro for this purpose for optimum
++ * efficiency. A singly-linked list may only be traversed in the forward
++ * direction.  Singly-linked lists are ideal for applications with large
++ * datasets and few or no removals or for implementing a LIFO queue.
++ *
++ * A list is headed by a single forward pointer (or an array of forward
++ * pointers for a hash table header). The elements are doubly linked
++ * so that an arbitrary element can be removed without a need to
++ * traverse the list. New elements can be added to the list before
++ * or after an existing element or at the head of the list. A list
++ * may only be traversed in the forward direction.
++ *
++ * A simple queue is headed by a pair of pointers, one the head of the
++ * list and the other to the tail of the list. The elements are singly
++ * linked to save space, so elements can only be removed from the
++ * head of the list. New elements can be added to the list after
++ * an existing element, at the head of the list, or at the end of the
++ * list. A simple queue may only be traversed in the forward direction.
++ *
++ * A tail queue is headed by a pair of pointers, one to the head of the
++ * list and the other to the tail of the list. The elements are doubly
++ * linked so that an arbitrary element can be removed without a need to
++ * traverse the list. New elements can be added to the list before or
++ * after an existing element, at the head of the list, or at the end of
++ * the list. A tail queue may be traversed in either direction.
++ *
++ * A circle queue is headed by a pair of pointers, one to the head of the
++ * list and the other to the tail of the list. The elements are doubly
++ * linked so that an arbitrary element can be removed without a need to
++ * traverse the list. New elements can be added to the list before or after
++ * an existing element, at the head of the list, or at the end of the list.
++ * A circle queue may be traversed in either direction, but has a more
++ * complex end of list detection.
++ *
++ * For details on the use of these macros, see the queue(3) manual page.
++ */
++
++/*
++ * List definitions.
++ */
++#define       LIST_HEAD(name, type)                                           
\
++struct name {                                                         \
++      struct type *lh_first;  /* first element */                     \
++}
++
++#define       LIST_HEAD_INITIALIZER(head)                                     
\
++      { NULL }
++
++#define       LIST_ENTRY(type)                                                
\
++struct {                                                              \
++      struct type *le_next;   /* next element */                      \
++      struct type **le_prev;  /* address of previous next element */  \
++}
++
++/*
++ * List functions.
++ */
++#define       LIST_INIT(head) do {                                            
\
++      (head)->lh_first = NULL;                                        \
++} while (/*CONSTCOND*/0)
++
++#define       LIST_INSERT_AFTER(listelm, elm, field) do {                     
\
++      if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)  \
++              (listelm)->field.le_next->field.le_prev =               \
++                  &(elm)->field.le_next;                              \
++      (listelm)->field.le_next = (elm);                               \
++      (elm)->field.le_prev = &(listelm)->field.le_next;               \
++} while (/*CONSTCOND*/0)
++
++#define       LIST_INSERT_BEFORE(listelm, elm, field) do {                    
\
++      (elm)->field.le_prev = (listelm)->field.le_prev;                \
++      (elm)->field.le_next = (listelm);                               \
++      *(listelm)->field.le_prev = (elm);                              \
++      (listelm)->field.le_prev = &(elm)->field.le_next;               \
++} while (/*CONSTCOND*/0)
++
++#define       LIST_INSERT_HEAD(head, elm, field) do {                         
\
++      if (((elm)->field.le_next = (head)->lh_first) != NULL)          \
++              (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
++      (head)->lh_first = (elm);                                       \
++      (elm)->field.le_prev = &(head)->lh_first;                       \
++} while (/*CONSTCOND*/0)
++
++#define       LIST_REMOVE(elm, field) do {                                    
\
++      if ((elm)->field.le_next != NULL)                               \
++              (elm)->field.le_next->field.le_prev =                   \
++                  (elm)->field.le_prev;                               \
++      *(elm)->field.le_prev = (elm)->field.le_next;                   \
++} while (/*CONSTCOND*/0)
++
++#define       LIST_FOREACH(var, head, field)                                  
\
++      for ((var) = ((head)->lh_first);                                \
++              (var);                                                  \
++              (var) = ((var)->field.le_next))
++
++/*
++ * List access methods.
++ */
++#define       LIST_EMPTY(head)                ((head)->lh_first == NULL)
++#define       LIST_FIRST(head)                ((head)->lh_first)
++#define       LIST_NEXT(elm, field)           ((elm)->field.le_next)
++
++
++/*
++ * Singly-linked List definitions.
++ */
++#define       SLIST_HEAD(name, type)                                          
\
++struct name {                                                         \
++      struct type *slh_first; /* first element */                     \
++}
++
++#define       SLIST_HEAD_INITIALIZER(head)                                    
\
++      { NULL }
++
++#define       SLIST_ENTRY(type)                                               
\
++struct {                                                              \
++      struct type *sle_next;  /* next element */                      \
++}
++
++/*
++ * Singly-linked List functions.
++ */
++#define       SLIST_INIT(head) do {                                           
\
++      (head)->slh_first = NULL;                                       \
++} while (/*CONSTCOND*/0)
++
++#define       SLIST_INSERT_AFTER(slistelm, elm, field) do {                   
\
++      (elm)->field.sle_next = (slistelm)->field.sle_next;             \
++      (slistelm)->field.sle_next = (elm);                             \
++} while (/*CONSTCOND*/0)
++
++#define       SLIST_INSERT_HEAD(head, elm, field) do {                        
\
++      (elm)->field.sle_next = (head)->slh_first;                      \
++      (head)->slh_first = (elm);                                      \
++} while (/*CONSTCOND*/0)
++
++#define       SLIST_REMOVE_HEAD(head, field) do {                             
\
++      (head)->slh_first = (head)->slh_first->field.sle_next;          \
++} while (/*CONSTCOND*/0)
++
++#define       SLIST_REMOVE(head, elm, type, field) do {                       
\
++      if ((head)->slh_first == (elm)) {                               \
++              SLIST_REMOVE_HEAD((head), field);                       \
++      }                                                               \
++      else {                                                          \
++              struct type *curelm = (head)->slh_first;                \
++              while(curelm->field.sle_next != (elm))                  \
++                      curelm = curelm->field.sle_next;                \
++              curelm->field.sle_next =                                \
++                  curelm->field.sle_next->field.sle_next;             \
++      }                                                               \
++} while (/*CONSTCOND*/0)
++
++#define       SLIST_FOREACH(var, head, field)                                 
\
++      for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
++
++/*
++ * Singly-linked List access methods.
++ */
++#define       SLIST_EMPTY(head)       ((head)->slh_first == NULL)
++#define       SLIST_FIRST(head)       ((head)->slh_first)
++#define       SLIST_NEXT(elm, field)  ((elm)->field.sle_next)
++
++
++/*
++ * Singly-linked Tail queue declarations.
++ */
++#define       STAILQ_HEAD(name, type)                                 \
++struct name {                                                         \
++      struct type *stqh_first;        /* first element */                     
\
++      struct type **stqh_last;        /* addr of last next element */         
\
++}
++
++#define       STAILQ_HEAD_INITIALIZER(head)                                   
\
++      { NULL, &(head).stqh_first }
++
++#define       STAILQ_ENTRY(type)                                              
\
++struct {                                                              \
++      struct type *stqe_next; /* next element */                      \
++}
++
++/*
++ * Singly-linked Tail queue functions.
++ */
++#define       STAILQ_INIT(head) do {                                          
\
++      (head)->stqh_first = NULL;                                      \
++      (head)->stqh_last = &(head)->stqh_first;                                
\
++} while (/*CONSTCOND*/0)
++
++#define       STAILQ_INSERT_HEAD(head, elm, field) do {                       
\
++      if (((elm)->field.stqe_next = (head)->stqh_first) == NULL)      \
++              (head)->stqh_last = &(elm)->field.stqe_next;            \
++      (head)->stqh_first = (elm);                                     \
++} while (/*CONSTCOND*/0)
++
++#define       STAILQ_INSERT_TAIL(head, elm, field) do {                       
\
++      (elm)->field.stqe_next = NULL;                                  \
++      *(head)->stqh_last = (elm);                                     \
++      (head)->stqh_last = &(elm)->field.stqe_next;                    \
++} while (/*CONSTCOND*/0)
++
++#define       STAILQ_INSERT_AFTER(head, listelm, elm, field) do {             
\
++      if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
++              (head)->stqh_last = &(elm)->field.stqe_next;            \
++      (listelm)->field.stqe_next = (elm);                             \
++} while (/*CONSTCOND*/0)
++
++#define       STAILQ_REMOVE_HEAD(head, field) do {                            
\
++      if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) 
\
++              (head)->stqh_last = &(head)->stqh_first;                        
\
++} while (/*CONSTCOND*/0)
++
++#define       STAILQ_REMOVE(head, elm, type, field) do {                      
\
++      if ((head)->stqh_first == (elm)) {                              \
++              STAILQ_REMOVE_HEAD((head), field);                      \
++      } else {                                                        \
++              struct type *curelm = (head)->stqh_first;               \
++              while (curelm->field.stqe_next != (elm))                        
\
++                      curelm = curelm->field.stqe_next;               \
++              if ((curelm->field.stqe_next =                          \
++                      curelm->field.stqe_next->field.stqe_next) == NULL) \
++                          (head)->stqh_last = &(curelm)->field.stqe_next; \
++      }                                                               \
++} while (/*CONSTCOND*/0)
++
++#define       STAILQ_FOREACH(var, head, field)                                
\
++      for ((var) = ((head)->stqh_first);                              \
++              (var);                                                  \
++              (var) = ((var)->field.stqe_next))
++
++#define       STAILQ_CONCAT(head1, head2) do {                                
\
++      if (!STAILQ_EMPTY((head2))) {                                   \
++              *(head1)->stqh_last = (head2)->stqh_first;              \
++              (head1)->stqh_last = (head2)->stqh_last;                \
++              STAILQ_INIT((head2));                                   \
++      }                                                               \
++} while (/*CONSTCOND*/0)
++
++/*
++ * Singly-linked Tail queue access methods.
++ */
++#define       STAILQ_EMPTY(head)      ((head)->stqh_first == NULL)
++#define       STAILQ_FIRST(head)      ((head)->stqh_first)
++#define       STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
++
++
++/*
++ * Simple queue definitions.
++ */
++#define       SIMPLEQ_HEAD(name, type)                                        
\
++struct name {                                                         \
++      struct type *sqh_first; /* first element */                     \
++      struct type **sqh_last; /* addr of last next element */         \
++}
++
++#define       SIMPLEQ_HEAD_INITIALIZER(head)                                  
\
++      { NULL, &(head).sqh_first }
++
++#define       SIMPLEQ_ENTRY(type)                                             
\
++struct {                                                              \
++      struct type *sqe_next;  /* next element */                      \
++}
++
++/*
++ * Simple queue functions.
++ */
++#define       SIMPLEQ_INIT(head) do {                                         
\
++      (head)->sqh_first = NULL;                                       \
++      (head)->sqh_last = &(head)->sqh_first;                          \
++} while (/*CONSTCOND*/0)
++
++#define       SIMPLEQ_INSERT_HEAD(head, elm, field) do {                      
\
++      if (((elm)->field.sqe_next = (head)->sqh_first) == NULL)        \
++              (head)->sqh_last = &(elm)->field.sqe_next;              \
++      (head)->sqh_first = (elm);                                      \
++} while (/*CONSTCOND*/0)
++
++#define       SIMPLEQ_INSERT_TAIL(head, elm, field) do {                      
\
++      (elm)->field.sqe_next = NULL;                                   \
++      *(head)->sqh_last = (elm);                                      \
++      (head)->sqh_last = &(elm)->field.sqe_next;                      \
++} while (/*CONSTCOND*/0)
++
++#define       SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do {            
\
++      if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
++              (head)->sqh_last = &(elm)->field.sqe_next;              \
++      (listelm)->field.sqe_next = (elm);                              \
++} while (/*CONSTCOND*/0)
++
++#define       SIMPLEQ_REMOVE_HEAD(head, field) do {                           
\
++      if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
++              (head)->sqh_last = &(head)->sqh_first;                  \
++} while (/*CONSTCOND*/0)
++
++#define       SIMPLEQ_REMOVE(head, elm, type, field) do {                     
\
++      if ((head)->sqh_first == (elm)) {                               \
++              SIMPLEQ_REMOVE_HEAD((head), field);                     \
++      } else {                                                        \
++              struct type *curelm = (head)->sqh_first;                \
++              while (curelm->field.sqe_next != (elm))                 \
++                      curelm = curelm->field.sqe_next;                \
++              if ((curelm->field.sqe_next =                           \
++                      curelm->field.sqe_next->field.sqe_next) == NULL) \
++                          (head)->sqh_last = &(curelm)->field.sqe_next; \
++      }                                                               \
++} while (/*CONSTCOND*/0)
++
++#define       SIMPLEQ_FOREACH(var, head, field)                               
\
++      for ((var) = ((head)->sqh_first);                               \
++              (var);                                                  \
++              (var) = ((var)->field.sqe_next))
++
++/*
++ * Simple queue access methods.
++ */
++#define       SIMPLEQ_EMPTY(head)             ((head)->sqh_first == NULL)
++#define       SIMPLEQ_FIRST(head)             ((head)->sqh_first)
++#define       SIMPLEQ_NEXT(elm, field)        ((elm)->field.sqe_next)
++
++
++/*
++ * Tail queue definitions.
++ */
++#define       _TAILQ_HEAD(name, type, qual)                                   
\
++struct name {                                                         \
++      qual type *tqh_first;           /* first element */             \
++      qual type *qual *tqh_last;      /* addr of last next element */ \
++}
++#define TAILQ_HEAD(name, type)        _TAILQ_HEAD(name, struct type,)
++
++#define       TAILQ_HEAD_INITIALIZER(head)                                    
\
++      { NULL, &(head).tqh_first }
++
++#define       _TAILQ_ENTRY(type, qual)                                        
\
++struct {                                                              \
++      qual type *tqe_next;            /* next element */              \
++      qual type *qual *tqe_prev;      /* address of previous next element */\
++}
++#define TAILQ_ENTRY(type)     _TAILQ_ENTRY(struct type,)
++
++/*
++ * Tail queue functions.
++ */
++#define       TAILQ_INIT(head) do {                                           
\
++      (head)->tqh_first = NULL;                                       \
++      (head)->tqh_last = &(head)->tqh_first;                          \
++} while (/*CONSTCOND*/0)
++
++#define       TAILQ_INSERT_HEAD(head, elm, field) do {                        
\
++      if (((elm)->field.tqe_next = (head)->tqh_first) != NULL)        \
++              (head)->tqh_first->field.tqe_prev =                     \
++                  &(elm)->field.tqe_next;                             \
++      else                                                            \
++              (head)->tqh_last = &(elm)->field.tqe_next;              \
++      (head)->tqh_first = (elm);                                      \
++      (elm)->field.tqe_prev = &(head)->tqh_first;                     \
++} while (/*CONSTCOND*/0)
++
++#define       TAILQ_INSERT_TAIL(head, elm, field) do {                        
\
++      (elm)->field.tqe_next = NULL;                                   \
++      (elm)->field.tqe_prev = (head)->tqh_last;                       \
++      *(head)->tqh_last = (elm);                                      \
++      (head)->tqh_last = &(elm)->field.tqe_next;                      \
++} while (/*CONSTCOND*/0)
++
++#define       TAILQ_INSERT_AFTER(head, listelm, elm, field) do {              
\
++      if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
++              (elm)->field.tqe_next->field.tqe_prev =                 \
++                  &(elm)->field.tqe_next;                             \
++      else                                                            \
++              (head)->tqh_last = &(elm)->field.tqe_next;              \
++      (listelm)->field.tqe_next = (elm);                              \
++      (elm)->field.tqe_prev = &(listelm)->field.tqe_next;             \
++} while (/*CONSTCOND*/0)
++
++#define       TAILQ_INSERT_BEFORE(listelm, elm, field) do {                   
\
++      (elm)->field.tqe_prev = (listelm)->field.tqe_prev;              \
++      (elm)->field.tqe_next = (listelm);                              \
++      *(listelm)->field.tqe_prev = (elm);                             \
++      (listelm)->field.tqe_prev = &(elm)->field.tqe_next;             \
++} while (/*CONSTCOND*/0)
++
++#define       TAILQ_REMOVE(head, elm, field) do {                             
\
++      if (((elm)->field.tqe_next) != NULL)                            \
++              (elm)->field.tqe_next->field.tqe_prev =                 \
++                  (elm)->field.tqe_prev;                              \
++      else                                                            \
++              (head)->tqh_last = (elm)->field.tqe_prev;               \
++      *(elm)->field.tqe_prev = (elm)->field.tqe_next;                 \
++} while (/*CONSTCOND*/0)
++
++#define       TAILQ_FOREACH(var, head, field)                                 
\
++      for ((var) = ((head)->tqh_first);                               \
++              (var);                                                  \
++              (var) = ((var)->field.tqe_next))
++
++#define       TAILQ_FOREACH_REVERSE(var, head, headname, field)               
\
++      for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));    
\
++              (var);                                                  \
++              (var) = (*(((struct headname 
*)((var)->field.tqe_prev))->tqh_last)))
++
++#define       TAILQ_CONCAT(head1, head2, field) do {                          
\
++      if (!TAILQ_EMPTY(head2)) {                                      \
++              *(head1)->tqh_last = (head2)->tqh_first;                \
++              (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
++              (head1)->tqh_last = (head2)->tqh_last;                  \
++              TAILQ_INIT((head2));                                    \
++      }                                                               \
++} while (/*CONSTCOND*/0)
++
++/*
++ * Tail queue access methods.
++ */
++#define       TAILQ_EMPTY(head)               ((head)->tqh_first == NULL)
++#define       TAILQ_FIRST(head)               ((head)->tqh_first)
++#define       TAILQ_NEXT(elm, field)          ((elm)->field.tqe_next)
++
++#define       TAILQ_LAST(head, headname) \
++      (*(((struct headname *)((head)->tqh_last))->tqh_last))
++#define       TAILQ_PREV(elm, headname, field) \
++      (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
++
++
++/*
++ * Circular queue definitions.
++ */
++#define       CIRCLEQ_HEAD(name, type)                                        
\
++struct name {                                                         \
++      struct type *cqh_first;         /* first element */             \
++      struct type *cqh_last;          /* last element */              \
++}
++
++#define       CIRCLEQ_HEAD_INITIALIZER(head)                                  
\
++      { (void *)&head, (void *)&head }
++
++#define       CIRCLEQ_ENTRY(type)                                             
\
++struct {                                                              \
++      struct type *cqe_next;          /* next element */              \
++      struct type *cqe_prev;          /* previous element */          \
++}
++
++/*
++ * Circular queue functions.
++ */
++#define       CIRCLEQ_INIT(head) do {                                         
\
++      (head)->cqh_first = (void *)(head);                             \
++      (head)->cqh_last = (void *)(head);                              \
++} while (/*CONSTCOND*/0)
++
++#define       CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do {            
\
++      (elm)->field.cqe_next = (listelm)->field.cqe_next;              \
++      (elm)->field.cqe_prev = (listelm);                              \
++      if ((listelm)->field.cqe_next == (void *)(head))                \
++              (head)->cqh_last = (elm);                               \
++      else                                                            \
++              (listelm)->field.cqe_next->field.cqe_prev = (elm);      \
++      (listelm)->field.cqe_next = (elm);                              \
++} while (/*CONSTCOND*/0)
++
++#define       CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do {           
\
++      (elm)->field.cqe_next = (listelm);                              \
++      (elm)->field.cqe_prev = (listelm)->field.cqe_prev;              \
++      if ((listelm)->field.cqe_prev == (void *)(head))                \
++              (head)->cqh_first = (elm);                              \
++      else                                                            \
++              (listelm)->field.cqe_prev->field.cqe_next = (elm);      \
++      (listelm)->field.cqe_prev = (elm);                              \
++} while (/*CONSTCOND*/0)
++
++#define       CIRCLEQ_INSERT_HEAD(head, elm, field) do {                      
\
++      (elm)->field.cqe_next = (head)->cqh_first;                      \
++      (elm)->field.cqe_prev = (void *)(head);                         \
++      if ((head)->cqh_last == (void *)(head))                         \
++              (head)->cqh_last = (elm);                               \
++      else                                                            \
++              (head)->cqh_first->field.cqe_prev = (elm);              \
++      (head)->cqh_first = (elm);                                      \
++} while (/*CONSTCOND*/0)
++
++#define       CIRCLEQ_INSERT_TAIL(head, elm, field) do {                      
\
++      (elm)->field.cqe_next = (void *)(head);                         \
++      (elm)->field.cqe_prev = (head)->cqh_last;                       \
++      if ((head)->cqh_first == (void *)(head))                        \
++              (head)->cqh_first = (elm);                              \
++      else                                                            \
++              (head)->cqh_last->field.cqe_next = (elm);               \
++      (head)->cqh_last = (elm);                                       \
++} while (/*CONSTCOND*/0)
++
++#define       CIRCLEQ_REMOVE(head, elm, field) do {                           
\
++      if ((elm)->field.cqe_next == (void *)(head))                    \
++              (head)->cqh_last = (elm)->field.cqe_prev;               \
++      else                                                            \
++              (elm)->field.cqe_next->field.cqe_prev =                 \
++                  (elm)->field.cqe_prev;                              \
++      if ((elm)->field.cqe_prev == (void *)(head))                    \
++              (head)->cqh_first = (elm)->field.cqe_next;              \
++      else                                                            \
++              (elm)->field.cqe_prev->field.cqe_next =                 \
++                  (elm)->field.cqe_next;                              \
++} while (/*CONSTCOND*/0)
++
++#define       CIRCLEQ_FOREACH(var, head, field)                               
\
++      for ((var) = ((head)->cqh_first);                               \
++              (var) != (const void *)(head);                          \
++              (var) = ((var)->field.cqe_next))
++
++#define       CIRCLEQ_FOREACH_REVERSE(var, head, field)                       
\
++      for ((var) = ((head)->cqh_last);                                \
++              (var) != (const void *)(head);                          \
++              (var) = ((var)->field.cqe_prev))
++
++/*
++ * Circular queue access methods.
++ */
++#define       CIRCLEQ_EMPTY(head)             ((head)->cqh_first == (void 
*)(head))
++#define       CIRCLEQ_FIRST(head)             ((head)->cqh_first)
++#define       CIRCLEQ_LAST(head)              ((head)->cqh_last)
++#define       CIRCLEQ_NEXT(elm, field)        ((elm)->field.cqe_next)
++#define       CIRCLEQ_PREV(elm, field)        ((elm)->field.cqe_prev)
++
++#define CIRCLEQ_LOOP_NEXT(head, elm, field)                           \
++      (((elm)->field.cqe_next == (void *)(head))                      \
++          ? ((head)->cqh_first)                                       \
++          : (elm->field.cqe_next))
++#define CIRCLEQ_LOOP_PREV(head, elm, field)                           \
++      (((elm)->field.cqe_prev == (void *)(head))                      \
++          ? ((head)->cqh_last)                                        \
++          : (elm->field.cqe_prev))
++
++#endif        /* sys/queue.h */

diff --git a/app-admin/rsyslog/files/8-stable/README.gentoo 
b/app-admin/rsyslog/files/8-stable/README.gentoo
new file mode 100644
index 0000000..9f0666c
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/README.gentoo
@@ -0,0 +1,36 @@
+Introduction
+============
+
+Since rsyslog version 7.6 we are shipping a new default Gentoo
+configuration. See bug #501982 to learn more about what we were trying to
+achieve by rewriting the entire configuration.
+
+
+Important changes
+=================
+
+1. "/var/log/syslog" log file is now deprecated
+
+   Beginning with rsyslog-7.6, the "/var/log/syslog" log file will no
+   longer being written per default. We are considering this file as
+   deprecated/obsolet for the typical user/system.
+   The content from this log file is still availble through other
+   (dedicated) log files, see
+   
+     - /var/log/cron.log
+     - /var/log/daemon.log
+     - /var/log/mail.log
+     - /var/log/messages
+   
+   If you really need the old "/var/log/syslog" log file, all you have to
+   do is uncommenting the corresponding configuration directive in
+   "/etc/rsyslog.d/50-default.conf".
+   
+   If you do so, don't forget to re-enable log rotation in
+   "/etc/logrotate.d/rsyslog", too.
+
+
+2. An additional input socket in "/var/empty/dev/log" (default chroot
+   location) will be created per default
+
+   See bug #490744 for further details.

diff --git a/app-admin/rsyslog/files/8-stable/rsyslog.conf 
b/app-admin/rsyslog/files/8-stable/rsyslog.conf
new file mode 100644
index 0000000..da48459
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/rsyslog.conf
@@ -0,0 +1,61 @@
+# /etc/rsyslog.conf
+# 
+# This configuration is based on RainerScript, the new recommended syntax
+# for RSYSLOG. See http://www.rsyslog.com/doc/rainerscript.html for further
+# details.
+# 
+# But if you don't want to learn something new at moment, don't worry: The
+# legacy syntax is still supported.
+# 
+# You may want to use the new RSYSLOG configuration builder to create your
+# own more advanced configuration: 
http://www.rsyslog.com/rsyslog-configuration-builder/
+
+# Check config syntax on startup and abort if unclean (default: off)
+#$AbortOnUncleanConfig on
+
+
+###############
+### MODULES ###
+###############
+
+# Read syslog messages from default Unix socket /dev/log (e.g. via logger 
command)
+module(load="imuxsock")
+
+# Read messages from the kernel log and submits them to the syslog engine
+module(load="imklog")
+
+# Inject "--MARK--" messages every $Interval (seconds)
+#module(load="immark" Interval="600")
+
+# Read syslog messages from UDP
+#module(load="imudp")
+#input(type="imudp" port="514")
+
+# Read syslog messages from TCP
+#module(load="imtcp")
+#input(type="imtcp" port="514")
+
+
+#########################
+### GLOBAL DIRECTIVES ###
+#########################
+
+# Where to place spool and state files
+$WorkDirectory /var/spool/rsyslog
+
+# Reduce repeating messages (default: off)
+#$RepeatedMsgReduction on
+
+# Set defaults for every output file
+$Umask 0022
+
+module(
+       load="builtin:omfile"
+       Template="RSYSLOG_TraditionalFileFormat"
+       FileCreateMode="0644"
+       DirCreateMode="0755"
+)
+
+
+# Include all conf files in /etc/rsyslog.d/
+$IncludeConfig /etc/rsyslog.d/*.conf

diff --git a/app-admin/rsyslog/files/8-stable/rsyslog.confd-r1 
b/app-admin/rsyslog/files/8-stable/rsyslog.confd-r1
new file mode 100644
index 0000000..da48c01
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/rsyslog.confd-r1
@@ -0,0 +1,30 @@
+# /etc/conf.d/rsyslog
+
+# Configuration file
+#RSYSLOG_CONFIGFILE="/etc/rsyslog.conf"
+
+# PID file
+# If you should ever change this, remember to update
+# "/etc/logrotate.d/rsyslog", too.
+#RSYSLOG_PIDFILE="/run/rsyslogd.pid"
+
+# You can use this configuration option to pass additional options to the
+# start-stop-daemon, see start-stop-daemon(8) for more details.
+# Per default we wait 1000ms after we have started the service to ensure
+# that the daemon is really up and running.
+#RSYSLOG_SSDARGS="--wait 1000"
+
+# The termination timeout (start-stop-daemon parameter "retry") ensures
+# that the service will be terminated within a given time (60 + 5 seconds
+# per default) when you are stopping the service.
+# You need to increase the value when you are working with a large queue.
+# See http://www.rsyslog.com/doc/queues.html for further information.
+#RSYSLOG_TERMTIMEOUT="TERM/60/KILL/5"
+
+
+# Options to rsyslogd
+# See rsyslogd(8) for more details
+# Notes:
+# * Do not specify another PIDFILE but use the variable above to change the 
location
+# * Do not specify another CONFIGFILE but use the variable above to change the 
location
+#RSYSLOG_OPTS=""

diff --git a/app-admin/rsyslog/files/8-stable/rsyslog.initd-r1 
b/app-admin/rsyslog/files/8-stable/rsyslog.initd-r1
new file mode 100644
index 0000000..b0355cf
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/rsyslog.initd-r1
@@ -0,0 +1,73 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+RSYSLOG_CONFIGFILE=${RSYSLOG_CONFIGFILE:-"/etc/rsyslog.conf"}
+RSYSLOG_PIDFILE=${RSYSLOG_PIDFILE:-"/run/rsyslogd.pid"}
+RSYSLOG_SSDARGS=${RSYSLOG_SSDARGS:-"--wait 1000"}
+RSYSLOG_TERMTIMEOUT=${RSYSLOG_TERMTIMEOUT:-"TERM/60/KILL/5"}
+RSYSLOG_OPTS=${RSYSLOG_OPTS:-""}
+
+command="/usr/sbin/rsyslogd"
+command_args="${RSYSLOG_OPTS} -f \"${RSYSLOG_CONFIGFILE}\" -i 
\"${RSYSLOG_PIDFILE}\""
+start_stop_daemon_args="${RSYSLOG_SSDARGS}"
+pidfile="${RSYSLOG_PIDFILE}"
+retry="${RSYSLOG_TERMTIMEOUT}"
+
+required_files="${RSYSLOG_CONFIGFILE}"
+
+description="RSYSLOG is the rocket-fast system for log processing (syslog 
replacement)."
+
+extra_commands="configtest"
+extra_started_commands="rotate"
+
+description_configtest="Run rsyslogd's internal config check."
+
+description_rotate="Sends rsyslogd a signal to re-open its log files."
+
+depend() {
+       need clock hostname localmount
+       provide logger
+}
+
+start_pre() {
+       if [ "${RC_CMD}" != "restart" ]; then
+               configtest || return 1
+       fi
+}
+
+stop_pre() {
+       if [ "${RC_CMD}" = "restart" ]; then
+               configtest || return 1
+       fi
+}
+
+stop_post() {
+       if [ -f "${RSYSLOG_PIDFILE}" ]; then
+               vebegin "Removing stale PID file"
+               rm --force "${RSYSLOG_PIDFILE}"
+               veend $?
+       fi
+}
+
+configtest() {
+       local _command_args="-N 999 -f \"${RSYSLOG_CONFIGFILE}\""
+       local _retval=0
+
+       ebegin "Checking rsyslogd's configuration"
+       eval ${command} ${_command_args} >/dev/null 2>&1
+       _retval=$?
+
+       if [ ${_retval} -ne 0 ]; then
+               eval ${command} ${_command_args}
+       fi
+
+       eend ${_retval} "failed, please correct errors above"
+}
+
+rotate() {
+       ebegin "Re-opening rsyslogd logs"
+       start-stop-daemon --signal SIGHUP --pidfile "${RSYSLOG_PIDFILE}"
+       eend $?
+}

diff --git a/app-admin/rsyslog/files/8-stable/rsyslog.logrotate 
b/app-admin/rsyslog/files/8-stable/rsyslog.logrotate
new file mode 100644
index 0000000..1eae30e
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/rsyslog.logrotate
@@ -0,0 +1,37 @@
+# Uncomment the following directive if you have re-enabled
+# "/var/log/syslog" in "/etc/rsyslog.d/50-default.conf"
+#/var/log/syslog
+#{
+#      rotate 7
+#      daily
+#      missingok
+#      notifempty
+#      delaycompress
+#      compress
+#      postrotate
+#              test -r /run/rsyslogd.pid && kill -HUP $(cat /run/rsyslogd.pid) 
&>/dev/null
+#      endscript
+#}
+
+/var/log/auth.log
+/var/log/cron.log
+/var/log/daemon.log
+/var/log/kern.log
+/var/log/lpr.log
+/var/log/mail.log
+/var/log/news.log
+/var/log/user.log
+/var/log/debug.log
+/var/log/messages
+{
+       rotate 4
+       weekly
+       missingok
+       notifempty
+       compress
+       delaycompress
+       sharedscripts
+       postrotate
+               test -r /run/rsyslogd.pid && kill -HUP $(cat /run/rsyslogd.pid) 
&>/dev/null
+       endscript
+}

diff --git a/app-admin/rsyslog/metadata.xml b/app-admin/rsyslog/metadata.xml
new file mode 100644
index 0000000..d402aea
--- /dev/null
+++ b/app-admin/rsyslog/metadata.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Thomas Deutschmann</name>
+               <description>Primary Maintainer</description>
+       </maintainer>
+       <use>
+               <flag name="dbi">Build the general database output module 
(requires <pkg>dev-db/libdbi</pkg>)</flag>
+               <flag name="elasticsearch">Build the Elasticsearch output 
module (requires <pkg>net-misc/curl</pkg>)</flag>
+               <flag name="gcrypt">Add support for encrypted log files using 
<pkg>dev-libs/libgcrypt</pkg></flag>
+               <flag name="grok">Build the grok modify module (requires 
<pkg>dev-libs/grok</pkg>)</flag>
+               <flag name="jemalloc">Use <pkg>dev-libs/jemalloc</pkg> for 
allocations.</flag>
+               <flag name="kafka">Build the Apache Kafka output module 
(requires <pkg>dev-libs/librdkafka</pkg>)</flag>
+               <flag name="kerberos">Build the GSSAPI input and output module 
(requires <pkg>virtual/krb5</pkg>)</flag>
+               <flag name="libressl">Use <pkg>dev-libs/libressl</pkg> for 
building the rfc5424hmac modify module (requires rfc5424hmac USE flag)</flag>
+               <flag name="mongodb">Build the MongoDB output module (requires 
<pkg>dev-libs/libmongo-client</pkg>)</flag>
+               <flag name="mysql">Build the MySQL database output module 
(requires <pkg>virtual/mysql</pkg>)</flag>
+               <flag name="normalize">Build the normalize modify module 
(requires <pkg>dev-libs/libee</pkg> and <pkg>dev-libs/liblognorm</pkg>)</flag>
+               <flag name="omhttpfs">Build the httpfs output module (requires 
<pkg>net-misc/curl</pkg>)</flag>
+               <flag name="omudpspoof">Build the udpspoof output module 
(requires <pkg>net-libs/libnet</pkg>)</flag>
+               <flag name="postgres">Build the PostgreSQL database output 
module (requires <pkg>dev-db/postgresql</pkg>)</flag>
+               <flag name="rabbitmq">Build the RabbitMQ output module 
(requires <pkg>net-libs/rabbitmq-c</pkg>)</flag>
+               <flag name="redis">Build the Redis output module using 
(requires <pkg>dev-libs/hiredis</pkg>)</flag>
+               <flag name="relp">Build the Reliable Event Logging Protocol 
(RELP) output module (requires <pkg>dev-libs/librelp</pkg>)</flag>
+               <flag name="rfc3195">Build the rfc3195 input module (requires 
<pkg>dev-libs/liblogging</pkg>)</flag>
+               <flag name="rfc5424hmac">Build the rfc5424hmac modify module 
(requires <pkg>dev-libs/openssl</pkg> or <pkg>dev-libs/libressl</pkg>)</flag>
+               <flag name="snmp">Build the snmp modify and output module 
(requires <pkg>net-analyzer/net-snmp</pkg>)</flag>
+               <flag name="ssl">Add support for encrypted client/server 
communication (requires <pkg>net-libs/gnutls</pkg>)</flag>
+               <flag name="systemd">Build the journal input and output module 
(requires <pkg>sys-apps/systemd</pkg>)</flag>
+               <flag name="uuid">Include UUIDs in messages (requires 
<pkg>sys-apps/util-linux</pkg>)</flag>
+               <flag name="usertools">Installs the user tools (rsgtutil, 
rscryutil...) corresponding to the set USE flags</flag>
+               <flag name="zeromq">Build the ZeroMQ input and output modules 
(requires <pkg>net-libs/czmq</pkg>)</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://github.com/rsyslog/rsyslog/issues</bugs-to>
+               <remote-id type="cpe">cpe:/a:rsyslog:rsyslog</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git a/app-admin/rsyslog/rsyslog-8.24.0.ebuild 
b/app-admin/rsyslog/rsyslog-8.24.0.ebuild
new file mode 100644
index 0000000..d7e8ec2
--- /dev/null
+++ b/app-admin/rsyslog/rsyslog-8.24.0.ebuild
@@ -0,0 +1,458 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools eutils linux-info systemd
+
+DESCRIPTION="An enhanced multi-threaded syslogd with database support and more"
+HOMEPAGE="http://www.rsyslog.com/";
+
+BRANCH="8-stable"
+
+PATCHES=(
+       "${FILESDIR}/8-stable/50-${PN}-8.18.0-musl-fix.patch"
+       "${FILESDIR}/8-stable/50-${PN}-8.18.0-musl-imptcp-queue.patch"
+)
+
+if [[ ${PV} == "9999" ]]; then
+       EGIT_REPO_URI="
+               git://github.com/rsyslog/${PN}.git
+               https://github.com/rsyslog/${PN}.git
+       "
+
+       DOC_REPO_URI="
+               git://github.com/rsyslog/${PN}-doc.git
+               https://github.com/rsyslog/${PN}-doc.git
+       "
+
+       inherit git-r3
+else
+       MY_PV=${PV%_rc*}
+       MY_FILENAME="${PN}-${PV}.tar.gz"
+       MY_FILENAME_DOCS="${PN}-docs-${PV}.tar.gz"
+       S="${WORKDIR}/${PN}-${MY_PV}"
+
+       # Upstream URL schema:
+       # RC:      
http://www.rsyslog.com/files/download/rsyslog/rc/rsyslog-8.18.0.tar.gz
+       #          
http://www.rsyslog.com/files/download/rsyslog/rc2/rsyslog-8.18.0.tar.gz
+       # Release: 
http://www.rsyslog.com/files/download/rsyslog/rsyslog-8.18.0.tar.gz
+
+       MY_URL_PREFIX=
+       if [[ ${PV} = *_rc* ]]; then
+               _tmp_last_index=$(($(get_last_version_component_index ${PV})+1))
+               _tmp_suffix=$(get_version_component_range ${_tmp_last_index} 
${PV})
+               if [[ ${_tmp_suffix} = *rc* ]]; then
+                       MY_URL_PREFIX="${_tmp_suffix}/"
+               fi
+
+               # Cleaning up temporary variables
+               unset _tmp_last_index
+               unset _tmp_suffix
+       else
+               KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~x86"
+       fi
+
+       SRC_URI="
+               
http://www.rsyslog.com/files/download/${PN}/${MY_URL_PREFIX}${PN}-${MY_PV}.tar.gz
 -> ${MY_FILENAME}
+               doc? ( 
http://www.rsyslog.com/files/download/${PN}/${MY_URL_PREFIX}${PN}-doc-${MY_PV}.tar.gz
 -> ${MY_FILENAME_DOCS} )
+       "
+fi
+
+LICENSE="GPL-3 LGPL-3 Apache-2.0"
+SLOT="0"
+IUSE="dbi debug doc elasticsearch +gcrypt grok jemalloc kafka kerberos 
libressl mongodb mysql normalize omhttpfs"
+IUSE+=" omudpspoof postgres rabbitmq redis relp rfc3195 rfc5424hmac snmp ssl 
systemd test usertools +uuid zeromq"
+
+RDEPEND="
+       >=dev-libs/libfastjson-0.99.3:=
+       >=dev-libs/libestr-0.1.9
+       >=dev-libs/liblogging-1.0.1:=[stdlog]
+       >=sys-libs/zlib-1.2.5
+       dbi? ( >=dev-db/libdbi-0.8.3 )
+       elasticsearch? ( >=net-misc/curl-7.35.0 )
+       gcrypt? ( >=dev-libs/libgcrypt-1.5.3:= )
+       grok? ( >=dev-libs/grok-0.9.2 )
+       jemalloc? ( >=dev-libs/jemalloc-3.3.1:= )
+       kafka? ( >=dev-libs/librdkafka-0.9.0.99:= )
+       kerberos? ( virtual/krb5 )
+       mongodb? ( >=dev-libs/libmongo-client-0.1.4 )
+       mysql? ( virtual/mysql )
+       normalize? (
+               >=dev-libs/libee-0.4.0
+               >=dev-libs/liblognorm-2.0.1:=
+       )
+       omhttpfs? ( >=net-misc/curl-7.35.0 )
+       omudpspoof? ( >=net-libs/libnet-1.1.6 )
+       postgres? ( >=dev-db/postgresql-8.4.20:= )
+       rabbitmq? ( >=net-libs/rabbitmq-c-0.3.0:= )
+       redis? ( >=dev-libs/hiredis-0.11.0 )
+       relp? ( >=dev-libs/librelp-1.2.12:= )
+       rfc3195? ( >=dev-libs/liblogging-1.0.1:=[rfc3195] )
+       rfc5424hmac? (
+               !libressl? ( >=dev-libs/openssl-0.9.8y:0= )
+               libressl? ( dev-libs/libressl:= )
+       )
+       snmp? ( >=net-analyzer/net-snmp-5.7.2 )
+       ssl? ( >=net-libs/gnutls-2.12.23:0= )
+       systemd? ( >=sys-apps/systemd-208 )
+       uuid? ( sys-apps/util-linux:0= )
+       zeromq? (
+               >=net-libs/zeromq-4.1.1:=
+               >=net-libs/czmq-3.0.0
+       )"
+DEPEND="${RDEPEND}
+       >=sys-devel/autoconf-archive-2015.02.24
+       virtual/pkgconfig
+       test? ( sys-libs/libfaketime )"
+
+if [[ ${PV} == "9999" ]]; then
+       DEPEND+=" doc? ( >=dev-python/sphinx-1.1.3-r7 )"
+       DEPEND+=" >=sys-devel/flex-2.5.39-r1"
+       DEPEND+=" >=sys-devel/bison-2.4.3"
+       DEPEND+=" >=dev-python/docutils-0.12"
+fi
+
+CONFIG_CHECK="~INOTIFY_USER"
+WARNING_INOTIFY_USER="CONFIG_INOTIFY_USER isn't set. Imfile module on this 
system will only support polling mode!"
+
+src_unpack() {
+       if [[ ${PV} == "9999" ]]; then
+               git-r3_fetch
+               git-r3_checkout
+       else
+               unpack ${P}.tar.gz
+       fi
+
+       if use doc; then
+               if [[ ${PV} == "9999" ]]; then
+                       local _EGIT_BRANCH=
+                       if [[ -n "${EGIT_BRANCH}" ]]; then
+                               # Cannot use rsyslog commits/branches for 
documentation repository
+                               _EGIT_BRANCH=${EGIT_BRANCH}
+                               unset EGIT_BRANCH
+                       fi
+
+                       git-r3_fetch "${DOC_REPO_URI}"
+                       git-r3_checkout "${DOC_REPO_URI}" "${S}"/docs
+
+                       if [[ -n "${_EGIT_BRANCH}" ]]; then
+                               # Restore previous EGIT_BRANCH information
+                               EGIT_BRANCH=${_EGIT_BRANCH}
+                       fi
+               else
+                       cd "${S}" || die "Cannot change dir into '${S}'"
+                       mkdir docs || die "Failed to create docs directory"
+                       cd docs || die "Failed to change dir into '${S}/docs'"
+                       unpack ${MY_FILENAME_DOCS}
+               fi
+       fi
+}
+
+src_prepare() {
+       default
+
+       eautoreconf
+}
+
+src_configure() {
+       # Maintainer notes:
+       # * Guardtime support is missing because libgt isn't yet available
+       #   in portage.
+       # * Hadoop's HDFS file system output module is currently not
+       #   supported in Gentoo because nobody is able to test it
+       #   (JAVA dependency).
+       # * dev-libs/hiredis doesn't provide pkg-config (see #504614,
+       #   upstream PR 129 and 136) so we need to export HIREDIS_*
+       #   variables because rsyslog's build system depends on pkg-config.
+
+       if use redis; then
+               export HIREDIS_LIBS="-L${EPREFIX}/usr/$(get_libdir) -lhiredis"
+               export HIREDIS_CFLAGS="-I${EPREFIX}/usr/include"
+       fi
+
+       local myeconfargs=(
+               --disable-debug-symbols
+               --disable-generate-man-pages
+               --without-valgrind-testbench
+               $(use_enable test testbench)
+               # Input Plugins without depedencies
+               --enable-imdiag
+               --enable-imfile
+               --enable-impstats
+               --enable-imptcp
+               # Message Modificiation Plugins without depedencies
+               --enable-mmanon
+               --enable-mmaudit
+               --enable-mmcount
+               --enable-mmfields
+               --enable-mmjsonparse
+               --enable-mmpstrucdata
+               --enable-mmrm1stspace
+               --enable-mmsequence
+               --enable-mmutf8fix
+               # Output Modification Plugins without dependencies
+               --enable-mail
+               --enable-omprog
+               --enable-omruleset
+               --enable-omstdout
+               --enable-omuxsock
+               # Misc
+               --enable-pmaixforwardedfrom
+               --enable-pmciscoios
+               --enable-pmcisconames
+               --enable-pmlastmsg
+               --enable-pmsnare
+               # DB
+               $(use_enable dbi libdbi)
+               $(use_enable mongodb ommongodb)
+               $(use_enable mysql)
+               $(use_enable postgres pgsql)
+               $(use_enable redis omhiredis)
+               # Debug
+               $(use_enable debug)
+               $(use_enable debug diagtools)
+               $(use_enable debug memcheck)
+               $(use_enable debug rtinst)
+               $(use_enable debug valgrind)
+               # Misc
+               $(use_enable elasticsearch)
+               $(use_enable gcrypt libgcrypt)
+               $(use_enable jemalloc)
+               $(use_enable kafka omkafka)
+               $(use_enable kerberos gssapi-krb5)
+               $(use_enable normalize mmnormalize)
+               $(use_enable grok mmgrok)
+               $(use_enable omhttpfs)
+               $(use_enable omudpspoof)
+               $(use_enable rabbitmq omrabbitmq)
+               $(use_enable relp)
+               $(use_enable rfc3195)
+               $(use_enable rfc5424hmac mmrfc5424addhmac)
+               $(use_enable snmp)
+               $(use_enable snmp mmsnmptrapd)
+               $(use_enable ssl gnutls)
+               $(use_enable systemd imjournal)
+               $(use_enable systemd omjournal)
+               $(use_enable usertools)
+               $(use_enable uuid)
+               $(use_enable zeromq imczmq)
+               $(use_enable zeromq imzmq3)
+               $(use_enable zeromq omczmq)
+               $(use_enable zeromq omzmq3)
+               --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+       )
+
+       econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+       default
+
+       if use doc && [[ "${PV}" == "9999" ]]; then
+               einfo "Building documentation ..."
+               local doc_dir="${S}/docs"
+               cd "${doc_dir}" || die "Cannot chdir into \"${doc_dir}\"!"
+               sphinx-build -b html source build || die "Building 
documentation failed!"
+       fi
+}
+
+src_test() {
+       local _has_increased_ulimit=
+
+       # Sometimes tests aren't executable (i.e. when added via patch)
+       einfo "Adjusting permissions of test scripts ..."
+       find "${S}"/tests -type f -name '*.sh' \! -perm -111 -exec chmod a+x 
'{}' \; || \
+               die "Failed to adjust test scripts permission"
+
+       if ulimit -n 3072; then
+               _has_increased_ulimit="true"
+       fi
+
+       if ! emake --jobs 1 check; then
+               eerror "Test suite failed! :("
+
+               if [[ -z "${_has_increased_ulimit}" ]]; then
+                       eerror "Probably because open file limit couldn't be 
set to 3072."
+               fi
+
+               if has userpriv ${FEATURES}; then
+                       eerror "Please try to reproduce the test suite failure 
with FEATURES=-userpriv " \
+                               "before you submit a bug report."
+               fi
+
+       fi
+}
+
+src_install() {
+       local DOCS=(
+               AUTHORS
+               ChangeLog
+               "${FILESDIR}"/${BRANCH}/README.gentoo
+       )
+
+       use doc && local HTML_DOCS=( "${S}/docs/build/." )
+
+       default
+
+       newconfd "${FILESDIR}/${BRANCH}/${PN}.confd-r1" ${PN}
+       newinitd "${FILESDIR}/${BRANCH}/${PN}.initd-r1" ${PN}
+
+       keepdir /var/empty/dev
+       keepdir /var/spool/${PN}
+       keepdir /etc/ssl/${PN}
+       keepdir /etc/${PN}.d
+
+       insinto /etc
+       newins "${FILESDIR}/${BRANCH}/${PN}.conf" ${PN}.conf
+
+       insinto /etc/rsyslog.d/
+       doins "${FILESDIR}/${BRANCH}/50-default.conf"
+
+       insinto /etc/logrotate.d/
+       newins "${FILESDIR}/${BRANCH}/${PN}.logrotate" ${PN}
+
+       if use mysql; then
+               insinto /usr/share/doc/${PF}/scripts/mysql
+               doins plugins/ommysql/createDB.sql
+       fi
+
+       if use postgres; then
+               insinto /usr/share/doc/${PF}/scripts/pgsql
+               doins plugins/ompgsql/createDB.sql
+       fi
+
+       prune_libtool_files --modules
+}
+
+pkg_postinst() {
+       local advertise_readme=0
+
+       if [[ -z "${REPLACING_VERSIONS}" ]]; then
+               # This is a new installation
+
+               advertise_readme=1
+
+               if use mysql || use postgres; then
+                       echo
+                       elog "Sample SQL scripts for MySQL & PostgreSQL have 
been installed to:"
+                       elog "  /usr/share/doc/${PF}/scripts"
+               fi
+
+               if use ssl; then
+                       echo
+                       elog "To create a default CA and certificates for your 
server and clients, run:"
+                       elog "  emerge --config =${PF}"
+                       elog "on your logging server. You can run it several 
times,"
+                       elog "once for each logging client. The client 
certificates will be signed"
+                       elog "using the CA certificate generated during the 
first run."
+               fi
+       fi
+
+       if [[ ${advertise_readme} -gt 0 ]]; then
+               # We need to show the README file location
+
+               echo ""
+               elog "Please read"
+               elog ""
+               elog "  ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"
+               elog ""
+               elog "for more details."
+       fi
+}
+
+pkg_config() {
+       if ! use ssl ; then
+               einfo "There is nothing to configure for rsyslog unless you"
+               einfo "used USE=ssl to build it."
+               return 0
+       fi
+
+       # Make sure the certificates directory exists
+       local CERTDIR="${EROOT}/etc/ssl/${PN}"
+       if [[ ! -d "${CERTDIR}" ]]; then
+               mkdir "${CERTDIR}" || die
+       fi
+       einfo "Your certificates will be stored in ${CERTDIR}"
+
+       # Create a default CA if needed
+       if [[ ! -f "${CERTDIR}/${PN}_ca.cert.pem" ]]; then
+               einfo "No CA key and certificate found in ${CERTDIR}, creating 
them for you..."
+               certtool --generate-privkey \
+                       --outfile "${CERTDIR}/${PN}_ca.privkey.pem" &>/dev/null
+               chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
+
+               cat > "${T}/${PF}.$$" <<- _EOF
+               cn = Portage automated CA
+               ca
+               cert_signing_key
+               expiration_days = 3650
+               _EOF
+
+               certtool --generate-self-signed \
+                       --load-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
+                       --outfile "${CERTDIR}/${PN}_ca.cert.pem" \
+                       --template "${T}/${PF}.$$" &>/dev/null
+               chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
+
+               # Create the server certificate
+               echo
+               einfon "Please type the Common Name of the SERVER you wish to 
create a certificate for: "
+               read -r CN
+
+               einfo "Creating private key and certificate for server ${CN}..."
+               certtool --generate-privkey \
+                       --outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
+               chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
+
+               cat > "${T}/${PF}.$$" <<- _EOF
+               cn = ${CN}
+               tls_www_server
+               dns_name = ${CN}
+               expiration_days = 3650
+               _EOF
+
+               certtool --generate-certificate \
+                       --outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
+                       --load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
+                       --load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
+                       --load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
+                       --template "${T}/${PF}.$$" &>/dev/null
+               chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
+
+       else
+               einfo "Found existing ${CERTDIR}/${PN}_ca.cert.pem, skipping CA 
and SERVER creation."
+       fi
+
+       # Create a client certificate
+       echo
+       einfon "Please type the Common Name of the CLIENT you wish to create a 
certificate for: "
+       read -r CN
+
+       einfo "Creating private key and certificate for client ${CN}..."
+       certtool --generate-privkey \
+               --outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
+       chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
+
+       cat > "${T}/${PF}.$$" <<- _EOF
+       cn = ${CN}
+       tls_www_client
+       dns_name = ${CN}
+       expiration_days = 3650
+       _EOF
+
+       certtool --generate-certificate \
+               --outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
+               --load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
+               --load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
+               --load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
+               --template "${T}/${PF}.$$" &>/dev/null
+       chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
+
+       rm -f "${T}/${PF}.$$"
+
+       echo
+       einfo "Here is the documentation on how to encrypt your log traffic:"
+       einfo " http://www.rsyslog.com/doc/rsyslog_tls.html";
+}

Reply via email to