You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-libs/tntnet/tntnet-2.2.1-r3.ebuild

93 lines
1.8 KiB

# Copyright 1999-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="gnutls server ssl examples"
RDEPEND="
>=dev-libs/cxxtools-2.2.1
sys-libs/zlib[minizip]
ssl? (
gnutls? (
net-libs/gnutls:0=
dev-libs/libgcrypt:0
)
!gnutls? (
dev-libs/openssl:0=
)
)"
DEPEND="${RDEPEND}"
BDEPEND="
app-arch/zip
virtual/pkgconfig"
PATCHES=( "${FILESDIR}"/${PN}-2.0-zlib-minizip.patch )
src_prepare() {
# Both fixed in the next release
default
rm framework/common/{ioapi,unzip}.[ch] || die
# bug 426262
mv configure.{in,ac} || die
# bug 423697
sed -e "s:unzip.h:minizip/unzip.h:" -i framework/defcomp/unzipcomp.cpp || die
eautoreconf
sed -i -e 's:@localstatedir@:/var:' etc/tntnet/tntnet.xml.in || die
}
src_configure() {
# default enabled, will not compile without sdk
local myconf=( --with-sdk )
# Prefer gnutls over SSL
if use gnutls; then
einfo "Using gnutls for ssl support."
myconf+=( --with-ssl=gnutls )
elif use ssl; then
einfo "Using openssl for ssl support."
myconf+=( --with-ssl=openssl )
else
myconf+=( --with-ssl=no )
fi
econf \
--disable-static \
$(use_with server) \
"${myconf[@]}"
}
src_install() {
default
dodoc doc/tntnet.pdf
if use examples; then
emake -C sdk/demos maintainer-clean
rm -r sdk/demos/{Makefile*,*/Makefile*,*/*.{la,lo},*/.libs} || die
docinto examples
dodoc -r sdk/demos/.
fi
if use server; then
rm -f "${ED}"/etc/init.d/tntnet || die
newinitd "${FILESDIR}"/tntnet.initd tntnet
fi
# bug 737184
find "${ED}" -name '*.la' -delete || die
}