# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

DESCRIPTION="SIPp is a free Open Source test tool / traffic generator for the SIP protocol"
HOMEPAGE="http://sipp.sourceforge.net/ https://github.com/SIPp/sipp/releases"
SRC_URI="https://github.com/SIPp/sipp/releases/download/v${PV}/${PF}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+ssl +pcap gsl"

DEPEND="sys-libs/ncurses
	ssl? ( dev-libs/openssl )
	pcap? ( net-libs/libpcap net-libs/libnet )
	gsl? ( sci-libs/gsl )
"
RDEPEND="${DEPEND}"

src_configure()
{
	LIBS=-ltinfo econf \
		$(use_with ssl openssl) \
		$(use_with pcap) \
		$(use_with gsl) \
		$(use_with sctp) \
		--with-rtpstream
}

src_install() {
	default
	insinto /usr/share/${PN}
	doins pcap/*.pcap
	dodoc CHANGES.md FAQ.md README.md
}