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

EAPI="7"

inherit eutils toolchain-funcs

DESCRIPTION="High performance web server"
HOMEPAGE="https://www.fefe.de/gatling/"
SRC_URI="https://www.fefe.de/gatling/${P}.tar.xz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"

IUSE="libressl ssl diet"
REQUIRED_USE="ssl? ( !diet )"

DEPEND=">=dev-libs/libowfat-0.32-r2[diet=]
	diet? ( dev-libs/dietlibc )
	ssl? (
		!libressl? ( dev-libs/openssl:0 )
		libressl? ( dev-libs/libressl )
	)"
RDEPEND="${DEPEND}
	acct-group/gatling
	acct-user/gatling
	"

PATCHES=(
	"${FILESDIR}/${PN}-0.13-compile.patch"
	"${FILESDIR}/${PN}-0.15-ar.patch"
)

src_prepare() {
	default
	rm Makefile  # leaves us with GNUmakefile
}

src_compile() {
	local DIET=
	use diet && DIET='/usr/bin/diet'

	local targets='gatling'
	use ssl && targets+=' tlsgatling'

	emake DIET="${DIET}" CC="$(tc-getCC)" \
			CFLAGS="${CFLAGS} -I${ROOT}/usr/include/libowfat" \
			LDFLAGS="${LDFLAGS}" prefix=/usr ${targets}
}

src_install() {
	doman gatling.1

	newconfd "${FILESDIR}/gatling.confd" gatling
	newinitd "${FILESDIR}/gatling.initd-3" gatling
	dodoc README.{ftp,http}

	dobin gatling
	use ssl && {
		dodoc README.tls
		dobin tlsgatling
	}
}