| 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/bluez/bluez-4.101-r3.ebuild,v 1.1 2012/08/21 13:04:10 pacho Exp $ |
| 4 |
|
| 5 |
EAPI="4" |
| 6 |
PYTHON_DEPEND="test-programs? 2" |
| 7 |
|
| 8 |
inherit multilib eutils systemd python user |
| 9 |
|
| 10 |
DESCRIPTION="Bluetooth Tools and System Daemons for Linux" |
| 11 |
HOMEPAGE="http://www.bluez.org/" |
| 12 |
|
| 13 |
# Because of oui.txt changing from time to time without noticement, we need to supply it |
| 14 |
# ourselves instead of using http://standards.ieee.org/regauth/oui/oui.txt directly. |
| 15 |
# See bugs #345263 and #349473 for reference. |
| 16 |
OUIDATE="20120623" |
| 17 |
SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.xz |
| 18 |
http://dev.gentoo.org/~pacho/bluez/oui-${OUIDATE}.txt.xz" |
| 19 |
|
| 20 |
LICENSE="GPL-2 LGPL-2.1" |
| 21 |
SLOT="0" |
| 22 |
KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86" |
| 23 |
IUSE="alsa +consolekit cups debug gstreamer selinux pcmcia test-programs usb readline" |
| 24 |
|
| 25 |
CDEPEND=" |
| 26 |
>=dev-libs/glib-2.28:2 |
| 27 |
>=sys-apps/dbus-1.4 |
| 28 |
>=sys-fs/udev-169 |
| 29 |
alsa? ( |
| 30 |
media-libs/alsa-lib[alsa_pcm_plugins_extplug(+),alsa_pcm_plugins_ioplug(+)] |
| 31 |
media-libs/libsndfile |
| 32 |
) |
| 33 |
cups? ( net-print/cups ) |
| 34 |
gstreamer? ( |
| 35 |
>=media-libs/gstreamer-0.10:0.10 |
| 36 |
>=media-libs/gst-plugins-base-0.10:0.10 |
| 37 |
) |
| 38 |
selinux? ( sec-policy/selinux-bluetooth ) |
| 39 |
usb? ( virtual/libusb:0 ) |
| 40 |
readline? ( sys-libs/readline ) |
| 41 |
" |
| 42 |
DEPEND="${CDEPEND} |
| 43 |
virtual/pkgconfig |
| 44 |
sys-devel/flex |
| 45 |
test-programs? ( >=dev-libs/check-0.9.6 ) |
| 46 |
" |
| 47 |
RDEPEND="${CDEPEND} |
| 48 |
!net-wireless/bluez-libs |
| 49 |
!net-wireless/bluez-utils |
| 50 |
consolekit? ( sys-auth/consolekit ) |
| 51 |
test-programs? ( |
| 52 |
dev-python/dbus-python |
| 53 |
dev-python/pygobject:2 |
| 54 |
) |
| 55 |
" |
| 56 |
|
| 57 |
DOCS=( AUTHORS ChangeLog README ) |
| 58 |
|
| 59 |
pkg_setup() { |
| 60 |
if ! use consolekit; then |
| 61 |
enewgroup plugdev |
| 62 |
fi |
| 63 |
|
| 64 |
if use test-programs; then |
| 65 |
python_pkg_setup |
| 66 |
fi |
| 67 |
} |
| 68 |
|
| 69 |
src_prepare() { |
| 70 |
epatch "${FILESDIR}"/${P}-network{1,2,3,4}.patch |
| 71 |
|
| 72 |
if ! use consolekit; then |
| 73 |
# No consolekit for at_console etc, so we grant plugdev the rights |
| 74 |
epatch "${FILESDIR}/bluez-plugdev.patch" |
| 75 |
fi |
| 76 |
|
| 77 |
if use cups; then |
| 78 |
sed -i \ |
| 79 |
-e "s:cupsdir = \$(libdir)/cups:cupsdir = `cups-config --serverbin`:" \ |
| 80 |
Makefile.tools Makefile.in || die |
| 81 |
fi |
| 82 |
} |
| 83 |
|
| 84 |
src_configure() { |
| 85 |
use readline || export ac_cv_header_readline_readline_h=no |
| 86 |
|
| 87 |
econf \ |
| 88 |
--disable-silent-rules \ |
| 89 |
--enable-hid2hci \ |
| 90 |
--enable-audio \ |
| 91 |
--enable-bccmd \ |
| 92 |
--enable-datafiles \ |
| 93 |
--enable-dfutool \ |
| 94 |
--enable-input \ |
| 95 |
--enable-network \ |
| 96 |
--enable-serial \ |
| 97 |
--enable-service \ |
| 98 |
--enable-tools \ |
| 99 |
--disable-hal \ |
| 100 |
--localstatedir=/var \ |
| 101 |
--with-systemdunitdir="$(systemd_get_unitdir)" \ |
| 102 |
$(use_enable alsa) \ |
| 103 |
$(use_enable cups) \ |
| 104 |
$(use_enable debug) \ |
| 105 |
$(use_enable gstreamer) \ |
| 106 |
$(use_enable pcmcia) \ |
| 107 |
$(use_enable test-programs test) \ |
| 108 |
$(use_enable usb) \ |
| 109 |
--enable-health \ |
| 110 |
--enable-maemo6 \ |
| 111 |
--enable-pnat \ |
| 112 |
--enable-wiimote |
| 113 |
} |
| 114 |
|
| 115 |
src_install() { |
| 116 |
default |
| 117 |
|
| 118 |
if use test-programs ; then |
| 119 |
cd "${S}/test" |
| 120 |
dobin simple-agent simple-service monitor-bluetooth |
| 121 |
newbin list-devices list-bluetooth-devices |
| 122 |
rm test-textfile.{c,o} || die # bug #356529 |
| 123 |
for b in hsmicro hsplay test-* ; do |
| 124 |
newbin "${b}" "bluez-${b}" |
| 125 |
done |
| 126 |
insinto /usr/share/doc/${PF}/test-services |
| 127 |
doins service-* |
| 128 |
|
| 129 |
python_convert_shebangs -r 2 "${ED}" |
| 130 |
cd "${S}" |
| 131 |
fi |
| 132 |
|
| 133 |
insinto /etc/bluetooth |
| 134 |
doins \ |
| 135 |
input/input.conf \ |
| 136 |
audio/audio.conf \ |
| 137 |
network/network.conf \ |
| 138 |
serial/serial.conf |
| 139 |
|
| 140 |
newinitd "${FILESDIR}/bluetooth-init.d-r2" bluetooth |
| 141 |
newinitd "${FILESDIR}/rfcomm-init.d" rfcomm |
| 142 |
newconfd "${FILESDIR}/rfcomm-conf.d" rfcomm |
| 143 |
|
| 144 |
# Install oui.txt as requested in bug #283791 and approved by upstream |
| 145 |
insinto /var/lib/misc |
| 146 |
newins "${WORKDIR}/oui-${OUIDATE}.txt" oui.txt |
| 147 |
|
| 148 |
prune_libtool_files --all |
| 149 |
} |
| 150 |
|
| 151 |
pkg_postinst() { |
| 152 |
udevadm control --reload-rules |
| 153 |
|
| 154 |
if ! has_version "net-dialup/ppp"; then |
| 155 |
elog "To use dial up networking you must install net-dialup/ppp." |
| 156 |
fi |
| 157 |
|
| 158 |
if use consolekit; then |
| 159 |
elog "If you want to use rfcomm as a normal user, you need to add the user" |
| 160 |
elog "to the uucp group." |
| 161 |
else |
| 162 |
elog "Since you have the consolekit use flag disabled, you will only be able to run" |
| 163 |
elog "bluetooth clients as root. If you want to be able to run bluetooth clientes as " |
| 164 |
elog "a regular user, you need to enable the consolekit use flag for this package or" |
| 165 |
elog "to add the user to the plugdev group." |
| 166 |
fi |
| 167 |
|
| 168 |
if [ "$(rc-config list default | grep bluetooth)" = "" ] ; then |
| 169 |
elog "You will need to add bluetooth service to default runlevel" |
| 170 |
elog "for getting your devices detected. For that please run:" |
| 171 |
elog "'rc-update add bluetooth default'" |
| 172 |
fi |
| 173 |
} |