--- asterisk-1.6.2.1.ebuild 2010-01-19 14:12:46.000000000 +0100 +++ asterisk-1.6.2.1-r2.ebuild 2010-01-22 14:50:29.000000000 +0100 @@ -14,7 +14,7 @@ SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="alsa +caps curl dahdi debug freetds iconv jabber ldap keepsrc misdn newt nosamples oss postgres radius snmp span speex ssl sqlite static vorbis" +IUSE="alsa +caps curl dahdi debug freetds iconv ilbc jabber ldap keepsrc misdn newt nosamples oss postgres radius snmp span speex ssl sqlite static vorbis" RDEPEND="sys-libs/ncurses dev-libs/popt @@ -26,6 +26,7 @@ net-misc/dahdi-tools ) freetds? ( dev-db/freetds ) iconv? ( virtual/libiconv ) + ilbc? ( dev-libs/ilbc-rfc3951 ) jabber? ( dev-libs/iksemel ) ldap? ( net-nds/openldap ) misdn? ( net-dialup/misdnuser ) @@ -106,6 +107,9 @@ # epatch "${FILESDIR}"/1.6.2/${P}-parallel-make.patch || die "patch failed" + # patch the ilbc makefile to avoid building ilbc lib since it's already provided by dev-libs/ilbc-rfc3951 + use ilbc && epatch "${FILESDIR}"/${PN}-ilbc-v2.diff + AT_M4DIR=autoconf eautoreconf # parse modules list @@ -134,6 +138,25 @@ export MODULES_LIST fi + + if use ilbc ; then + ewarn " Asterisk iLBC Codec Warning" + ewarn "" + ewarn "Asterisk does not distribute the iLBC codec source code anymore." + ewarn "dev-libs/ilbc-rfc3951 will be used instead." + ewarn "On some systems dev-libs/ilbc-rfc3951 should be compiled with -fPIC" + ewarn "otherwise Asterisk may fail to start when it loads codec_ilbc." + ewarn "" + ewarn " Asterisk iLBC Codec Warning" + echo + waitaftermsg=1 + fi + + if [[ $waitaftermsg -eq 1 ]]; then + einfo "Press Ctrl+C to abort" + echo + ebeep 10 + fi } src_compile() { @@ -219,9 +242,19 @@ then category="$(echo ${category} | tr '[:lower:]' '[:upper:]')" sed -i -e "s:^\(MENUSELECT_${category}S?\):\1=${tmp_list}:" \ - menuselect.makeopts || die "failed to set list of ${category} applications" + emake menuselect.makeopts || die "failed to set list of ${category} applications" + # dirty fix to remove codec_ilbc from menuselect.makeopts + if use ilbc ; then + sed -i -e "s:codec_ilbc::" menuselect.makeopts || die "ilbc: sed failed" + fi fi done + else + # dirty fix to remove codec_ilbc from menuselect.makeopts + if use ilbc ; then + emake menuselect.makeopts || die "ilbc: emake menuselect.makeopts failed" + sed -i -e "s:codec_ilbc::" menuselect.makeopts || die "ilbc: sed failed" + fi fi ASTLDFLAGS="${LDFLAGS}" emake || die "emake failed"