summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-wireless/bluez
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-wireless/bluez')
-rw-r--r--net-wireless/bluez/Manifest5
-rw-r--r--net-wireless/bluez/bluez-4.101-r9.ebuild204
-rw-r--r--net-wireless/bluez/bluez-5.25.ebuild208
-rw-r--r--net-wireless/bluez/bluez-5.32.ebuild209
-rw-r--r--net-wireless/bluez/bluez-5.33.ebuild209
-rw-r--r--net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch58
-rw-r--r--net-wireless/bluez/files/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch38
-rw-r--r--net-wireless/bluez/files/0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch29
-rw-r--r--net-wireless/bluez/files/0002-autopair-Don-t-handle-the-iCade.patch47
-rw-r--r--net-wireless/bluez/files/0004-agent-Assert-possible-infinite-loop.patch25
-rw-r--r--net-wireless/bluez/files/bluetooth-init.d-r221
-rw-r--r--net-wireless/bluez/files/bluetooth-init.d-r321
-rwxr-xr-xnet-wireless/bluez/files/bluez-plugdev.patch14
-rw-r--r--net-wireless/bluez/files/bluez-udevadm-path.patch10
-rw-r--r--net-wireless/bluez/files/rfcomm-conf.d5
-rw-r--r--net-wireless/bluez/files/rfcomm-init.d27
-rwxr-xr-xnet-wireless/bluez/files/rfcomm-init.d-r235
-rw-r--r--net-wireless/bluez/metadata.xml21
18 files changed, 1186 insertions, 0 deletions
diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
new file mode 100644
index 00000000000..08cbee844ad
--- /dev/null
+++ b/net-wireless/bluez/Manifest
@@ -0,0 +1,5 @@
+DIST bluez-4.101-patches.tar.xz 12380 SHA256 ea4b837245080ebe904fe4f338cd3c8c1370e197cdfbcd42bd55430c940b5e13 SHA512 0ef3219ed923a0880b2fe7008c36c185ff631a8fe1b357cc3612888817d9a7eaa6624bd31ed00a8bbbb6739528cb777a0b9900a7db4930482d1cbc38417b89aa WHIRLPOOL b89729b2cb1ecd6c816210682605b275af396af056e85d9a8671192ede0470002c1f61931781f27ad988ce8bc137f69a6725008a5ea9fe743ae41bc2f5edc7e8
+DIST bluez-4.101.tar.xz 887236 SHA256 41f9578bef39b8c94a2d6ddeaa556afd22d136936d0f03100e422fe970a45a7d SHA512 c8a88fa6948e43c81687047856806c9dc576d3223371947b496f228dec2b2614d1c5a8ff587e9f26eec44843a50503c55861f9fa736fdba43b2364f663f0cb0d WHIRLPOOL 0c4f163e4f4d0ba8f7928f5330ac3fd5f204c299346c59e73b64ebb331b0887a2b01e8ed6f4e6ae91f826a0431df4f97fe3a0900fa6013ae66fd755aaa136196
+DIST bluez-5.25.tar.xz 1479312 SHA256 5ca62f3f45e2638a0f7a81658d6c8813ee01487436ae8e53e9fe395e23d1fd30 SHA512 2e13c552e771a9066c3170dfca43cca8a16b3afa3580b90ff065301e3a85d35ac47b145f5aa4db42001c466675994e9115d5c1909b7abe76c381114b7f4d872a WHIRLPOOL 28dfe9e7a6eb9a1cb81001f7183a26b3a3cf8d6383b4c6d17e0b851eeb87497e23c8262a07564cb1cc0fcec128627503ff266d17c86c7ebd8906b9c714dc5df1
+DIST bluez-5.32.tar.xz 1634844 SHA256 fe4f35e701cbec04478818adf014ed9bbd1f7d11e2603370f1b70a78106f57f7 SHA512 718d0e1132123b67acaf0cf91aaf0add1e56b5b79fbb3cc4a72299c6ae00bfab6e0096463969b6bc27fdbeb18d4b62823d59356f6ff661b0bbe2df8205775f28 WHIRLPOOL 9e45d2bc4f65f15a9f2fe01edb90411918d2787b1008859a08894a4330170901ecd02aa0d8c5ab8d0866c316272c4605b8ecb40a0d91596a059dbb16b34ed26d
+DIST bluez-5.33.tar.xz 1636808 SHA256 1801807a13506678cbfeb15c6a4b89ecb5739efe1067eb464da6641d731436d3 SHA512 6b91b7d232c2654985b4777162e14a750b2840ec8bea7f913fc22bb63c5b767f6e8a7c39645cc7d583f17c993bd772f836bf0ab491eb5c75950c08dd9291a3da WHIRLPOOL cf176fabc4689c6e0233005a95731977e177eefb84c1652cbb0ca70a6a484366c7f4c95f3086652a8e3f6ccc023f741cbf930844265cf7090685863dc38fc105
diff --git a/net-wireless/bluez/bluez-4.101-r9.ebuild b/net-wireless/bluez/bluez-4.101-r9.ebuild
new file mode 100644
index 00000000000..c0291711a18
--- /dev/null
+++ b/net-wireless/bluez/bluez-4.101-r9.ebuild
@@ -0,0 +1,204 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+inherit autotools eutils multilib python-single-r1 readme.gentoo \
+ systemd user multilib-minimal
+
+DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
+HOMEPAGE="http://www.bluez.org/"
+SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.xz
+ http://dev.gentoo.org/~pacho/bluez/${P}-patches.tar.xz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 arm hppa ppc ppc64 x86"
+IUSE="alsa cups debug gstreamer hid2hci pcmcia readline selinux test-programs usb"
+
+REQUIRED_USE="test-programs? ( ${PYTHON_REQUIRED_USE} )"
+
+# TODO: revisit USE=gstreamer once gstreamer is ported to multilib
+
+CDEPEND="
+ >=dev-libs/glib-2.28:2
+ >=sys-apps/dbus-1.6:=
+ >=sys-apps/hwids-20121202.2
+ >=virtual/udev-171
+ alsa? (
+ >=media-libs/alsa-lib-1.0.27.2:=[${MULTILIB_USEDEP},alsa_pcm_plugins_extplug(+),alsa_pcm_plugins_ioplug(+)]
+ media-libs/libsndfile:=
+ )
+ cups? ( net-print/cups:= )
+ gstreamer? (
+ >=media-libs/gstreamer-0.10:0.10
+ >=media-libs/gst-plugins-base-0.10:0.10
+ )
+ readline? ( sys-libs/readline:= )
+ selinux? ( sec-policy/selinux-bluetooth )
+ usb? ( virtual/libusb:0 )
+"
+DEPEND="${CDEPEND}
+ sys-devel/flex
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
+ test-programs? ( >=dev-libs/check-0.9.6 )
+"
+RDEPEND="${CDEPEND}
+ test-programs? (
+ >=dev-python/dbus-python-1
+ dev-python/pygobject:2
+ dev-python/pygobject:3
+ ${PYTHON_DEPS}
+ )
+ abi_x86_32? (
+ !<app-emulation/emul-linux-x86-soundlibs-20140406-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32]
+ )
+"
+
+DOCS=( AUTHORS ChangeLog README )
+
+DOC_CONTENTS="
+ If you want to use rfcomm as a normal user, you need to add the user
+ to the uucp group.
+"
+
+pkg_setup() {
+ enewgroup plugdev
+ use test-programs && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Fedora patches
+ epatch "${WORKDIR}/${P}-patches"/*.patch
+
+ # Use static group "plugdev" if there is no ConsoleKit (or systemd logind)
+ epatch "${FILESDIR}"/bluez-plugdev.patch
+
+ sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.ac || die
+
+ eautoreconf
+
+ if use cups; then
+ sed -i \
+ -e "s:cupsdir = \$(libdir)/cups:cupsdir = `cups-config --serverbin`:" \
+ Makefile.{in,tools} || die
+ fi
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=(
+ ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
+ )
+
+ if ! multilib_is_native_abi; then
+ myconf+=(
+ # deps not used for the library
+ {DBUS,GLIB}_{CFLAGS,LIBS}=' '
+ )
+ fi
+
+ # Missing flags: --enable-{sap,hidd,pand,dund,dbusoob,gatt}
+ # Keep this in ./configure --help order!
+ econf \
+ --localstatedir=/var \
+ --enable-network \
+ --enable-serial \
+ --enable-input \
+ --enable-audio \
+ --enable-service \
+ --enable-health \
+ --enable-pnat \
+ $(multilib_native_use_enable gstreamer) \
+ $(use_enable alsa) \
+ $(multilib_native_use_enable usb) \
+ $(multilib_native_use_enable usb cable) \
+ --enable-tools \
+ --enable-bccmd \
+ $(use_enable pcmcia) \
+ $(multilib_native_use_enable hid2hci) \
+ --enable-dfutool \
+ $(multilib_native_use_enable cups) \
+ $(multilib_native_use_enable test-programs test) \
+ --enable-datafiles \
+ $(use_enable debug) \
+ --enable-maemo6 \
+ --enable-wiimote \
+ --disable-hal \
+ --with-ouifile=/usr/share/misc/oui.txt \
+ --with-systemdunitdir="$(systemd_get_unitdir)"
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake -f Makefile -f - libs \
+ <<<'libs: $(lib_LTLIBRARIES) $(alsa_LTLIBRARIES)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake DESTDIR="${D}" \
+ install-includeHEADERS \
+ install-libLTLIBRARIES \
+ install-alsaLTLIBRARIES \
+ install-pkgconfigDATA
+ fi
+
+ if multilib_is_native_abi && use test-programs; then
+ pushd test >/dev/null
+ dobin simple-agent simple-service monitor-bluetooth
+ newbin list-devices list-bluetooth-devices
+ rm test-textfile.{c,o} || die #356529
+ local b
+ for b in hsmicro hsplay test-*; do
+ newbin "${b}" bluez-"${b}"
+ done
+ insinto /usr/share/doc/${PF}/test-services
+ doins service-*
+ python_fix_shebang "${ED}"
+ popd >/dev/null
+ fi
+}
+
+multilib_src_install_all() {
+ insinto /etc/bluetooth
+ local d
+ for d in input audio network serial; do
+ doins ${d}/${d}.conf
+ done
+
+ newinitd "${FILESDIR}"/bluetooth-init.d-r2 bluetooth
+ newinitd "${FILESDIR}"/rfcomm-init.d rfcomm
+ newconfd "${FILESDIR}"/rfcomm-conf.d rfcomm
+
+ readme.gentoo_create_doc
+
+ prune_libtool_files --modules
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+
+ udevadm control --reload-rules
+
+ has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp."
+
+ if ! has_version sys-auth/consolekit && ! has_version sys-apps/systemd; then
+ elog "Since you don't have sys-auth/consolekit neither sys-apps/systemd, you will only"
+ elog "be able to run bluetooth clients as root. If you want to be able to run bluetooth clientes as"
+ elog "a regular user, you need to enable the consolekit use flag for this package or"
+ elog "to add the user to the plugdev group."
+ fi
+}
diff --git a/net-wireless/bluez/bluez-5.25.ebuild b/net-wireless/bluez/bluez-5.25.ebuild
new file mode 100644
index 00000000000..c5568b301db
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.25.ebuild
@@ -0,0 +1,208 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit autotools eutils multilib python-any-r1 readme.gentoo systemd udev user multilib-minimal
+
+DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
+HOMEPAGE="http://www.bluez.org"
+SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.xz"
+
+LICENSE="GPL-2+ LGPL-2.1+"
+SLOT="0/3"
+KEYWORDS="amd64 arm hppa ppc ppc64 x86"
+IUSE="cups debug +obex +readline selinux systemd test +udev"
+REQUIRED_USE="test? ( ${PYTHON_REQUIRED_USE} )"
+
+CDEPEND="
+ >=dev-libs/glib-2.28:2
+ >=sys-apps/dbus-1.6:=
+ >=sys-apps/hwids-20121202.2
+ cups? ( net-print/cups:= )
+ obex? ( dev-libs/libical )
+ readline? ( sys-libs/readline:= )
+ systemd? ( sys-apps/systemd )
+ udev? ( >=virtual/udev-172 )
+ abi_x86_32? (
+ !<app-emulation/emul-linux-x86-soundlibs-20140406-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32]
+ )
+"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ test? (
+ ${PYTHON_DEPS}
+ >=dev-python/dbus-python-1
+ dev-python/pygobject:2
+ dev-python/pygobject:3
+ )
+"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-bluetooth )
+"
+DOC_CONTENTS="
+ If you want to use rfcomm as a normal user, you need to add the user
+ to the uucp group.
+"
+
+pkg_setup() {
+ enewgroup plugdev
+ use test && python-any-r1_pkg_setup
+
+ if ! use udev; then
+ ewarn
+ ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
+ ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
+ ewarn "and hid2hci will not be available."
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # Use static group "plugdev" if there is no ConsoleKit (or systemd logind)
+ epatch "${FILESDIR}"/bluez-plugdev.patch
+
+ # Fedora patches
+ # http://www.spinics.net/lists/linux-bluetooth/msg38490.html
+ epatch "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
+
+ # http://www.spinics.net/lists/linux-bluetooth/msg40136.html
+ epatch "${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
+
+ # http://www.spinics.net/lists/linux-bluetooth/msg41264.html
+ epatch "${FILESDIR}"/0002-autopair-Don-t-handle-the-iCade.patch
+
+ # ???
+ epatch "${FILESDIR}"/0004-agent-Assert-possible-infinite-loop.patch
+
+ # Ubuntu workaround for bug #501120
+ epatch "${FILESDIR}"/0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch
+
+ if use cups; then
+ sed -i \
+ -e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
+ Makefile.{in,tools} || die
+ fi
+
+ eautoreconf
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=(
+ # readline is automagic when client is enabled
+ # --enable-client always needs readline, bug #504038
+ ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
+ )
+
+ if ! multilib_is_native_abi; then
+ myconf+=(
+ # deps not used for the library
+ {DBUS,GLIB}_{CFLAGS,LIBS}=' '
+ )
+ fi
+
+ econf \
+ --localstatedir=/var \
+ --disable-android \
+ --enable-datafiles \
+ --enable-experimental \
+ --enable-optimization \
+ $(use_enable debug) \
+ --enable-pie \
+ --enable-threads \
+ --enable-library \
+ $(multilib_native_use_enable test) \
+ --enable-tools \
+ --enable-manpages \
+ --enable-monitor \
+ $(multilib_native_use_enable cups) \
+ $(multilib_native_use_enable obex) \
+ $(multilib_native_use_enable readline client) \
+ $(multilib_native_use_enable systemd) \
+ $(systemd_with_unitdir) \
+ $(multilib_native_use_enable udev) \
+ $(multilib_native_use_enable udev sixaxis)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake -f Makefile -f - libs \
+ <<<'libs: $(lib_LTLIBRARIES)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+
+ # Upstream don't install this, bug #524640
+ # http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
+ # http://comments.gmane.org/gmane.linux.bluez.kernel/54564
+ # gatttool is only built with readline, bug #530776
+ use readline && dobin attrib/gatttool
+ dobin tools/hex2hcd
+
+ # Unittests are not that useful once installed
+ if use test ; then
+ rm -r "${ED}"/usr/$(get_libdir)/bluez/test || die
+ fi
+ else
+ emake DESTDIR="${D}" \
+ install-includeHEADERS \
+ install-libLTLIBRARIES \
+ install-pkgconfigDATA
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --modules
+
+ keepdir /var/lib/bluetooth
+
+ # Upstream don't want people to play with them
+ # But we keep installing them due 'historical' reasons
+ insinto /etc/bluetooth
+ local d
+ for d in input network proximity; do
+ doins profiles/${d}/${d}.conf
+ done
+ doins src/main.conf
+ doins src/bluetooth.conf
+
+# FIXME:
+# Looks like upstream installs it only for systemd, probably not needed
+# insinto /usr/share/dbus-1/system-services
+# doins src/org.bluez.service
+
+ newinitd "${FILESDIR}"/bluetooth-init.d-r3 bluetooth
+ newinitd "${FILESDIR}"/rfcomm-init.d-r2 rfcomm
+
+ einstalldocs
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+
+ use udev && udev_reload
+
+ has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp."
+
+ if ! has_version sys-auth/consolekit && ! has_version sys-apps/systemd; then
+ elog "Since you don't have sys-auth/consolekit neither sys-apps/systemd, you will only"
+ elog "be able to run bluetooth clients as root. If you want to be able to run bluetooth clients as"
+ elog "a regular user, you need to add the user to the plugdev group."
+ fi
+}
diff --git a/net-wireless/bluez/bluez-5.32.ebuild b/net-wireless/bluez/bluez-5.32.ebuild
new file mode 100644
index 00000000000..a82c3c07090
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.32.ebuild
@@ -0,0 +1,209 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit autotools eutils multilib python-any-r1 readme.gentoo systemd udev user multilib-minimal
+
+DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
+HOMEPAGE="http://www.bluez.org"
+SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.xz"
+
+LICENSE="GPL-2+ LGPL-2.1+"
+SLOT="0/3"
+KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86"
+IUSE="cups debug +obex +readline selinux systemd test +udev"
+
+CDEPEND="
+ >=dev-libs/glib-2.28:2
+ >=sys-apps/dbus-1.6:=
+ >=sys-apps/hwids-20121202.2
+ cups? ( net-print/cups:= )
+ obex? ( dev-libs/libical:= )
+ readline? ( sys-libs/readline:= )
+ systemd? ( sys-apps/systemd )
+ udev? ( >=virtual/udev-172 )
+ abi_x86_32? (
+ !<app-emulation/emul-linux-x86-soundlibs-20140406-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32]
+ )
+"
+DEPEND="${CDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig
+ test? (
+ $(python_gen_any_dep '
+ >=dev-python/dbus-python-1[${PYTHON_USEDEP}]
+ || (
+ dev-python/pygobject:3[${PYTHON_USEDEP}]
+ dev-python/pygobject:2[${PYTHON_USEDEP}]
+ )
+ ')
+ )
+"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-bluetooth )
+"
+DOC_CONTENTS="
+ If you want to use rfcomm as a normal user, you need to add the user
+ to the uucp group.
+"
+
+pkg_setup() {
+ enewgroup plugdev
+ use test && python-any-r1_pkg_setup
+
+ if ! use udev; then
+ ewarn
+ ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
+ ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
+ ewarn "and hid2hci will not be available."
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # Use static group "plugdev" if there is no ConsoleKit (or systemd logind)
+ epatch "${FILESDIR}"/bluez-plugdev.patch
+
+ # Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
+ # http://www.spinics.net/lists/linux-bluetooth/msg58739.html
+ epatch "${FILESDIR}"/bluez-udevadm-path.patch
+
+ # Fedora patches
+ # http://www.spinics.net/lists/linux-bluetooth/msg38490.html
+ epatch "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
+
+ # http://www.spinics.net/lists/linux-bluetooth/msg40136.html
+ epatch "${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
+
+ # http://www.spinics.net/lists/linux-bluetooth/msg41264.html
+ epatch "${FILESDIR}"/0002-autopair-Don-t-handle-the-iCade.patch
+
+ # ???
+ epatch "${FILESDIR}"/0004-agent-Assert-possible-infinite-loop.patch
+
+ # Ubuntu workaround for bug #501120
+ epatch "${FILESDIR}"/0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch
+
+ if use cups; then
+ sed -i \
+ -e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
+ Makefile.{in,tools} || die
+ fi
+
+ eautoreconf
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=(
+ # readline is automagic when client is enabled
+ # --enable-client always needs readline, bug #504038
+ ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
+ )
+
+ if ! multilib_is_native_abi; then
+ myconf+=(
+ # deps not used for the library
+ {DBUS,GLIB}_{CFLAGS,LIBS}=' '
+ )
+ fi
+
+ econf \
+ --localstatedir=/var \
+ --disable-android \
+ --enable-datafiles \
+ --enable-experimental \
+ --enable-optimization \
+ $(use_enable debug) \
+ --enable-pie \
+ --enable-threads \
+ --enable-library \
+ $(multilib_native_use_enable test) \
+ --enable-tools \
+ --enable-manpages \
+ --enable-monitor \
+ $(multilib_native_use_enable cups) \
+ $(multilib_native_use_enable obex) \
+ $(multilib_native_use_enable readline client) \
+ $(multilib_native_use_enable systemd) \
+ $(systemd_with_unitdir) \
+ $(multilib_native_use_enable udev) \
+ $(multilib_native_use_enable udev sixaxis)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake -f Makefile -f - libs \
+ <<<'libs: $(lib_LTLIBRARIES)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+
+ # Upstream doesn't install this, bug #524640
+ # http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
+ # http://comments.gmane.org/gmane.linux.bluez.kernel/54564
+ # gatttool is only built with readline, bug #530776
+ use readline && dobin attrib/gatttool
+ dobin tools/hex2hcd
+
+ # Unittests are not that useful once installed
+ if use test ; then
+ rm -r "${ED}"/usr/$(get_libdir)/bluez/test || die
+ fi
+ else
+ emake DESTDIR="${D}" \
+ install-includeHEADERS \
+ install-libLTLIBRARIES \
+ install-pkgconfigDATA
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --modules
+
+ keepdir /var/lib/bluetooth
+
+ # Upstream don't want people to play with them
+ # But we keep installing them due to 'historical' reasons
+ insinto /etc/bluetooth
+ local d
+ for d in input network proximity; do
+ doins profiles/${d}/${d}.conf
+ done
+ doins src/main.conf
+ doins src/bluetooth.conf
+
+ newinitd "${FILESDIR}"/bluetooth-init.d-r3 bluetooth
+ newinitd "${FILESDIR}"/rfcomm-init.d-r2 rfcomm
+
+ einstalldocs
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+
+ use udev && udev_reload
+
+ has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp."
+
+ if ! has_version sys-auth/consolekit && ! has_version sys-apps/systemd; then
+ elog "Since you don't have sys-auth/consolekit neither sys-apps/systemd, you will"
+ elog "need to add the user to the plugdev group."
+ fi
+}
diff --git a/net-wireless/bluez/bluez-5.33.ebuild b/net-wireless/bluez/bluez-5.33.ebuild
new file mode 100644
index 00000000000..a82c3c07090
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.33.ebuild
@@ -0,0 +1,209 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit autotools eutils multilib python-any-r1 readme.gentoo systemd udev user multilib-minimal
+
+DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
+HOMEPAGE="http://www.bluez.org"
+SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.xz"
+
+LICENSE="GPL-2+ LGPL-2.1+"
+SLOT="0/3"
+KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86"
+IUSE="cups debug +obex +readline selinux systemd test +udev"
+
+CDEPEND="
+ >=dev-libs/glib-2.28:2
+ >=sys-apps/dbus-1.6:=
+ >=sys-apps/hwids-20121202.2
+ cups? ( net-print/cups:= )
+ obex? ( dev-libs/libical:= )
+ readline? ( sys-libs/readline:= )
+ systemd? ( sys-apps/systemd )
+ udev? ( >=virtual/udev-172 )
+ abi_x86_32? (
+ !<app-emulation/emul-linux-x86-soundlibs-20140406-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32]
+ )
+"
+DEPEND="${CDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig
+ test? (
+ $(python_gen_any_dep '
+ >=dev-python/dbus-python-1[${PYTHON_USEDEP}]
+ || (
+ dev-python/pygobject:3[${PYTHON_USEDEP}]
+ dev-python/pygobject:2[${PYTHON_USEDEP}]
+ )
+ ')
+ )
+"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-bluetooth )
+"
+DOC_CONTENTS="
+ If you want to use rfcomm as a normal user, you need to add the user
+ to the uucp group.
+"
+
+pkg_setup() {
+ enewgroup plugdev
+ use test && python-any-r1_pkg_setup
+
+ if ! use udev; then
+ ewarn
+ ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
+ ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
+ ewarn "and hid2hci will not be available."
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # Use static group "plugdev" if there is no ConsoleKit (or systemd logind)
+ epatch "${FILESDIR}"/bluez-plugdev.patch
+
+ # Try both udevadm paths to cover udev/systemd vs. eudev locations (#539844)
+ # http://www.spinics.net/lists/linux-bluetooth/msg58739.html
+ epatch "${FILESDIR}"/bluez-udevadm-path.patch
+
+ # Fedora patches
+ # http://www.spinics.net/lists/linux-bluetooth/msg38490.html
+ epatch "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
+
+ # http://www.spinics.net/lists/linux-bluetooth/msg40136.html
+ epatch "${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
+
+ # http://www.spinics.net/lists/linux-bluetooth/msg41264.html
+ epatch "${FILESDIR}"/0002-autopair-Don-t-handle-the-iCade.patch
+
+ # ???
+ epatch "${FILESDIR}"/0004-agent-Assert-possible-infinite-loop.patch
+
+ # Ubuntu workaround for bug #501120
+ epatch "${FILESDIR}"/0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch
+
+ if use cups; then
+ sed -i \
+ -e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
+ Makefile.{in,tools} || die
+ fi
+
+ eautoreconf
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=(
+ # readline is automagic when client is enabled
+ # --enable-client always needs readline, bug #504038
+ ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
+ )
+
+ if ! multilib_is_native_abi; then
+ myconf+=(
+ # deps not used for the library
+ {DBUS,GLIB}_{CFLAGS,LIBS}=' '
+ )
+ fi
+
+ econf \
+ --localstatedir=/var \
+ --disable-android \
+ --enable-datafiles \
+ --enable-experimental \
+ --enable-optimization \
+ $(use_enable debug) \
+ --enable-pie \
+ --enable-threads \
+ --enable-library \
+ $(multilib_native_use_enable test) \
+ --enable-tools \
+ --enable-manpages \
+ --enable-monitor \
+ $(multilib_native_use_enable cups) \
+ $(multilib_native_use_enable obex) \
+ $(multilib_native_use_enable readline client) \
+ $(multilib_native_use_enable systemd) \
+ $(systemd_with_unitdir) \
+ $(multilib_native_use_enable udev) \
+ $(multilib_native_use_enable udev sixaxis)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake -f Makefile -f - libs \
+ <<<'libs: $(lib_LTLIBRARIES)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+
+ # Upstream doesn't install this, bug #524640
+ # http://permalink.gmane.org/gmane.linux.bluez.kernel/53115
+ # http://comments.gmane.org/gmane.linux.bluez.kernel/54564
+ # gatttool is only built with readline, bug #530776
+ use readline && dobin attrib/gatttool
+ dobin tools/hex2hcd
+
+ # Unittests are not that useful once installed
+ if use test ; then
+ rm -r "${ED}"/usr/$(get_libdir)/bluez/test || die
+ fi
+ else
+ emake DESTDIR="${D}" \
+ install-includeHEADERS \
+ install-libLTLIBRARIES \
+ install-pkgconfigDATA
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --modules
+
+ keepdir /var/lib/bluetooth
+
+ # Upstream don't want people to play with them
+ # But we keep installing them due to 'historical' reasons
+ insinto /etc/bluetooth
+ local d
+ for d in input network proximity; do
+ doins profiles/${d}/${d}.conf
+ done
+ doins src/main.conf
+ doins src/bluetooth.conf
+
+ newinitd "${FILESDIR}"/bluetooth-init.d-r3 bluetooth
+ newinitd "${FILESDIR}"/rfcomm-init.d-r2 rfcomm
+
+ einstalldocs
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+
+ use udev && udev_reload
+
+ has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp."
+
+ if ! has_version sys-auth/consolekit && ! has_version sys-apps/systemd; then
+ elog "Since you don't have sys-auth/consolekit neither sys-apps/systemd, you will"
+ elog "need to add the user to the plugdev group."
+ fi
+}
diff --git a/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
new file mode 100644
index 00000000000..1ea3e6f3e0c
--- /dev/null
+++ b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
@@ -0,0 +1,58 @@
+From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
+From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
+Date: Sat, 12 Oct 2013 17:45:25 +0200
+Subject: [PATCH] Allow using obexd without systemd in the user session
+
+Not all sessions run systemd --user (actually, the majority
+doesn't), so the dbus daemon must be able to spawn obexd
+directly, and to do so it needs the full path of the daemon.
+---
+ Makefile.obexd | 4 ++--
+ obexd/src/org.bluez.obex.service | 4 ----
+ obexd/src/org.bluez.obex.service.in | 4 ++++
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+ delete mode 100644 obexd/src/org.bluez.obex.service
+ create mode 100644 obexd/src/org.bluez.obex.service.in
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index 3760867..142e7c3 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -2,12 +2,12 @@
+ if SYSTEMD
+ systemduserunitdir = @SYSTEMD_USERUNITDIR@
+ systemduserunit_DATA = obexd/src/obex.service
++endif
+
+ dbussessionbusdir = @DBUS_SESSIONBUSDIR@
+ dbussessionbus_DATA = obexd/src/org.bluez.obex.service
+-endif
+
+-EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
++EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in
+
+ obex_plugindir = $(libdir)/obex/plugins
+
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service
+deleted file mode 100644
+index a538088..0000000
+--- a/obexd/src/org.bluez.obex.service
++++ /dev/null
+@@ -1,4 +0,0 @@
+-[D-BUS Service]
+-Name=org.bluez.obex
+-Exec=/bin/false
+-SystemdService=dbus-org.bluez.obex.service
+diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in
+new file mode 100644
+index 0000000..9c815f2
+--- /dev/null
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -0,0 +1,4 @@
++[D-BUS Service]
++Name=org.bluez.obex
++Exec=@libexecdir@/obexd
++SystemdService=dbus-org.bluez.obex.service
+--
+1.8.3.1
+
diff --git a/net-wireless/bluez/files/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch b/net-wireless/bluez/files/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
new file mode 100644
index 00000000000..004a3895aa0
--- /dev/null
+++ b/net-wireless/bluez/files/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
@@ -0,0 +1,38 @@
+From f7861d27fbcbc519f57d8496aa9486f487908821 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Sat, 9 Nov 2013 18:13:43 +0100
+Subject: [PATCH 1/5] obex: Use GLib helper function to manipulate paths
+
+Instead of trying to do it by hand. This also makes sure that
+relative paths aren't used by the agent.
+---
+ obexd/src/manager.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/obexd/src/manager.c b/obexd/src/manager.c
+index cec8a39..f18896e 100644
+--- a/obexd/src/manager.c
++++ b/obexd/src/manager.c
+@@ -651,14 +651,14 @@ static void agent_reply(DBusPendingCall *call, void *user_data)
+ DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_INVALID)) {
+ /* Splits folder and name */
+- const char *slash = strrchr(name, '/');
++ gboolean is_relative = !g_path_is_absolute(name);
+ DBG("Agent replied with %s", name);
+- if (!slash) {
+- agent->new_name = g_strdup(name);
++ if (is_relative) {
++ agent->new_name = g_path_get_basename(name);
+ agent->new_folder = NULL;
+ } else {
+- agent->new_name = g_strdup(slash + 1);
+- agent->new_folder = g_strndup(name, slash - name);
++ agent->new_name = g_path_get_basename(name);
++ agent->new_folder = g_path_get_dirname(name);
+ }
+ }
+
+--
+1.8.4.2
+
diff --git a/net-wireless/bluez/files/0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch b/net-wireless/bluez/files/0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch
new file mode 100644
index 00000000000..55d5af654a9
--- /dev/null
+++ b/net-wireless/bluez/files/0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch
@@ -0,0 +1,29 @@
+From aa73bf5039dfd2cf0a52dd6fd22501d955cc1a00 Mon Sep 17 00:00:00 2001
+From: Tommy <mesilliac@gmail.com>
+Date: Thu, 10 Jan 2013 09:18:43 +0100
+Subject: [PATCH] work around Logitech diNovo Edge keyboard firmware issue
+
+https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/269851
+---
+ tools/hid2hci.rules | 5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/tools/hid2hci.rules b/tools/hid2hci.rules
+index db6bb03..7db4572 100644
+--- a/tools/hid2hci.rules
++++ b/tools/hid2hci.rules
+@@ -11,7 +11,10 @@ ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProt
+ RUN+="hid2hci --method=dell --devpath=%p", ENV{HID2HCI_SWITCH}="1"
+
+ # Logitech devices
+-KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345abce]|c71[34bc]", \
++KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[5e]", \
++ RUN+="hid2hci --method=logitech-hid --devpath=%p"
++# Logitech, Inc. RAW communicating devices
++KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[34abc]|c71[34bc]", \
+ RUN+="hid2hci --method=logitech-hid --devpath=%p"
+
+ ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end"
+--
+1.8.0.1
+
diff --git a/net-wireless/bluez/files/0002-autopair-Don-t-handle-the-iCade.patch b/net-wireless/bluez/files/0002-autopair-Don-t-handle-the-iCade.patch
new file mode 100644
index 00000000000..68751ae7b60
--- /dev/null
+++ b/net-wireless/bluez/files/0002-autopair-Don-t-handle-the-iCade.patch
@@ -0,0 +1,47 @@
+From c16ae7041c7511d8d1ed8441f696716fa6a9117e Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Tue, 19 Nov 2013 14:11:39 +0100
+Subject: [PATCH 2/5] autopair: Don't handle the iCade
+
+We can't easily enter digits other than 1 through 4 (inclusive)
+so leave it up to the agent to figure out a good passcode
+for the iCade.
+
+Note that we can not use the VID/PID of the device, as it is not
+yet known at that point.
+---
+ plugins/autopair.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/plugins/autopair.c b/plugins/autopair.c
+index 8c98c12..5d2f6f7 100644
+--- a/plugins/autopair.c
++++ b/plugins/autopair.c
+@@ -57,13 +57,23 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
+ {
+ char addr[18];
+ char pinstr[7];
++ char name[25];
+ uint32_t class;
+
+ ba2str(device_get_address(device), addr);
+
+ class = btd_device_get_class(device);
+
+- DBG("device %s 0x%x", addr, class);
++ device_get_name(device, name, sizeof(name));
++ name[sizeof(name) - 1] = 0;
++
++ DBG("device %s (%s) 0x%x", addr, name, class);
++
++ g_message ("vendor 0x%X product: 0x%X", btd_device_get_vendor (device), btd_device_get_product (device));
++
++ /* The iCade shouldn't use random PINs like normal keyboards */
++ if (name != NULL && strstr(name, "iCade") != NULL)
++ return 0;
+
+ /* This is a class-based pincode guesser. Ignore devices with an
+ * unknown class.
+--
+1.8.4.2
+
diff --git a/net-wireless/bluez/files/0004-agent-Assert-possible-infinite-loop.patch b/net-wireless/bluez/files/0004-agent-Assert-possible-infinite-loop.patch
new file mode 100644
index 00000000000..2746e0cdd2c
--- /dev/null
+++ b/net-wireless/bluez/files/0004-agent-Assert-possible-infinite-loop.patch
@@ -0,0 +1,25 @@
+From 67e5477687a2753d3f7b300bcfdc74464d8ad41f Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Mon, 9 Dec 2013 18:04:56 +0100
+Subject: [PATCH 4/5] agent: Assert possible infinite loop
+
+---
+ src/agent.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/agent.c b/src/agent.c
+index bcba969..b292881 100644
+--- a/src/agent.c
++++ b/src/agent.c
+@@ -203,6 +203,8 @@ void agent_unref(struct agent *agent)
+ if (agent->ref > 0)
+ return;
+
++ g_assert (agent->ref == 0);
++
+ if (agent->request) {
+ DBusError err;
+ agent_pincode_cb pincode_cb;
+--
+1.8.4.2
+
diff --git a/net-wireless/bluez/files/bluetooth-init.d-r2 b/net-wireless/bluez/files/bluetooth-init.d-r2
new file mode 100644
index 00000000000..7975cb558d0
--- /dev/null
+++ b/net-wireless/bluez/files/bluetooth-init.d-r2
@@ -0,0 +1,21 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ after coldplug
+ need dbus localmount hostname
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/sbin/bluetoothd
+ eend $?
+}
+
+stop() {
+ ebegin "Shutting down ${SVCNAME}"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/bluetoothd
+ eend $?
+}
diff --git a/net-wireless/bluez/files/bluetooth-init.d-r3 b/net-wireless/bluez/files/bluetooth-init.d-r3
new file mode 100644
index 00000000000..3b9569ee737
--- /dev/null
+++ b/net-wireless/bluez/files/bluetooth-init.d-r3
@@ -0,0 +1,21 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ after coldplug
+ need dbus localmount hostname
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --background --exec /usr/libexec/bluetooth/bluetoothd
+ eend $?
+}
+
+stop() {
+ ebegin "Shutting down ${SVCNAME}"
+ start-stop-daemon --stop --quiet --exec /usr/libexec/bluetooth/bluetoothd
+ eend $?
+}
diff --git a/net-wireless/bluez/files/bluez-plugdev.patch b/net-wireless/bluez/files/bluez-plugdev.patch
new file mode 100755
index 00000000000..726838a5132
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-plugdev.patch
@@ -0,0 +1,14 @@
+diff -Nurp bluez-4.39.orig/src/bluetooth.conf bluez-4.39/src/bluetooth.conf
+--- bluez-4.39.orig/src/bluetooth.conf 2008-12-20 20:18:10.000000000 +0100
++++ bluez-4.39/src/bluetooth.conf 2009-09-05 13:30:34.411581498 +0200
+@@ -17,6 +17,10 @@
+ <allow send_destination="org.bluez"/>
+ </policy>
+
++ <policy group="plugdev">
++ <allow send_destination="org.bluez"/>
++ </policy>
++
+ <policy context="default">
+ <deny send_destination="org.bluez"/>
+ </policy>
diff --git a/net-wireless/bluez/files/bluez-udevadm-path.patch b/net-wireless/bluez/files/bluez-udevadm-path.patch
new file mode 100644
index 00000000000..a29193ebb19
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-udevadm-path.patch
@@ -0,0 +1,10 @@
+--- tools/hid2hci.rules~ 2012-12-24 18:46:55.000000000 +0100
++++ tools/hid2hci.rules 2015-04-04 13:13:29.360300000 +0200
+@@ -20,6 +20,7 @@
+ # Unfortunately the only event seen is the BT device disappearing, so the mouse
+ # device needs to be chased down on the USB bus.
+ ATTR{bDeviceClass}=="e0", ATTR{bDeviceSubClass}=="01", ATTR{bDeviceProtocol}=="01", ATTR{idVendor}=="413c", \
++ ENV{REMOVE_CMD}="/usr/bin/udevadm trigger --action=change --subsystem-match=usb --property-match=HID2HCI_SWITCH=1" \
+ ENV{REMOVE_CMD}="/sbin/udevadm trigger --action=change --subsystem-match=usb --property-match=HID2HCI_SWITCH=1"
+
+ # CSR devices
diff --git a/net-wireless/bluez/files/rfcomm-conf.d b/net-wireless/bluez/files/rfcomm-conf.d
new file mode 100644
index 00000000000..d87acdb282e
--- /dev/null
+++ b/net-wireless/bluez/files/rfcomm-conf.d
@@ -0,0 +1,5 @@
+# Bind rfcomm devices (allowed values are "true" and "false")
+RFCOMM_ENABLE=true
+
+# Config file for rfcomm
+RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf"
diff --git a/net-wireless/bluez/files/rfcomm-init.d b/net-wireless/bluez/files/rfcomm-init.d
new file mode 100644
index 00000000000..f2f737824cf
--- /dev/null
+++ b/net-wireless/bluez/files/rfcomm-init.d
@@ -0,0 +1,27 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ after coldplug
+ need dbus localmount hostname
+}
+
+start() {
+ if [ "${RFCOMM_ENABLE}" = "true" -a -x /usr/bin/rfcomm ]; then
+ if [ -f "${RFCOMM_CONFIG}" ]; then
+ ebegin "Starting rfcomm"
+ /usr/bin/rfcomm -f "${RFCOMM_CONFIG}" bind all
+ eend $?
+ else
+ ewarn "Not enabling rfcomm because RFCOMM_CONFIG does not exists"
+ fi
+ fi
+}
+
+stop() {
+ ebegin "Shutting down rfcomm"
+ /usr/bin/rfcomm release all
+ eend $?
+}
diff --git a/net-wireless/bluez/files/rfcomm-init.d-r2 b/net-wireless/bluez/files/rfcomm-init.d-r2
new file mode 100755
index 00000000000..4a91916919c
--- /dev/null
+++ b/net-wireless/bluez/files/rfcomm-init.d-r2
@@ -0,0 +1,35 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need bluetooth
+}
+
+checkconfig() {
+ if [ -z "${ADDRESS}" ]; then
+ eerror "ADDRESS must be set"
+ return 1
+ fi
+
+ return 0
+}
+
+start() {
+ local DEVICE=${RC_SVCNAME#*.}
+
+ checkconfig || return 1
+
+ ebegin "Starting ${RC_SVCNAME}"
+ rfcomm bind "${DEVICE}" "${ADDRESS}" ${CHANNEL}
+ eend $?
+}
+
+stop() {
+ local DEVICE=${RC_SVCNAME#*.}
+
+ ebegin "Shutting down ${RC_SVCNAME}"
+ rfcomm release "${DEVICE}"
+ eend $?
+}
diff --git a/net-wireless/bluez/metadata.xml b/net-wireless/bluez/metadata.xml
new file mode 100644
index 00000000000..de19c8b5539
--- /dev/null
+++ b/net-wireless/bluez/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>pacho@gentoo.org</email>
+ <name>Pacho Ramos</name>
+ </maintainer>
+ <use>
+ <flag name="test-programs">Install tools for testing of
+ various Bluetooth functions</flag>
+ <flag name="hid2hci">The HID proxying makes the keyboard / mouse show up
+ as regular USB HID devices, but needs them to be
+ paired before enabling this, otherwise they won't be
+ detected</flag>
+ <flag name="obex">Enable OBEX transfer support.</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:bluez:bluez</remote-id>
+ <remote-id type="cpe">cpe:/a:bluez:bluez-libs</remote-id>
+ </upstream>
+</pkgmetadata>