--- net-misc/dahdi/dahdi-2.2.0.2.ebuild 2009-10-22 11:19:35.000000000 -0700 +++ local/layman/mykhyggz/net-misc/dahdi/dahdi-2.2.0.2-r1.ebuild 2010-01-06 15:34:37.000000000 -0800 @@ -19,7 +19,7 @@ LICENSE="LGPL-2.1" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="" +IUSE="ecoslec" DEPEND="" RDEPEND="" @@ -51,6 +51,15 @@ # GCC 4.4 compatibility, the quick 'n dirty way # error: dereferencing pointer to incomplete type epatch "${FILESDIR}"/${P}-gcc44-hack.patch + if use ecoslec; then + elog "Support for OSLEC echo canceller." + epatch "${FILESDIR}"/dahdi_linux_extra.diff + mkdir -p "${MY_P}/drivers/staging" || die "Error creating staging folder." + cp -a "${KERNEL_DIR}/drivers/staging/echo" "${MY_P}/drivers/staging/" \ + || die "Error copying staging/echo folder" + sed -re 's,^#(obj-m \+= (dahdi_echocan_oslec.o|\.\./staging/echo/))$,\1,' -i "${MY_P}/drivers/dahdi/Kbuild" \ + || die "Error enabling OSLEC" + fi } src_compile() { @@ -69,3 +78,12 @@ emake KSRC="${KERNEL_DIR}" DESTDIR="${D}" install || die "Installation failed" rm -rf "$D"/lib/modules/*/modules.* } + +pkg_postinst() { + depmod || die "depmod failed" + if use ecoslec && linux-info_get_any_version && linux_config_src_exists; then + CONFIG_CHECK="~ECHO" + local ERROR_ECHO="You need CONFIG_ECHO enabled in your kernel sources in order to use oslec support." + check_extra_config + fi +}