summaryrefslogtreecommitdiff
path: root/net-analyzer/flow-tools/flow-tools-0.68.6-r2.ebuild
blob: 33574457e1508552355d9cf1c1ac4f4a61728270 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Copyright 2021-2026 BaldEagleOS Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8

inherit autotools

DESCRIPTION="library and programs to process reports from NetFlow data"
HOMEPAGE="https://github.com/5u623l20/flow-tools/"
SRC_URI="https://github.com/5u623l20/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="BSD GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="debug libressl mysql postgres ssl static-libs"

RDEPEND="
	acct-group/flows
	acct-user/flows
	sys-apps/tcp-wrappers
	sys-libs/zlib
	mysql? ( dev-db/mysql-connector-c:0= )
	postgres? ( dev-db/postgresql:* )
	ssl? (
		!libressl? ( dev-libs/openssl:0= )
		libressl? ( >=dev-libs/libressl-3.5.0:0= )
	)
"
DEPEND="
	${RDEPEND}
"
BDEPEND="
	app-text/docbook-sgml-utils
	sys-devel/bison
	sys-devel/flex
"
DOCS=( ChangeLog.old README README.fork SECURITY TODO TODO.old )
PATCHES=(
	"${FILESDIR}"/${PN}-0.68.5.1-run.patch
	"${FILESDIR}"/${PN}-0.68.5.1-fno-common.patch
	"${FILESDIR}"/${PN}-0.68.6-mysql.patch
	"${FILESDIR}"/${PN}-0.68.6-c99-c23.patch
	"${FILESDIR}"/${PN}-0.68.6-lto.patch
)

src_prepare() {
	eapply -p1 ${FILESDIR}/ftxlate.patch
	default
	sed -i -e 's|docbook-to-man|docbook2man|g' docs/Makefile.am || die
	eautoreconf
}

src_configure() {
	econf \
		$(use_enable static-libs static) \
		$(usex mysql --with-mysql '') \
		$(usex postgres --with-postgresql=yes --with-postgresql=no) \
		$(usex ssl --with-openssl '') \
		--sysconfdir=/etc/flow-tools
}

src_install() {
	default

	exeinto /var/lib/flows/bin
	doexe "${FILESDIR}"/linkme

	keepdir /var/lib/flows/ft

	newinitd "${FILESDIR}/flowcapture.initd" flowcapture
	newconfd "${FILESDIR}/flowcapture.confd" flowcapture

	fowners flows:flows /var/lib/flows
	fowners flows:flows /var/lib/flows/bin
	fowners flows:flows /var/lib/flows/ft

	fperms 0755 /var/lib/flows
	fperms 0755 /var/lib/flows/bin

	find "${ED}" -name '*.la' -delete || die
}