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

EAPI=7

inherit autotools

DESCRIPTION="Modular, multithreaded web application server extensible with C++"
HOMEPAGE="http://www.tntnet.org/"
SRC_URI="http://www.tntnet.org/download/${P}.tar.gz"

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="amd64 ~sparc x86"
IUSE="doc gnutls server ssl"

RDEPEND=">=dev-libs/cxxtools-3.0
	sys-libs/zlib[minizip]
	ssl? (
		gnutls? (
			>=net-libs/gnutls-1.2.0
			dev-libs/libgcrypt:0
		)
		!gnutls? (
			dev-libs/openssl:0=
		)
	)"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig
	app-arch/zip"

PATCHES=(
	"${FILESDIR}/${PN}-3.0-autoconf-2.70.patch"
)

src_prepare() {
	default

	eautoreconf

	sed -i -e 's:@localstatedir@:/var:' etc/tntnet/tntnet.xml.in || die

	# bug 423697
	sed -e "s:unzip.h:minizip/unzip.h:" -i framework/defcomp/unzipcomp.cpp || die

	# upstream still use bundeld zlib here
	sed -e "s:unzip.h:minizip/unzip.h:" -i framework/common/unzipfile.cpp || die
}

src_configure() {
	local myconf=""

	if ! use server; then
		myconf="${myconf} --disable-server"
	fi

	econf ${myconf}
}

src_install() {
	emake DESTDIR="${D}" install

	dodoc AUTHORS ChangeLog README

	doman doc/man/{ecpp.7,ecppc.1,tntnet.8,tntnet.xml.7}

	if use server; then
		rm -f "${D}/etc/init.d/tntnet"
		newinitd "${FILESDIR}/tntnet-3.initd" tntnet
	fi

	# remove static libs
	rm -f "${ED}"/usr/$(get_libdir)/libtntnet{,_sdk}.la || die
}