| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/net-wireless/ubertooth/ubertooth-0.0_p534.ebuild,v 1.6 2012/08/12 07:38:01 ssuominen Exp $
|
| 4 |
|
| 5 |
EAPI="4"
|
| 6 |
|
| 7 |
inherit multilib #flag-o-matic
|
| 8 |
|
| 9 |
HOMEPAGE="http://ubertooth.sourceforge.net/"
|
| 10 |
|
| 11 |
LICENSE="GPL-2"
|
| 12 |
SLOT="0"
|
| 13 |
IUSE="+dfu +specan ubertooth0-firmware +ubertooth1-firmware"
|
| 14 |
REQUIRED_USE="ubertooth0-firmware? ( dfu )
|
| 15 |
ubertooth1-firmware? ( dfu )"
|
| 16 |
DEPEND=""
|
| 17 |
RDEPEND="specan? ( virtual/libusb:1 )
|
| 18 |
dfu? ( virtual/libusb:1 )
|
| 19 |
specan? ( >=x11-libs/qt-gui-4.7.2:4
|
| 20 |
>=dev-python/pyside-1.0.2
|
| 21 |
>=dev-python/numpy-1.3 )
|
| 22 |
specan? ( >=dev-python/pyusb-1.0.0_alpha1 )
|
| 23 |
dfu? ( >=dev-python/pyusb-1.0.0_alpha1 )"
|
| 24 |
|
| 25 |
if [[ ${PV} == "9999" ]] ; then
|
| 26 |
ESVN_REPO_URI="https://ubertooth.svn.sourceforge.net/svnroot/ubertooth/trunk/"
|
| 27 |
SRC_URI=""
|
| 28 |
inherit subversion
|
| 29 |
KEYWORDS=""
|
| 30 |
DEPEND="=net-libs/libbtbb-9999"
|
| 31 |
RDEPEND="${RDEPEND}
|
| 32 |
=net-libs/libbtbb-9999
|
| 33 |
ubertooth0-firmware? ( sys-devel/gcc-arm-embedded-bin )
|
| 34 |
ubertooth1-firmware? ( sys-devel/gcc-arm-embedded-bin )"
|
| 35 |
else
|
| 36 |
MY_PV="${PV/p/r}"
|
| 37 |
MY_PV="${MY_PV/0.0_/}"
|
| 38 |
SRC_URI="mirror://sourceforge/${PN}/${PN}-${MY_PV}.tar.gz"
|
| 39 |
KEYWORDS="~amd64 ~x86"
|
| 40 |
S="${WORKDIR}/${PN}-${MY_PV}/"
|
| 41 |
DEPEND=">=net-libs/libbtbb-0.8"
|
| 42 |
RDEPEND="${RDEPEND}
|
| 43 |
>=net-libs/libbtbb-0.8"
|
| 44 |
fi
|
| 45 |
DESCRIPTION="An open source wireless development platform suitable for Bluetooth experimentation"
|
| 46 |
|
| 47 |
src_compile() {
|
| 48 |
#sometimes needed to build, remove when a release is made after r534 if not needed
|
| 49 |
#filter-ldflags -Wl,--as-needed
|
| 50 |
cd "${S}/host/bluetooth_rxtx" || die
|
| 51 |
emake
|
| 52 |
|
| 53 |
if [[ ${PV} == "9999" ]] ; then
|
| 54 |
cd "${S}"/firmware/bluetooth_rxtx || die
|
| 55 |
if use ubertooth0-firmware; then
|
| 56 |
SVN_REV_NUM="-D'SVN_REV_NUM'=${ESVN_WC_REVISION}" DFU_TOOL=/usr/bin/ubertooth-dfu BOARD=UBERTOOTH_ZERO emake -j1
|
| 57 |
mv bluetooth_rxtx.bin bluetooth_rxtx_U0.bin || die
|
| 58 |
emake clean
|
| 59 |
fi
|
| 60 |
if use ubertooth1-firmware; then
|
| 61 |
SVN_REV_NUM="-D'SVN_REV_NUM'=${ESVN_WC_REVISION}" DFU_TOOL=/usr/bin/ubertooth-dfu emake -j1
|
| 62 |
mv bluetooth_rxtx.bin bluetooth_rxtx_U1.bin || die
|
| 63 |
fi
|
| 64 |
fi
|
| 65 |
}
|
| 66 |
|
| 67 |
src_install() {
|
| 68 |
cd host || die
|
| 69 |
dobin bluetooth_rxtx/ubertooth-dump bluetooth_rxtx/ubertooth-lap \
|
| 70 |
bluetooth_rxtx/ubertooth-btle bluetooth_rxtx/ubertooth-uap \
|
| 71 |
bluetooth_rxtx/ubertooth-hop bluetooth_rxtx/ubertooth-util
|
| 72 |
|
| 73 |
use specan && dobin bluetooth_rxtx/ubertooth-specan specan_ui/specan.py specan_ui/ubertooth-specan-ui
|
| 74 |
|
| 75 |
use dfu && dobin usb_dfu/ubertooth-dfu usb_dfu/dfu_suffix.py
|
| 76 |
|
| 77 |
insinto /lib/firmware
|
| 78 |
cd "${S}"
|
| 79 |
if [[ ${PV} == "9999" ]] ; then
|
| 80 |
use ubertooth0-firmware && doins firmware/bluetooth_rxtx/bluetooth_rxtx_U0.bin
|
| 81 |
use ubertooth1-firmware && doins firmware/bluetooth_rxtx/bluetooth_rxtx_U1.bin
|
| 82 |
else
|
| 83 |
use ubertooth0-firmware && newins ubertooth-zero-firmware-bin/bluetooth_rxtx.bin bluetooth_rxtx_U0.bin
|
| 84 |
use ubertooth1-firmware && newins ubertooth-one-firmware-bin/bluetooth_rxtx.bin bluetooth_rxtx_U1.bin
|
| 85 |
fi
|
| 86 |
|
| 87 |
insinto /lib/udev/rules.d/
|
| 88 |
doins "${FILESDIR}"/40-ubertooth.rules
|
| 89 |
|
| 90 |
elog "Everyone can read from the ubertooth, but to talk to it"
|
| 91 |
elog "your user needs to be in the usb group."
|
| 92 |
}
|