net-analyzer/wapiti: drop old
[gentoo.git] / net-analyzer / barnyard2 / barnyard2-1.9-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit autotools
7
8 DESCRIPTION="Parser for Snort unified/unified2 files"
9 HOMEPAGE="https://github.com/firnsy/barnyard2 https://firnsy.com/projects"
10 SRC_URI="https://github.com/firnsy/barnyard2/archive/v2-${PV}.tar.gz -> ${P}-github.tar.gz"
11
12 SLOT="0"
13 LICENSE="GPL-2"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="debug gre mpls mysql odbc postgres static"
16
17 DEPEND="net-libs/libpcap
18         mysql? ( dev-db/mysql-connector-c:0= )
19         odbc? ( dev-db/unixODBC )
20         postgres? ( dev-db/postgresql:*[server] )"
21 RDEPEND="${DEPEND}"
22
23 DOCS="RELEASE.NOTES etc/barnyard2.conf doc/README* schemas/create_*"
24
25 S="${WORKDIR}/${PN}-2-${PV}"
26
27 src_prepare() {
28         default
29         sed -i -e "s:^#config interface:config interface:" \
30                 "etc/barnyard2.conf" || die
31         sed -i -e "s:^output alert_fast:#output alert_fast:" \
32                 "etc/barnyard2.conf" || die
33
34         AT_M4DIR="m4" eautoreconf
35 }
36
37 src_configure() {
38         econf \
39                 $(use_enable !static shared) \
40                 $(use_enable static) \
41                 $(use_enable debug) \
42                 $(use_enable gre) \
43                 $(use_enable mpls) \
44                 $(use_with mysql) \
45                 $(use_with odbc) \
46                 $(use_with postgres postgresql) \
47                 --disable-ipv6 \
48                 --disable-prelude \
49                 --disable-mysql-ssl-support \
50                 --disable-aruba \
51                 --without-tcl \
52                 --without-oracle
53 }
54
55 src_install() {
56         default
57
58         newconfd "${FILESDIR}/barnyard2.confd" barnyard2
59         newinitd "${FILESDIR}/barnyard2.initd" barnyard2
60
61         dodir /etc/barnyard2
62         keepdir /var/log/barnyard2
63         keepdir /var/log/snort/archive
64
65         rm "${D}"/etc/barnyard2.conf || die
66 }
67
68 pkg_postinst() {
69         elog "Configuration options can be set in /etc/conf.d/barnyard2."
70         elog
71         elog "An example configuration file can be found in /usr/share/doc/${PF}."
72 }