# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-libs/pjsip/pjsip-2.1-r2.ebuild,v 1.3 2014/03/09 13:07:51 aballier Exp $ EAPI="5" PYTHON_COMPAT=( python{2_6,2_7} ) #DISTUTILS_IN_SOURCE_BUILD=1 inherit eutils multilib distutils-r1 DESCRIPTION="Multimedia communication libraries written in C language for building VoIP applications" HOMEPAGE="http://www.pjsip.org/" SRC_URI="http://www.pjsip.org/release/${PV}/pjproject-${PV}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="alsa amr asterisk cli doc examples ext-sound external-srtp internal-gsm internal-speex ffmpeg g711 g722 g7221 gsm ilbc l16 oss python resample sdl speex speex-aec ssl static-libs v4l2 x264 video ipv6" #small-filter large-filter DEPEND="virtual/pkgconfig alsa? ( media-libs/alsa-lib ) ffmpeg? ( >=virtual/ffmpeg-9 ) gsm? ( media-sound/gsm ) amr? ( media-libs/opencore-amr ) ilbc? ( dev-libs/ilbc-rfc3951 ) speex? ( media-libs/speex ) internal-speex? ( !media-libs/speex ) external-srtp? ( net-libs/libsrtp ) !external-srtp? ( !net-libs/libsrtp ) sdl? ( media-libs/libsdl ) x264? ( media-libs/x264 ) python? ( ${PYTHON_DEPS} )" RDEPEND="${DEPEND}" S="${WORKDIR}/pjproject-${PV}" REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) speex-aec? ( speex ) internal-gsm? ( !gsm ) internal-speex? ( !speex ) internal-speex? ( !speex-aec ) !video? ( !ffmpeg ) asterisk ( gsm !internal-gsm speex !internal-speex !alsa external-srtp !amr !video !resample )" src_prepare() { epatch_user if use python; then pushd pjsip-apps/src/python distutils-r1_src_prepare popd fi } src_configure() { # Disable through portage available codecs # libdir should be defined explicitly, bug #497744 use ipv6 && append-flags "-DPJ_HAS_IPV6=1" append-flags "-DNDEBUG" econf \ --libdir="/usr/$(get_libdir)" \ $(use static-libs && echo '--disable-shared' || echo '--enable-shared') \ $(use_enable alsa sound) \ $(use_with gsm external-gsm) \ $(use_with speex external-speex) \ $(use_with external-srtp) \ $(use_enable oss) \ $(use_enable resample) \ $(use_enable ext-sound) \ $(use ffmpeg || echo '--disable-ffmpeg') \ $(use_enable g711 g711-codec) \ $(use_enable l16 l16-codec) \ $(use_enable internal-gsm gsm-codec) \ $(use_enable gsm gsm-codec) \ $(use_enable g722 g722-codec) \ $(use_enable g7221 g7221-codec) \ $(use_enable internal-speex speex-codec) \ $(use_enable speex speex-codec) \ $(use_enable ilbc ilbc-codec) \ $(use_enable speex-aec) \ $(use_enable speex speex-aec) \ $(use_enable ssl) \ $(use_enable v4l2) \ $(use_enable sdl) \ $(use_enable video) \ $(use_enable amr opencore-amr) \ $(use_enable x264 openh264) # $(use_enable small-filter) \ # $(use_enable large-filter) \ if use python; then pushd pjsip-apps/src/python distutils-r1_src_configure popd fi } src_compile() { emake dep emake -j1 if use python; then pushd pjsip-apps/src/python distutils-r1_src_compile popd fi } src_install() { DESTDIR="${D}" emake install if use cli; then newbin pjsip-apps/bin/pjsua* pjsua fi if use python; then pushd pjsip-apps/src/python distutils-r1_src_install popd fi if use doc; then dodoc README.txt README-RTEMS fi if use examples; then docinto examples docompress -x "/usr/share/doc/${PF}/examples" dodoc pjsip-apps/src/samples/* fi }