1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils multilib systemd
9 DESCRIPTION="syslog replacement with advanced filtering features"
10 HOMEPAGE="http://www.balabit.com/network-security/syslog-ng"
11 SRC_URI="http://www.balabit.com/downloads/files/syslog-ng/sources/${MY_PV}/source/syslog-ng_${MY_PV}.tar.gz"
13 LICENSE="GPL-2+ LGPL-2.1+"
15 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~x86-fbsd"
16 IUSE="amqp caps dbi geoip ipv6 json mongodb pacct +pcre smtp spoof-source ssl systemd tcpd"
20 pcre? ( dev-libs/libpcre )
21 spoof-source? ( net-libs/libnet:1.1 )
22 ssl? ( dev-libs/openssl:= )
23 smtp? ( net-libs/libesmtp )
24 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
25 >=dev-libs/eventlog-0.2.12
26 >=dev-libs/glib-2.10.1:2
27 json? ( >=dev-libs/json-c-0.9 )
28 caps? ( sys-libs/libcap )
29 geoip? ( >=dev-libs/geoip-1.5.0 )
30 dbi? ( >=dev-db/libdbi-0.8.3 )
31 systemd? ( sys-apps/systemd )"
36 S=${WORKDIR}/${PN}-${MY_PV}
39 cp "${FILESDIR}"/*logrotate*.in "${TMPDIR}" || die
42 for f in *logrotate*.in ; do
45 's/@GENTOO_RESTART@/systemctl kill -s HUP syslog-ng/' \
49 's:@GENTOO_RESTART@:/etc/init.d/syslog-ng reload:' \
58 --with-ivykis=internal \
59 --with-libmongo-client=internal \
60 --sysconfdir=/etc/syslog-ng \
61 --localstatedir=/var/lib/syslog-ng \
62 --with-pidfile-dir=/var/run \
63 --with-module-dir=/usr/$(get_libdir)/syslog-ng \
64 $(systemd_with_unitdir) \
65 $(use_enable systemd) \
66 $(use_enable caps linux-caps) \
70 $(use_enable mongodb) \
75 $(usex amqp --with-librabbitmq-client=internal --without-librabbitmq-client) \
76 $(use_enable spoof-source) \
77 $(use_enable dbi sql) \
79 $(use_enable tcpd tcp-wrapper)
84 emake -j1 DESTDIR="${D}" install
86 dodoc AUTHORS NEWS contrib/syslog-ng.conf* contrib/syslog2ng \
87 "${FILESDIR}/${PV%.*}/syslog-ng.conf.gentoo.hardened" \
88 "${TMPDIR}/syslog-ng.logrotate.hardened" \
89 "${FILESDIR}/README.hardened"
91 # Install default configuration
92 insinto /etc/syslog-ng
93 if use userland_BSD ; then
94 newins "${FILESDIR}/${PV%.*}/syslog-ng.conf.gentoo.fbsd" syslog-ng.conf
96 newins "${FILESDIR}/${PV%.*}/syslog-ng.conf.gentoo" syslog-ng.conf
99 insinto /etc/logrotate.d
100 newins "${TMPDIR}/syslog-ng.logrotate" syslog-ng
102 newinitd "${FILESDIR}/${PV%.*}/syslog-ng.rc6" syslog-ng
103 newconfd "${FILESDIR}/${PV%.*}/syslog-ng.confd" syslog-ng
104 keepdir /etc/syslog-ng/patterndb.d /var/lib/syslog-ng
105 prune_libtool_files --modules
109 elog "For detailed documentation please see the upstream website:"
110 elog "http://www.balabit.com/sites/default/files/documents/syslog-ng-ose-3.4-guides/en/syslog-ng-ose-v3.4-guide-admin/html/index.html"
113 if ! has_version app-admin/logrotate ; then
115 elog "It is highly recommended that app-admin/logrotate be emerged to"
116 elog "manage the log files. ${PN} installs a file in /etc/logrotate.d"
117 elog "for logrotate to use."