Gentoo Archives: gentoo-commits

From: Aaron Bauman <bman@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/barnyard/
Date: Sat, 09 Feb 2019 19:56:09
Message-Id: 1549742102.cc4aa450aa077fb503990d986c840469df42ec06.bman@gentoo
1 commit: cc4aa450aa077fb503990d986c840469df42ec06
2 Author: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
3 AuthorDate: Fri Aug 17 18:49:55 2018 +0000
4 Commit: Aaron Bauman <bman <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 9 19:55:02 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc4aa450
7
8 net-analyzer/barnyard: EAPI7 revbump, improve ebuild
9
10 Closes: https://bugs.gentoo.org/663906
11 Signed-off-by: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail.com>
12 Closes: https://github.com/gentoo/gentoo/pull/9602
13 Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
14
15 net-analyzer/barnyard/barnyard-0.2.0-r4.ebuild | 95 ++++++++++++++++++++++++++
16 1 file changed, 95 insertions(+)
17
18 diff --git a/net-analyzer/barnyard/barnyard-0.2.0-r4.ebuild b/net-analyzer/barnyard/barnyard-0.2.0-r4.ebuild
19 new file mode 100644
20 index 00000000000..0868a7f8ffe
21 --- /dev/null
22 +++ b/net-analyzer/barnyard/barnyard-0.2.0-r4.ebuild
23 @@ -0,0 +1,95 @@
24 +# Copyright 1999-2018 Gentoo Foundation
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=7
28 +
29 +inherit autotools
30 +
31 +DESCRIPTION="Fast output system for Snort"
32 +HOMEPAGE="https://sourceforge.net/projects/barnyard"
33 +SRC_URI="
34 + mirror://sourceforge/barnyard/barnyard-${PV/_/-}.tar.gz
35 + mirror://gentoo/${P}-patches.tar.bz2"
36 +
37 +SLOT="0"
38 +LICENSE="QPL GPL-2"
39 +KEYWORDS="~amd64 -sparc ~x86"
40 +IUSE="mysql postgres sguil"
41 +
42 +DEPEND="
43 + net-libs/libpcap
44 + mysql? ( virtual/mysql )
45 + postgres? ( dev-db/postgresql:*[server] )
46 + sguil? ( dev-lang/tcl:0 )"
47 +RDEPEND="${DEPEND}
48 + net-analyzer/snort"
49 +
50 +S="${WORKDIR}/${P/_/-}"
51 +
52 +DOCS="AUTHORS README docs/*"
53 +
54 +src_prepare() {
55 + default
56 + eapply "${FILESDIR}/barnyard.64bit.diff"
57 + if use sguil ; then
58 + eapply "${WORKDIR}/${PV}-sguil_files.patch"
59 + eapply "${WORKDIR}/${PV}-configure-in.patch"
60 + cd "${S}/src/output-plugins" || die
61 + eapply "${WORKDIR}/${PV}-op_plugbase.c.patch"
62 + cd "${S}" || die
63 + fi
64 + eautoreconf
65 +}
66 +
67 +src_configure() {
68 + local myconf
69 + if use sguil ; then
70 + myconf="--enable-tcl"
71 + fi
72 +
73 + econf \
74 + ${myconf} \
75 + --sysconfdir=/etc/snort \
76 + $(use_enable postgres) \
77 + $(use_enable mysql)
78 +}
79 +
80 +src_install () {
81 + default
82 +
83 + keepdir /var/log/snort
84 + keepdir /var/log/snort/archive
85 +
86 + insinto /etc/snort
87 + newins etc/barnyard.conf barnyard.conf
88 + if use sguil ; then
89 + sed -i -e "/config hostname:/s%snorthost%$(hostname)%" \
90 + -e "/config interface/s:fxp0:eth0:" \
91 + -e "s:output alert_fast:#output alert_fast:" \
92 + -e "s:output log_dump:#output log_dump:" \
93 + "${D}/etc/snort/barnyard.conf" || die "sed failed"
94 + fi
95 +
96 + newconfd "${FILESDIR}"/barnyard.confd barnyard
97 + if use sguil ; then
98 + sed -i -e s:/var/log/snort:/var/lib/sguil/$(hostname): \
99 + -e s:/var/run/barnyard.pid:/var/run/sguil/barnyard.pid: \
100 + "${D}/etc/conf.d/barnyard" || die "sed failed"
101 + fi
102 +
103 + newinitd "${FILESDIR}"/barnyard.rc6 barnyard
104 + if use sguil ; then
105 + sed -i -e "/start-stop-daemon --start/s:--exec:-c sguil --exec:" \
106 + "${D}/etc/init.d/barnyard" || die "sed failed"
107 + fi
108 +}
109 +
110 +pkg_postinst() {
111 + if use sguil ; then
112 + elog
113 + elog "Make sure to edit /etc/snort/barnyard.conf and uncomment the"
114 + elog "sguil section along with supplying the appropriate database"
115 + elog "information."
116 + elog
117 + fi
118 +}