Gentoo Archives: gentoo-commits

From: Julian Ospald <hasufell@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/syslog-ng/
Date: Sun, 20 Sep 2015 13:20:37
Message-Id: 1442755191.bdb96e69127a1b1ad7bbf83bbb7f3b62697a73f5.hasufell@gentoo
1 commit: bdb96e69127a1b1ad7bbf83bbb7f3b62697a73f5
2 Author: Julian Ospald <hasufell <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 20 13:19:51 2015 +0000
4 Commit: Julian Ospald <hasufell <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 20 13:19:51 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdb96e69
7
8 app-admin/syslog-ng: add libressl support
9
10 app-admin/syslog-ng/syslog-ng-3.7.1-r1.ebuild | 143 ++++++++++++++++++++++++++
11 1 file changed, 143 insertions(+)
12
13 diff --git a/app-admin/syslog-ng/syslog-ng-3.7.1-r1.ebuild b/app-admin/syslog-ng/syslog-ng-3.7.1-r1.ebuild
14 new file mode 100644
15 index 0000000..0a1f050
16 --- /dev/null
17 +++ b/app-admin/syslog-ng/syslog-ng-3.7.1-r1.ebuild
18 @@ -0,0 +1,143 @@
19 +# Copyright 1999-2015 Gentoo Foundation
20 +# Distributed under the terms of the GNU General Public License v2
21 +# $Id$
22 +
23 +EAPI=5
24 +PYTHON_COMPAT=( python2_7 )
25 +inherit autotools python-any-r1 eutils multilib systemd versionator
26 +
27 +MY_PV=${PV/_/}
28 +MY_PV_MM=$(get_version_component_range 1-2)
29 +DESCRIPTION="syslog replacement with advanced filtering features"
30 +HOMEPAGE="http://www.balabit.com/network-security/syslog-ng"
31 +SRC_URI="https://github.com/balabit/syslog-ng/releases/download/${P}/${P}.tar.gz"
32 +
33 +LICENSE="GPL-2+ LGPL-2.1+"
34 +SLOT="0"
35 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
36 +IUSE="amqp caps dbi geoip ipv6 json libressl mongodb pacct python redis smtp spoof-source systemd tcpd"
37 +RESTRICT="test"
38 +
39 +RDEPEND="
40 + caps? ( sys-libs/libcap )
41 + dbi? ( >=dev-db/libdbi-0.8.3 )
42 + geoip? ( >=dev-libs/geoip-1.5.0 )
43 + json? ( >=dev-libs/json-c-0.9 )
44 + python? ( ${PYTHON_DEPS} )
45 + redis? ( dev-libs/hiredis )
46 + smtp? ( net-libs/libesmtp )
47 + spoof-source? ( net-libs/libnet:1.1 )
48 + systemd? ( sys-apps/systemd )
49 + tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
50 + dev-libs/libpcre
51 + !libressl? ( dev-libs/openssl:0= )
52 + libressl? ( dev-libs/libressl:= )
53 + >=dev-libs/eventlog-0.2.12
54 + >=dev-libs/glib-2.10.1:2"
55 +DEPEND="${RDEPEND}
56 + virtual/pkgconfig
57 + sys-devel/flex"
58 +
59 +S=${WORKDIR}/${PN}-${MY_PV}
60 +
61 +pkg_setup() {
62 + use python && python-any-r1_pkg_setup
63 +}
64 +
65 +src_prepare() {
66 + epatch_user
67 + use python && python_fix_shebang .
68 +
69 + if use !json ; then
70 + sed -i \
71 + -e '1 s/cim //' \
72 + scl/Makefile.am || die
73 + eautoreconf
74 + fi
75 +
76 + cp "${FILESDIR}"/*logrotate*.in "${TMPDIR}" || die
77 + cd "${TMPDIR}" || die
78 +
79 + for f in *logrotate*.in ; do
80 + if use systemd ; then
81 + sed \
82 + 's/@GENTOO_RESTART@/systemctl kill -s HUP syslog-ng/' \
83 + $f > ${f/.in/} || die
84 + else
85 + sed \
86 + 's:@GENTOO_RESTART@:/etc/init.d/syslog-ng reload:' \
87 + $f > ${f/.in/} || die
88 + fi
89 + done
90 +}
91 +
92 +src_configure() {
93 + econf \
94 + --disable-java \
95 + --disable-docs \
96 + --enable-manpages \
97 + --with-embedded-crypto \
98 + --with-ivykis=internal \
99 + --with-libmongo-client=internal \
100 + --sysconfdir=/etc/syslog-ng \
101 + --localstatedir=/var/lib/syslog-ng \
102 + --with-pidfile-dir=/var/run \
103 + --with-module-dir=/usr/$(get_libdir)/syslog-ng \
104 + $(systemd_with_unitdir) \
105 + $(use_enable systemd) \
106 + $(use_enable caps linux-caps) \
107 + $(use_enable geoip) \
108 + $(use_enable ipv6) \
109 + $(use_enable json) \
110 + $(use_enable mongodb) \
111 + $(use_enable pacct) \
112 + $(use_enable python) \
113 + $(use_enable redis) \
114 + $(use_enable smtp) \
115 + $(use_enable amqp) \
116 + $(usex amqp --with-librabbitmq-client=internal --without-librabbitmq-client) \
117 + $(use_enable spoof-source) \
118 + $(use_enable dbi sql) \
119 + $(use_enable tcpd tcp-wrapper)
120 +}
121 +
122 +src_install() {
123 + # -j1 for bug #484470
124 + emake -j1 DESTDIR="${D}" install
125 +
126 + dodoc AUTHORS NEWS.md CONTRIBUTING.md contrib/syslog-ng.conf* \
127 + contrib/syslog2ng "${FILESDIR}/${MY_PV_MM}/syslog-ng.conf.gentoo.hardened" \
128 + "${TMPDIR}/syslog-ng.logrotate.hardened" "${FILESDIR}/README.hardened"
129 +
130 + # Install default configuration
131 + insinto /etc/syslog-ng
132 + if use userland_BSD ; then
133 + newins "${FILESDIR}/${MY_PV_MM}/syslog-ng.conf.gentoo.fbsd" syslog-ng.conf
134 + else
135 + newins "${FILESDIR}/${MY_PV_MM}/syslog-ng.conf.gentoo" syslog-ng.conf
136 + fi
137 +
138 + insinto /etc/logrotate.d
139 + newins "${TMPDIR}/syslog-ng.logrotate" syslog-ng
140 +
141 + newinitd "${FILESDIR}/${MY_PV_MM}/syslog-ng.rc6" syslog-ng
142 + newconfd "${FILESDIR}/${MY_PV_MM}/syslog-ng.confd" syslog-ng
143 + keepdir /etc/syslog-ng/patterndb.d /var/lib/syslog-ng
144 + prune_libtool_files --modules
145 +
146 + use python && python_optimize
147 +}
148 +
149 +pkg_postinst() {
150 + elog "For detailed documentation please see the upstream website:"
151 + elog "http://www.balabit.com/sites/default/files/documents/syslog-ng-ose-3.7-guides/en/syslog-ng-ose-v3.7-guide-admin/html/index.html"
152 +
153 + # bug #355257
154 + if ! has_version app-admin/logrotate ; then
155 + echo
156 + elog "It is highly recommended that app-admin/logrotate be emerged to"
157 + elog "manage the log files. ${PN} installs a file in /etc/logrotate.d"
158 + elog "for logrotate to use."
159 + echo
160 + fi
161 +}