From 6b933047f46efec1aa747570f945344254227457 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 15 Dec 2017 17:25:28 +0000 Subject: gentoo resync : 15.12.2017 --- app-admin/syslog-ng/Manifest | 7 + .../syslog-ng/files/3.13/syslog-ng.conf.gentoo | 36 +++++ .../files/3.13/syslog-ng.conf.gentoo.fbsd | 24 +++ .../files/3.13/syslog-ng.conf.gentoo.hardened | 115 ++++++++++++++ app-admin/syslog-ng/files/3.13/syslog-ng.confd | 42 ++++++ app-admin/syslog-ng/files/3.13/syslog-ng.rc | 58 +++++++ app-admin/syslog-ng/syslog-ng-3.13.2.ebuild | 167 +++++++++++++++++++++ 7 files changed, 449 insertions(+) create mode 100644 app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo create mode 100644 app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo.fbsd create mode 100644 app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo.hardened create mode 100644 app-admin/syslog-ng/files/3.13/syslog-ng.confd create mode 100644 app-admin/syslog-ng/files/3.13/syslog-ng.rc create mode 100644 app-admin/syslog-ng/syslog-ng-3.13.2.ebuild (limited to 'app-admin/syslog-ng') diff --git a/app-admin/syslog-ng/Manifest b/app-admin/syslog-ng/Manifest index 9f84ec9dedfd..63d771164026 100644 --- a/app-admin/syslog-ng/Manifest +++ b/app-admin/syslog-ng/Manifest @@ -3,6 +3,11 @@ AUX 3.12/syslog-ng.conf.gentoo.fbsd 577 BLAKE2B 4f92dcd741eb7ba41d38a947d03d118e AUX 3.12/syslog-ng.conf.gentoo.hardened 4511 BLAKE2B 18e4d0895dbc289f014ca917f9cc3493077021a8caddca4dc103f1f8c81376ccdf074407bbe1540f05c6b008c328200b3cda06bcb58ca2adf79f2578b5095365 SHA512 75cb811608f43c914ba31897ce417af6e3681dd3aa6f081841bfcea0455dded37f4b0b9beacbe9c958f37d57c382d96f0def24a03e955ae7d470337f33e2cc4a AUX 3.12/syslog-ng.confd 1492 BLAKE2B 8df9e16ec0fd8de141d1624f7451fefe19c49b2ba91ebdd63b6cce730ab2997715d7d352629f8bc6f7c700fce7fa04f291d3507dc421e1382a104dc264395e83 SHA512 8a346864dd88ac393f7080c4a073b20f21dfd547c2517abdd963beb50b9ac49565487a9508b042eb5d00055b2a5bef8db245cfa94c36ba1a60922caaae8bc4e0 AUX 3.12/syslog-ng.rc 1921 BLAKE2B 3e93f17544f27450d80de36504dd4cf39a0aa6b7c51d9df057f254e784cd6b937d57a098ddd5f636da202c54e802ea255698b079032481089145f091fa5ccbd4 SHA512 51c0a7856b481030136a025ebe815d696156393b4318662847237db9a792c52ce0802fd3cdc2cfa325fc75ea22c89fef1c46d44b312e5f8167a9786eacea8ecb +AUX 3.13/syslog-ng.conf.gentoo 1184 BLAKE2B 1a4b78d913c24f085efdbe36893f22e71295af5fcf6f085462ab6baf265aa9e26d796a1fd41d8bef6dd20b119a0920c1d07cf19e8d70640f88d70e333875d1fe SHA512 1dc14fc8ff4f16dac750436e4472e0f69e81f287981b31aa3864a8267beea19fd040b14b955c5011992c70092213a08b2a8350bac792c4d5c256f753b318ed6a +AUX 3.13/syslog-ng.conf.gentoo.fbsd 577 BLAKE2B b8aa747638899024ea8b04fdf3cc623ee77ac2522eb68e6763943808735ab6ef85c29db9f076cc2c3768d377a43530ccd634a50a51a6face8d1b93239aee6839 SHA512 3a0cc8685be4af41690bbd4aaec87b0d44ed8dd3b1dec0bac32818288c4adac1f4673dd73ffdc4164feb4afe8b98728c66a51a323bf302958e422595130a5ee2 +AUX 3.13/syslog-ng.conf.gentoo.hardened 4498 BLAKE2B 42626430ef11c3db6b56bfa07f6514551191e6c0e6086eab7c7ffad61d48c4f7931c97ec53af7e26b7187481f3ff572e67e442478995e39e80ab2fcc912251cc SHA512 0501c56996b619c92ae7ea7d7bc2b3110ed099f7efe4708faafd4dab06092d2cec3c015dcc9a4db6b7c7cc94bea278146b840bdb151278eab9a68bf186703bf9 +AUX 3.13/syslog-ng.confd 1492 BLAKE2B 8df9e16ec0fd8de141d1624f7451fefe19c49b2ba91ebdd63b6cce730ab2997715d7d352629f8bc6f7c700fce7fa04f291d3507dc421e1382a104dc264395e83 SHA512 8a346864dd88ac393f7080c4a073b20f21dfd547c2517abdd963beb50b9ac49565487a9508b042eb5d00055b2a5bef8db245cfa94c36ba1a60922caaae8bc4e0 +AUX 3.13/syslog-ng.rc 1799 BLAKE2B cf9ee36cdf27600f5caa75453b746ced42cda3e3dc8909925b11604967216061f8b3103b6b9f1af499a8c1d986cd9fb82d616138577773ce35c353bea055c6ac SHA512 2a0996057d4dcd730c89af87845749d9ec28c04f99d4f72be809f0f70a213a89a190c86a717169927f292049b326136fd76c6e02413963f7cd554d8acb74d555 AUX 3.7/syslog-ng.conf.gentoo 1203 BLAKE2B 786a4315e11d2feb839aaad7af5fd3544c3c3319857009b716e732a34618a026f25e8f44b2f8c4ebb2fd74cd78eb676bb65c6573f3bb8f357cde71f728ef56a5 SHA512 44de47c9ba8927ab69cbd9479bc18f87a311fb7a7273912b236650385bbaddec28d3a706d822e53a4264fc8fd9895887243fb070252024b732bdb41a840d44be AUX 3.7/syslog-ng.conf.gentoo.fbsd 593 BLAKE2B 2b161a0aed035fdeba7dffdadcce28f29d2bd4077e391b8af98c031fa92366cf454349463f4ba457e08cf44f9b78a25b525bda9c55405102b079a89223a328d0 SHA512 947be1b330a98490da99d9e64d76732fe8eb54beb266ae1a546df7319cea998a89963ddf086e993025efbba1a8aefc2ecc4ff5bd440a50e565cfddbe35536d90 AUX 3.7/syslog-ng.conf.gentoo.hardened 4520 BLAKE2B 968f77526cb027259acf507177f02b8d735a48aff78f809eb14e50795c26fee62b1e15602ed3ee16317ecb15f14d33135fa0dc54bea2ead002f96618991f87ec SHA512 2a0d31178e83ea9685ac1b5988652ef077b71d368d75eda46ebf0e1ef3dbb79e8c911bc6498d6a934912250ead902cfa4bb8ceff1f14a08e06f6152824e36128 @@ -14,7 +19,9 @@ AUX syslog-ng.logrotate.hardened 1614 BLAKE2B c9845bb43bd09a210f06912131dd2ba881 AUX syslog-ng.logrotate.hardened.in 1518 BLAKE2B c13fd2707266edef0e74476aaf8446c8f77d2ffa8508cd7b8c32d13a22ff63bc883ac7a79f21287681b906430ecb05bae7665c064adbe161e4e1647e3ace9c29 SHA512 43ab59f037d6955844ba9a12675b745351fd3144dc1db8b81fe1c6ef48798452ac9a6d94caa68978dae396eceaa1a6d476fc99221989cb40265d6bb9dbbbf620 AUX syslog-ng.logrotate.in 219 BLAKE2B acfde709749d11790b451e3f9a0d9bc33f129e86e3f68bdd36cf2d2c9c5561c5308805aea36378e8d79995e1bf173e4471845805681be2c409b52479333c35d8 SHA512 7a838006ce61c9702d6ea77672affa8cb1dc2ec2c6a1a268a4ae4f5a59dcac1ccfe835d25144ef8376a60a11227fa64e38dc16f8d0eaff182f14a6644a3a5ceb DIST syslog-ng-3.12.1.tar.gz 8905646 BLAKE2B abe273c561569047ef4ea0b21b08341d207ecc9a37ba88d1aa28f00de8a0c28cab2942b3d461b7b4fea940668b44ceda7f9c71b6f7c7583143f4bf65adb54036 SHA512 00370f8b090156c064d9fe932e2aafe3f78ffc01bc47b2bc2f0f3c6cbdf98ea8cc2084317b8c2b1a9755cce404646b20e131039ce55b87e24f4401a55b95ff7e +DIST syslog-ng-3.13.2.tar.gz 9047998 BLAKE2B a18b11a31e1bf4c981071e7509ff154f08076c5ca659e814a3d8a49108dcc6f324ba3025f4e43bb32d23a9554fc188da4b116089fe29bf866f323f76280c460f SHA512 fd5c6645f1e8e10cba940ea29715f9e7cc286cd49c2f45bde2a447731189d6171ca204aa066ac96dd09246fd7ed1751130d143d807c979518d688e7750490cfe DIST syslog-ng-3.7.3.tar.gz 3511155 BLAKE2B 25ba2ca241a5847c75792c78d39a4667f55cf1fcff46be5102256ee6a9d2f39e2042ac00fa0b1559f94e0df80a0853249692b443b565dd4f46f0354c453cacaf SHA512 e58d793bd1a8b48c5836090ee244f6e8b223f234f5a27fbf81f6a838b9b1e3e45f73a66dab2bc58a0bba230bd778a247ae22bf529a28fb2e9fee52b8181d304b EBUILD syslog-ng-3.12.1.ebuild 4322 BLAKE2B 44d6035c8a388169ae2e3f185d3c4f789afe385510b913df465a856be4c1e8fc66e4490b3721c8a046c7ebba0f8d340dc22ceabdd5b35a34933e75b385689d6c SHA512 9d81812a4abca5401bb620574088cd44be86271da26cb11786ec64880e581e8ff0b1a2d36a405b57136c60498e718c6074b7ecfee13161ca20fe260f898d7e08 +EBUILD syslog-ng-3.13.2.ebuild 4844 BLAKE2B a6b45cc981591939a41833ef6fc01b681612479cf26a66d231e9acb283f40208c3ab126db651c09a4dd22d6d1e4a73adb93871edfad7a7821e4f1564f2cb366a SHA512 71a71af32e1aa371469d9b60dc5cac06e91a33b9cf4b8b5cb4061ac64840bf28fffdc8ced4decf5011d2905ea868e56c2e5f08224aabd4b48383f1adf1b31154 EBUILD syslog-ng-3.7.3.ebuild 3972 BLAKE2B 6d4c5994419366aabc2df9e089ecee308fdae1b93f77469da4519ed4e50e3293c0898f28b95e0e102588dae352db5489d1c1021d21ca82b53d6b397d4f47b192 SHA512 637446d09bc29c9476177bfea1fac156b54174008d9b8b60a4ed6ae2ed39039aa8310b89b1a531db61a6e3c73d49d9aa92a931ef93531ff69903ceab5b7b48f0 MISC metadata.xml 880 BLAKE2B 9b7990fb5e4a4e373237b06d8468e958d98a60f52cba20d4018e1e0d39272525d503bf60206d8361798921e9c1da6b2fc8427ecf309cf2cdb8d2a39cdcd2da72 SHA512 84c16673492dbd6157c8f71810aa1377adce2855374485b1de57069f8516ba73893904b9ac22beb636eb9d04c7b3fcc49eebe7de9b219dfe8939f3f41136eb96 diff --git a/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo b/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo new file mode 100644 index 000000000000..ee8c76a7f535 --- /dev/null +++ b/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo @@ -0,0 +1,36 @@ +@version: 3.13 +# +# Syslog-ng default configuration file for Gentoo Linux + +# https://bugs.gentoo.org/426814 +@include "scl.conf" + +options { + threaded(yes); + chain_hostnames(no); + + # The default action of syslog-ng is to log a STATS line + # to the file every 10 minutes. That's pretty ugly after a while. + # Change it to every 12 hours so you get a nice daily update of + # how many messages syslog-ng missed (0). + stats_freq(43200); + # The default action of syslog-ng is to log a MARK line + # to the file every 20 minutes. That's seems high for most + # people so turn it down to once an hour. Set it to zero + # if you don't want the functionality at all. + mark_freq(3600); +}; + +source src { system(); internal(); }; + +destination messages { file("/var/log/messages"); }; + +# By default messages are logged to tty12... +destination console_all { file("/dev/tty12"); }; +# ...if you intend to use /dev/console for programs like xconsole +# you can comment out the destination line above that references /dev/tty12 +# and uncomment the line below. +#destination console_all { file("/dev/console"); }; + +log { source(src); destination(messages); }; +log { source(src); destination(console_all); }; diff --git a/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo.fbsd b/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo.fbsd new file mode 100644 index 000000000000..e9122a89061a --- /dev/null +++ b/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo.fbsd @@ -0,0 +1,24 @@ +@version: 3.13 +# +# Syslog-ng default configuration file for Gentoo FreeBSD +# + +# https://bugs.gentoo.org/426814 +@include "scl.conf" + +options { + threaded(yes); + chain_hostnames(no); + + # The default action of syslog-ng is to log a STATS line + # to the file every 10 minutes. That's pretty ugly after a while. + # Change it to every 12 hours so you get a nice daily update of + # how many messages syslog-ng missed (0). + stats_freq(43200); +}; + +source src { system(); internal(); }; + +destination messages { file("/var/log/messages"); }; + +log { source(src); destination(messages); }; diff --git a/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo.hardened b/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo.hardened new file mode 100644 index 000000000000..db6e7f0a1ce1 --- /dev/null +++ b/app-admin/syslog-ng/files/3.13/syslog-ng.conf.gentoo.hardened @@ -0,0 +1,115 @@ +@version: 3.13 +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# https://bugs.gentoo.org/426814 +@include "scl.conf" + +# +# Syslog-ng configuration file, compatible with default hardened installations. +# + +options { + threaded(yes); + chain_hostnames(no); + stats_freq(43200); +}; + +source src { + system(); + internal(); +}; + +source kernsrc { + file("/proc/kmsg"); +}; + +#source net { udp(); }; +#log { source(net); destination(net_logs); }; +#destination net_logs { file("/var/log/HOSTS/$HOST/$YEAR$MONTH$DAY.log"); }; + +destination authlog { file("/var/log/auth.log"); }; +destination _syslog { file("/var/log/syslog"); }; +destination cron { file("/var/log/cron.log"); }; +destination daemon { file("/var/log/daemon.log"); }; +destination kern { file("/var/log/kern.log"); }; +destination lpr { file("/var/log/lpr.log"); }; +destination user { file("/var/log/user.log"); }; +destination uucp { file("/var/log/uucp.log"); }; +#destination ppp { file("/var/log/ppp.log"); }; +destination mail { file("/var/log/mail.log"); }; + +destination avc { file("/var/log/avc.log"); }; +destination audit { file("/var/log/audit.log"); }; +destination pax { file("/var/log/pax.log"); }; +destination grsec { file("/var/log/grsec.log"); }; + +destination mailinfo { file("/var/log/mail.info"); }; +destination mailwarn { file("/var/log/mail.warn"); }; +destination mailerr { file("/var/log/mail.err"); }; + +destination newscrit { file("/var/log/news/news.crit"); }; +destination newserr { file("/var/log/news/news.err"); }; +destination newsnotice { file("/var/log/news/news.notice"); }; + +destination debug { file("/var/log/debug"); }; +destination messages { file("/var/log/messages"); }; +destination console { usertty("root"); }; +destination console_all { file("/dev/tty12"); }; +#destination loghost { udp("loghost" port(999)); }; + +destination xconsole { pipe("/dev/xconsole"); }; + +filter f_auth { facility(auth); }; +filter f_authpriv { facility(auth, authpriv); }; +filter f_syslog { not facility(authpriv, mail); }; +filter f_cron { facility(cron); }; +filter f_daemon { facility(daemon); }; +filter f_kern { facility(kern); }; +filter f_lpr { facility(lpr); }; +filter f_mail { facility(mail); }; +filter f_user { facility(user); }; +filter f_uucp { facility(uucp); }; +#filter f_ppp { facility(ppp); }; +filter f_news { facility(news); }; +filter f_debug { not facility(auth, authpriv, news, mail); }; +filter f_messages { level(info..warn) + and not facility(auth, authpriv, mail, news); }; +filter f_emergency { level(emerg); }; + +filter f_info { level(info); }; + +filter f_notice { level(notice); }; +filter f_warn { level(warn); }; +filter f_crit { level(crit); }; +filter f_err { level(err); }; + +filter f_avc { message(".*avc: .*"); }; +filter f_audit { message("^(\\[.*\..*\] |)audit.*") and not message(".*avc: .*"); }; +filter f_pax { message("^(\\[.*\..*\] |)PAX:.*"); }; +filter f_grsec { message("^(\\[.*\..*\] |)grsec:.*"); }; + +log { source(src); filter(f_authpriv); destination(authlog); }; +log { source(src); filter(f_syslog); destination(_syslog); }; +log { source(src); filter(f_cron); destination(cron); }; +log { source(src); filter(f_daemon); destination(daemon); }; +log { source(kernsrc); filter(f_kern); destination(kern); destination(console_all); }; +log { source(src); filter(f_lpr); destination(lpr); }; +log { source(src); filter(f_mail); destination(mail); }; +log { source(src); filter(f_user); destination(user); }; +log { source(src); filter(f_uucp); destination(uucp); }; +log { source(kernsrc); filter(f_pax); destination(pax); }; +log { source(kernsrc); filter(f_grsec); destination(grsec); }; +log { source(kernsrc); filter(f_audit); destination(audit); }; +log { source(kernsrc); filter(f_avc); destination(avc); }; +log { source(src); filter(f_mail); filter(f_info); destination(mailinfo); }; +log { source(src); filter(f_mail); filter(f_warn); destination(mailwarn); }; +log { source(src); filter(f_mail); filter(f_err); destination(mailerr); }; +log { source(src); filter(f_news); filter(f_crit); destination(newscrit); }; +log { source(src); filter(f_news); filter(f_err); destination(newserr); }; +log { source(src); filter(f_news); filter(f_notice); destination(newsnotice); }; +log { source(src); filter(f_debug); destination(debug); }; +log { source(src); filter(f_messages); destination(messages); }; +log { source(src); filter(f_emergency); destination(console); }; +#log { source(src); filter(f_ppp); destination(ppp); }; +log { source(src); destination(console_all); }; diff --git a/app-admin/syslog-ng/files/3.13/syslog-ng.confd b/app-admin/syslog-ng/files/3.13/syslog-ng.confd new file mode 100644 index 000000000000..42fa26ab4cf4 --- /dev/null +++ b/app-admin/syslog-ng/files/3.13/syslog-ng.confd @@ -0,0 +1,42 @@ +# Config file for /etc/init.d/syslog-ng + +# If you are not using network logging, this entire section should be +# commented out. Otherwise, choose one of the settings below based on +# how you are configuring your network. +# +# If you are using the net.* scripts to configure your network, you should +# set rc_need to match the interface through which your logging server +# can be reached. +#rc_need="net.eth0" +# +# If you are using an interface manager like wicd, dhcpcd in standalone +# mode, networkmanager, etc to control your interfaces, set rc_need to +# the name of that service. +# rc_need="dhcpcd" +#rc_need="networkmanager" +# +# If you are using newnet and configuring your interface statically with +# the network script, you should use this setting. +#rc_need="network" +# +# You can use this setting, but I do not recommend relying on it. +#rc_need="net" +# +# You may also want to uncomment the following if you are using network +# logging. +#rc_use="stunnel" + +# For very customized setups these variables can be adjusted as needed +# but for most situations they should remain commented: +# SYSLOG_NG_CONFIGFILE=/etc/syslog-ng/syslog-ng.conf +# SYSLOG_NG_STATEFILE_DIR=/var/lib/syslog-ng +# SYSLOG_NG_STATEFILE=${SYSLOG_NG_STATEFILE_DIR}/syslog-ng.persist +# SYSLOG_NG_PIDFILE_DIR=/run +# SYSLOG_NG_PIDFILE=${SYSLOG_NG_PIDFILE_DIR}/syslog-ng.pid +# SYSLOG_NG_GROUP=root +# SYSLOG_NG_USER=root + +# Put any additional options for syslog-ng here. +# See syslog-ng(8) for more information. + +SYSLOG_NG_OPTS="" diff --git a/app-admin/syslog-ng/files/3.13/syslog-ng.rc b/app-admin/syslog-ng/files/3.13/syslog-ng.rc new file mode 100644 index 000000000000..4a6f6451b7da --- /dev/null +++ b/app-admin/syslog-ng/files/3.13/syslog-ng.rc @@ -0,0 +1,58 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +: ${SYSLOG_NG_CONFIGFILE:=/etc/syslog-ng/${RC_SVCNAME}.conf} +: ${SYSLOG_NG_STATEFILE_DIR:=/var/lib/syslog-ng} +: ${SYSLOG_NG_STATEFILE:=${SYSLOG_NG_STATEFILE_DIR}/syslog-ng.persist} +: ${SYSLOG_NG_PIDFILE_DIR:=/run} +: ${SYSLOG_NG_PIDFILE:=${SYSLOG_NG_PIDFILE_DIR}/${RC_SVCNAME}.pid} + +: ${SYSLOG_NG_GROUP:=root} +: ${SYSLOG_NG_USER:=root} + +command="/usr/sbin/syslog-ng" +command_args="--persist-file \"${SYSLOG_NG_STATEFILE}\" --cfgfile \"${SYSLOG_NG_CONFIGFILE}\" --pidfile \"${SYSLOG_NG_PIDFILE}\" ${SYSLOG_NG_OPTS}" +extra_commands="checkconfig" +extra_started_commands="reload" +pidfile="${SYSLOG_NG_PIDFILE}" +start_stop_daemon_args="--user \"${SYSLOG_NG_USER}\":\"${SYSLOG_NG_GROUP}\"" +description="Syslog-ng is a syslog replacement with advanced filtering features." +description_checkconfig="Check the configuration file that will be used by \"start\"" +description_reload="Reload the configuration without exiting" +required_files="${SYSLOG_NG_CONFIGFILE}" +required_dirs="${SYSLOG_NG_PIDFILE_DIR}" + +depend() { + use clock + need hostname localmount + after bootmisc + provide logger +} + +checkconfig() { + ebegin "Checking your configfile (${SYSLOG_NG_CONFIGFILE})" + syslog-ng -s -f "${SYSLOG_NG_CONFIGFILE}" + eend $? "Configuration error. Please fix your configfile (${SYSLOG_NG_CONFIGFILE})" +} + +start_pre() { + checkconfig || return 1 + checkpath \ + -d \ + --mode 0700 \ + --owner "${SYSLOG_NG_USER}:${SYSLOG_NG_GROUP}" \ + "${SYSLOG_NG_STATEFILE_DIR}" +} + +stop_pre() { + [ "$RC_CMD" = "restart" ] && sleep 1 + return 0 +} + +reload() { + checkconfig || return 1 + ebegin "Reloading configuration and re-opening log files" + start-stop-daemon --signal HUP --pidfile "${pidfile}" + eend $? +} diff --git a/app-admin/syslog-ng/syslog-ng-3.13.2.ebuild b/app-admin/syslog-ng/syslog-ng-3.13.2.ebuild new file mode 100644 index 000000000000..6529873ab30a --- /dev/null +++ b/app-admin/syslog-ng/syslog-ng-3.13.2.ebuild @@ -0,0 +1,167 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) + +inherit autotools python-single-r1 eutils multilib systemd versionator + +MY_PV=${PV/_/} +MY_PV_MM=$(get_version_component_range 1-2) +DESCRIPTION="syslog replacement with advanced filtering features" +HOMEPAGE="http://www.balabit.com/network-security/syslog-ng" +SRC_URI="https://github.com/balabit/syslog-ng/releases/download/${P}/${P}.tar.gz" + +LICENSE="GPL-2+ LGPL-2.1+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="amqp caps dbi geoip http ipv6 json libressl mongodb pacct python redis smtp spoof-source systemd tcpd" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" +RESTRICT="test" + +RDEPEND=" + amqp? ( >=net-libs/rabbitmq-c-0.8.0 ) + caps? ( sys-libs/libcap ) + dbi? ( >=dev-db/libdbi-0.9.0 ) + geoip? ( >=dev-libs/geoip-1.5.0 ) + http? ( net-misc/curl ) + json? ( >=dev-libs/json-c-0.9 ) + mongodb? ( >=dev-libs/mongo-c-driver-1.2.0 ) + python? ( ${PYTHON_DEPS} ) + redis? ( >=dev-libs/hiredis-0.11.0 ) + smtp? ( net-libs/libesmtp ) + spoof-source? ( net-libs/libnet:1.1 ) + systemd? ( sys-apps/systemd ) + tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) + >=dev-libs/libpcre-6.1 + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + !dev-libs/eventlog + >=dev-libs/glib-2.10.1:2" +DEPEND="${RDEPEND} + >=dev-libs/ivykis-0.36.1 + sys-devel/flex + virtual/pkgconfig" + +S=${WORKDIR}/${PN}-${MY_PV} + +pkg_setup() { + use python && python-single-r1_pkg_setup +} + +src_prepare() { + local f + + use python && python_fix_shebang . + + # remove bundled libs + rm -rv lib/ivykis modules/afmongodb/mongo-c-driver modules/afamqp/rabbitmq-c || die + + # drop scl modules requiring json + if use !json; then + sed -i -r '/cim|ewmm|graylog2/d' scl/Makefile.am || die + eautoreconf + fi + + # use gentoo default path + if use systemd; then + sed -e 's@/etc/syslog-ng.conf@/etc/syslog-ng/syslog-ng.conf@g;s@/var/run@/run@g' \ + -i contrib/systemd/syslog-ng@default || die + fi + + for f in "${FILESDIR}"/*logrotate*.in ; do + local bn=$(basename "${f}") + + sed \ + -e "$(usex systemd \ + 's/@GENTOO_RESTART@/systemctl kill -s HUP syslog-ng@default/' \ + 's:@GENTOO_RESTART@:/etc/init.d/syslog-ng reload:')" \ + "${f}" > "${T}/${bn/.in/}" || die + done + + default +} + +src_configure() { + econf \ + --disable-docs \ + --disable-java \ + --disable-java-modules \ + --disable-riemann \ + --enable-manpages \ + --localstatedir=/var/lib/syslog-ng \ + --sysconfdir=/etc/syslog-ng \ + --with-embedded-crypto \ + --with-ivykis=system \ + --with-module-dir=/usr/$(get_libdir)/syslog-ng \ + --with-pidfile-dir=/var/run \ + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \ + $(use_enable amqp) \ + $(usex amqp --with-librabbitmq-client=system --without-librabbitmq-client) \ + $(use_enable caps linux-caps) \ + $(use_enable dbi sql) \ + $(use_enable geoip) \ + $(use_enable http) \ + $(use_enable ipv6) \ + $(use_enable json) \ + $(use_enable mongodb) \ + $(usex mongodb --with-mongoc=system "--without-mongoc --disable-legacy-mongodb-options") \ + $(use_enable pacct) \ + $(use_enable python) \ + $(use_enable redis) \ + $(use_enable smtp) \ + $(use_enable spoof-source) \ + $(use_enable systemd) \ + $(use_enable tcpd tcp-wrapper) +} + +src_install() { + emake DESTDIR="${D}" install + + dodoc AUTHORS NEWS.md CONTRIBUTING.md contrib/syslog-ng.conf* \ + contrib/syslog2ng "${FILESDIR}/${MY_PV_MM}/syslog-ng.conf.gentoo.hardened" \ + "${T}/syslog-ng.logrotate.hardened" "${FILESDIR}/README.hardened" + + # Install default configuration + insinto /etc/default + doins contrib/systemd/syslog-ng@default + + insinto /etc/syslog-ng + if use userland_BSD ; then + newins "${FILESDIR}/${MY_PV_MM}/syslog-ng.conf.gentoo.fbsd" syslog-ng.conf + else + newins "${FILESDIR}/${MY_PV_MM}/syslog-ng.conf.gentoo" syslog-ng.conf + fi + + insinto /etc/logrotate.d + newins "${T}/syslog-ng.logrotate" syslog-ng + + newinitd "${FILESDIR}/${MY_PV_MM}/syslog-ng.rc" syslog-ng + newconfd "${FILESDIR}/${MY_PV_MM}/syslog-ng.confd" syslog-ng + keepdir /etc/syslog-ng/patterndb.d /var/lib/syslog-ng + prune_libtool_files --modules + + use python && python_optimize +} + +pkg_postinst() { + elog "For detailed documentation please see the upstream website:" + elog "https://www.balabit.com/sites/default/files/documents/syslog-ng-ose-${MY_PV_MM}-guides/en/syslog-ng-ose-v${MY_PV_MM}-guide-admin/html/index.html" + + # bug #355257 + if ! has_version app-admin/logrotate ; then + echo + elog "It is highly recommended that app-admin/logrotate be emerged to" + elog "manage the log files. ${PN} installs a file in /etc/logrotate.d" + elog "for logrotate to use." + echo + fi + + if use systemd; then + echo + ewarn "The service file for systemd has changed to support multiple instances." + ewarn "To start the default instance issue:" + ewarn "# systemctl start syslog-ng@default" + echo + fi +} -- cgit v1.2.3