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

EAPI=8

inherit autotools

DESCRIPTION="A malware identification and classification tool"
HOMEPAGE="https://virustotal.github.io/yara/"

if [[ ${PV} == "9999" ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/VirusTotal/yara.git"
else
	SRC_URI="https://github.com/virustotal/yara/archive/v${PV/_/-}.tar.gz -> ${P}.tar.gz"
	S="${WORKDIR}/${PN}-${PV/_/-}"
	KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
fi

LICENSE="Apache-2.0"
SLOT="0/8"
IUSE="+dex +dotnet +cuckoo +macho +magic profiling python test"
RESTRICT="!test? ( test )"

DEPEND="
	dev-libs/openssl:=
	cuckoo? ( dev-libs/jansson:= )
	magic? ( sys-apps/file:= )
"
RDEPEND="${DEPEND}"
PDEPEND="python? ( =dev-python/yara-python-$(ver_cut 1)* )"

src_prepare() {
	default
	eautoreconf
}

src_configure() {
	econf \
		$(use_enable profiling) \
		$(use_enable cuckoo) \
		$(use_enable magic) \
		$(use_enable dotnet) \
		$(use_enable macho) \
		$(use_enable dex) \
		$(use_enable test static)
}

src_test() {
	emake check
}

src_install() {
	default

	# TODO: Allow tests to work against dyn. lib rather than building
	# statically just for tests.
	find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
}