app-admin/ec2-api-tools: Removal. Fixes bug 471942.
[gentoo.git] / app-admin / syslog-ng / syslog-ng-3.4.8.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 inherit eutils multilib systemd
7
8 MY_PV=${PV/_/}
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"
12
13 LICENSE="GPL-2+ LGPL-2.1+"
14 SLOT="0"
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"
17 RESTRICT="test"
18
19 RDEPEND="
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 )"
32 DEPEND="${RDEPEND}
33         virtual/pkgconfig
34         sys-devel/flex"
35
36 S=${WORKDIR}/${PN}-${MY_PV}
37
38 src_prepare() {
39         cp "${FILESDIR}"/*logrotate*.in "${TMPDIR}" || die
40         cd "${TMPDIR}" || die
41
42         for f in *logrotate*.in ; do
43                 if use systemd ; then
44                         sed \
45                                 's/@GENTOO_RESTART@/systemctl kill -s HUP syslog-ng/' \
46                                 $f > ${f/.in/} || die
47                 else
48                         sed \
49                                 's:@GENTOO_RESTART@:/etc/init.d/syslog-ng reload:' \
50                                 $f > ${f/.in/} || die
51                 fi
52         done
53 }
54
55 src_configure() {
56         econf \
57                 --disable-docs \
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) \
67                 $(use_enable geoip) \
68                 $(use_enable ipv6) \
69                 $(use_enable json) \
70                 $(use_enable mongodb) \
71                 $(use_enable pacct) \
72                 $(use_enable pcre) \
73                 $(use_enable smtp) \
74                 $(use_enable amqp) \
75                 $(usex amqp --with-librabbitmq-client=internal --without-librabbitmq-client) \
76                 $(use_enable spoof-source) \
77                 $(use_enable dbi sql) \
78                 $(use_enable ssl) \
79                 $(use_enable tcpd tcp-wrapper)
80 }
81
82 src_install() {
83         # -j1 for bug #484470
84         emake -j1 DESTDIR="${D}" install
85
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"
90
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
95         else
96                 newins "${FILESDIR}/${PV%.*}/syslog-ng.conf.gentoo" syslog-ng.conf
97         fi
98
99         insinto /etc/logrotate.d
100         newins "${TMPDIR}/syslog-ng.logrotate" syslog-ng
101
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
106 }
107
108 pkg_postinst() {
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"
111
112         # bug #355257
113         if ! has_version app-admin/logrotate ; then
114                 echo
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."
118                 echo
119         fi
120 }