summaryrefslogtreecommitdiff
blob: b7d29b7c46ab649d5035dd44defca518949014e9 (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
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
inherit autotools

DESCRIPTION="A Middlebox Detection Tool"
HOMEPAGE="http://www.tracebox.org/"
SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="curl sniffer"

RDEPEND="
	>=net-libs/libcrafter-0.3_p20171019
	dev-lang/lua:*
	dev-libs/json-c
	net-libs/libpcap
	curl? ( net-misc/curl )
	sniffer? ( net-libs/libnetfilter_queue )
"
DEPEND="
	${RDEPEND}
"
BDEPEND="
	virtual/pkgconfig
"
RESTRICT="test"
PATCHES=(
	"${FILESDIR}"/${PN}-0.4.4-deps.patch
)

src_prepare() {
	default

	sed -i -e '/SUBDIRS/s|noinst||g' Makefile.am || die
	sed -i -e '/DIST_SUBDIRS.*libcrafter/d' noinst/Makefile.am || die

	sed -i \
		-e '/[[:graph:]]*libcrafter[[:graph:]]*/d' \
		-e '/dist_bin_SCRIPTS/d' \
		src/${PN}/Makefile.am \
		|| die

	sed -i \
		-e 's|"crafter.h"|<crafter.h>|g' \
		src/${PN}/PacketModification.h \
		src/${PN}/PartialHeader.h \
		src/${PN}/script.h \
		src/${PN}/${PN}.h \
		|| die

	eautoreconf
}

src_configure() {
	econf \
		$(use_enable curl) \
		$(use_enable sniffer)
}