# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ ECVS_SERVER="cvs.sf.net:/cvsroot/bluetooth-alsa" ECVS_MODULE="btsco" ECVS_BRANCH="HEAD" inherit autotools cvs linux-mod DESCRIPTION="ALSA bluetooth headset driver" HOMEPAGE="http://bluetooth-alsa.sourceforge.net/" SRC_URI="" LICENSE="GPL-2" SLOT="0" KEYWORDS="x86" IUSE="alsa ao skype" DEPEND="${DEPEND} !media-sound/alsa-driver !=virtual/linux-sources-2.4* >=virtual/linux-sources-2.6 ao? ( media-libs/libao ) net-wireless/bluez-libs media-libs/alsa-lib sys-apps/gawk" RDEPEND="net-wireless/bluez-utils skype? ( net-im/skype sys-apps/dbus ) media-sound/alsa-utils" S="${WORKDIR}/btsco" MY_S_SKYPE="${S}/contrib/skype_bt_hijacker" MY_D_SKYPE="/usr/libexec/${PN}" pkg_setup() { MODULE_NAMES="snd-bt-sco(extra:${S}/kernel:${S}/kernel)" BUILD_TARGETS="default" CONFIG_CHECK="BT_SCO BT_HCIUSB_SCO SND_HWDEP" ERROR_BT_SCO="Enable BT_SCO config option in in your kernel, found at: Networking ---> Networking support ---> Bluetooth subsystem support ---> <*> SCO links support " ERROR_BT_HCIUSB_SCO="Enable BT_HCIUSB_SCO config option in your kernel, found at: Networking ---> Networking support ---> Bluetooth subsystem support ---> Bluetooth device drivers ---> <*> HCI USB driver " ERROR_SND_HWDEP="Enable SND_HWDEP config option in your kernel, enabling Emu10k1: Device Drivers ---> Sound ---> Advanced Linux Sound Architecture ---> PCI devices ---> <*> Emu10k1 (SB Live!, Audigy, E-mu APS) " linux-mod_pkg_setup } src_unpack() { cvs_src_unpack sed -i -e "s:=\$(PREFIX).*:=\$(PREFIX):" \ ${MY_S_SKYPE}/Makefile sed -i -e "s:BINPATH=.*:BINPATH=${MY_D_SKYPE}:" \ ${MY_S_SKYPE}/skype_bt_hijacker } src_compile() { cd ${S} export WANT_AUTOMAKE="1.9.6" eautoreconf || die "autotools failed" econf \ $(use_enable alsa alsaplugin) \ $(use_enable ao ) || die "econf failed" emake || die "emake failed" if use skype; then cd ${MY_S_SKYPE} emake || die "emake failed" fi linux-mod_src_compile } src_install() { cd ${S} make install DESTDIR="${D}" || die "make install failed" dobin btsco2 a2play a2recv avrecv avsnd \ sbc/rcplay sbc/sbcdec sbc/sbcenc sbc/sbcinfo dodoc AUTHORS COPYING COPYING* ChangeLog NEWS README use alsa && newdoc bt/BUILD README.alsaplugin linux-mod_src_install if use skype; then cd ${MY_S_SKYPE} dodir ${MY_D_SKYPE} make install PREFIX=${D}/${MY_D_SKYPE} dosym ${MY_D_SKYPE}/skype_bt_hijacker /usr/bin docinto Skype dodoc ${MY_S_SKYPE}/README ${MY_S_SKYPE}/ChangeLog fi }