2018-06-28 00:13:54 +03:00
|
|
|
# Copyright 1999-2018 Gentoo Foundation
|
2012-07-29 19:47:46 +04:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
2017-03-05 00:10:39 +03:00
|
|
|
EAPI="6"
|
2012-07-29 19:47:46 +04:00
|
|
|
|
2018-06-28 00:13:54 +03:00
|
|
|
inherit cmake-utils udev
|
2012-07-29 19:47:46 +04:00
|
|
|
|
|
|
|
HOMEPAGE="http://ubertooth.sourceforge.net/"
|
|
|
|
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
SLOT="0"
|
2018-06-28 00:13:54 +03:00
|
|
|
IUSE="+bluez static-libs +ubertooth1-firmware +udev"
|
|
|
|
|
2014-04-08 13:20:57 +04:00
|
|
|
DEPEND="bluez? ( net-wireless/bluez:= )
|
2016-02-04 13:21:34 +03:00
|
|
|
>=net-libs/libbtbb-${PV}:=[static-libs?]
|
|
|
|
static-libs? ( dev-libs/libusb[static-libs] )
|
2015-03-19 17:52:45 +03:00
|
|
|
virtual/libusb:1="
|
2012-08-31 22:58:45 +04:00
|
|
|
RDEPEND="${DEPEND}
|
2014-04-08 13:20:57 +04:00
|
|
|
udev? ( virtual/udev )"
|
2012-07-29 19:47:46 +04:00
|
|
|
|
2014-04-09 10:36:58 +04:00
|
|
|
MY_PV=${PV/\./-}
|
|
|
|
MY_PV=${MY_PV/./-R}
|
2012-07-29 19:47:46 +04:00
|
|
|
if [[ ${PV} == "9999" ]] ; then
|
2014-04-08 13:20:57 +04:00
|
|
|
EGIT_REPO_URI="https://github.com/greatscottgadgets/ubertooth.git"
|
|
|
|
inherit git-r3
|
2012-07-29 19:47:46 +04:00
|
|
|
KEYWORDS=""
|
2014-04-08 13:20:57 +04:00
|
|
|
S="${WORKDIR}/${P}/host"
|
2012-07-29 19:47:46 +04:00
|
|
|
else
|
2014-04-08 13:20:57 +04:00
|
|
|
S="${WORKDIR}/${PN}-${MY_PV}/host"
|
|
|
|
SRC_URI="https://github.com/greatscottgadgets/${PN}/releases/download/${MY_PV}/${PN}-${MY_PV}.tar.xz"
|
2012-10-10 16:49:17 +04:00
|
|
|
KEYWORDS="~amd64 ~arm ~x86"
|
2012-07-29 19:47:46 +04:00
|
|
|
fi
|
2016-02-04 13:21:34 +03:00
|
|
|
DESCRIPTION="open source wireless development platform suitable for Bluetooth experimentation"
|
2012-07-29 19:47:46 +04:00
|
|
|
|
2014-04-08 13:20:57 +04:00
|
|
|
#readd firmware building, but do it right
|
|
|
|
#USE="-fortran -mudflap -nls -openmp -multilib" crossdev --without-headers --genv 'EXTRA_ECONF="--with-mode=thumb --with-cpu=cortex-m3 --with-float=soft"' -s4 -t arm-cortexm3-eabi
|
2012-08-31 22:58:45 +04:00
|
|
|
|
2014-04-08 13:20:57 +04:00
|
|
|
src_configure() {
|
2018-06-28 00:13:54 +03:00
|
|
|
local mycmakeargs=(
|
2017-03-05 00:10:39 +03:00
|
|
|
-DUSE_BLUEZ=$(usex bluez)
|
|
|
|
-DBUILD_STATIC_LIB=$(usex static-libs)
|
|
|
|
-DINSTALL_UDEV_RULES=$(usex udev)
|
2016-02-04 13:21:34 +03:00
|
|
|
-DENABLE_PYTHON=false
|
2014-04-08 13:20:57 +04:00
|
|
|
)
|
2015-03-19 17:52:45 +03:00
|
|
|
if use udev; then
|
|
|
|
mycmakeargs+=(
|
|
|
|
-DUDEV_RULES_GROUP=usb
|
|
|
|
-DUDEV_RULES_PATH="$(get_udevdir)/rules.d"
|
|
|
|
)
|
|
|
|
fi
|
2014-04-08 13:20:57 +04:00
|
|
|
cmake-utils_src_configure
|
|
|
|
}
|
|
|
|
|
2012-07-29 19:47:46 +04:00
|
|
|
src_install() {
|
2014-04-08 13:20:57 +04:00
|
|
|
cmake-utils_src_install
|
2012-07-29 19:47:46 +04:00
|
|
|
|
2014-08-26 00:47:28 +04:00
|
|
|
insinto /usr/share/${PN}
|
2015-05-03 23:26:09 +03:00
|
|
|
pushd "${WORKDIR}/${PN}-${MY_PV}" || die
|
2012-07-29 19:47:46 +04:00
|
|
|
if [[ ${PV} == "9999" ]] ; then
|
2014-04-08 13:20:57 +04:00
|
|
|
ewarn "Firmware isn't available for git releases, we assume you are already"
|
|
|
|
ewarn "on the latest and/or can build your own."
|
2012-07-29 19:47:46 +04:00
|
|
|
else
|
2015-10-13 14:04:07 +03:00
|
|
|
use ubertooth1-firmware && newins ubertooth-one-firmware-bin/bluetooth_rxtx.dfu ${PN}-one-${PV}-bluetooth_rxtx.dfu
|
|
|
|
use ubertooth1-firmware && newins ubertooth-one-firmware-bin/bluetooth_rx_only.dfu ${PN}-one-${PV}-bluetooth_rx_only.dfu
|
2012-07-29 19:47:46 +04:00
|
|
|
fi
|
2015-05-03 23:26:09 +03:00
|
|
|
popd
|
2012-07-29 19:47:46 +04:00
|
|
|
|
|
|
|
elog "Everyone can read from the ubertooth, but to talk to it"
|
|
|
|
elog "your user needs to be in the usb group."
|
|
|
|
}
|