summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/bluez5/APKBUILD75
-rw-r--r--main/bluez5/bluetooth.initd25
-rw-r--r--main/bluez5/rfcomm.confd5
-rw-r--r--main/bluez5/rfcomm.initd27
4 files changed, 132 insertions, 0 deletions
diff --git a/main/bluez5/APKBUILD b/main/bluez5/APKBUILD
new file mode 100644
index 000000000..f59c31a99
--- /dev/null
+++ b/main/bluez5/APKBUILD
@@ -0,0 +1,75 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=bluez5
+pkgver=5.9
+pkgrel=0
+pkgdesc="Tools for the Bluetooth protocol stack"
+url="http://www.bluez.org/"
+arch="all"
+license="GPL2"
+depends="consolekit dbus"
+replaces="udev"
+makedepends="dbus-dev libusb-compat-dev udev-dev
+ libical-dev readline-dev glib-dev"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-libs $pkgname-cups
+ $pkgname-hid2hci"
+source="http://www.kernel.org/pub/linux/bluetooth/bluez-$pkgver.tar.bz2
+ bluetooth.initd
+ rfcomm.initd
+ rfcomm.confd
+ "
+
+_builddir="$srcdir"/bluez-$pkgver
+build() {
+ cd "$_builddir"
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --libexecdir=/usr/lib \
+ --mandir=/usr/share/man \
+ --disable-systemd \
+ --enable-library \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make install DESTDIR="$pkgdir" || return 1
+ rm "$pkgdir"/usr/lib/*.la || return 1
+ install -Dm755 "$srcdir"/bluetooth.initd "$pkgdir"/etc/init.d/bluetooth
+ install -Dm755 "$srcdir"/rfcomm.initd "$pkgdir"/etc/init.d/rfcomm
+ install -Dm644 "$srcdir"/rfcomm.confd "$pkgdir"/etc/conf.d/rfcomm
+ install -Dm755 test/simple-agent "$pkgdir"/usr/bin/bluez-simple-agent
+}
+
+libs() {
+ pkgdesc="Libraries for Bluetooth protocol stack"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libbluetooth.so.* "$subpkgdir"/usr/lib/
+}
+
+cups() {
+ pkgdesc="Bluez backend for CUPS"
+ mkdir -p "$subpkgdir"/usr/lib/
+ mv "$pkgdir"/usr/lib/cups "$subpkgdir"/usr/lib/
+}
+
+hid2hci() {
+ pkgdesc="Put HID proxying bluetooth HCI's into HCI mode"
+ replaces="bluez"
+ mkdir -p "$subpkgdir"
+ mv "$pkgdir"/lib "$subpkgdir"/
+}
+
+md5sums="6edaf60d09ee32942a739f80ea847db1 bluez-5.9.tar.bz2
+7a5611fa2cf42da2e844f96b2efa9f3b bluetooth.initd
+7672edb8e33c4495ee9febb9864feb10 rfcomm.initd
+7f4bb093adb0f519c621f2ea68712f35 rfcomm.confd"
+sha256sums="40a408bc535c19ac544895cfa24984659d8e338e58c729fb3ed8c4634e7c23ac bluez-5.9.tar.bz2
+d4aef203e184bef4284b3719268c91e07a1e3f84cbdea2ac8ab40a2617ac9186 bluetooth.initd
+4430703a9bec9a9482416b2d24aa47492264768a0b61356b361bbc8b1229a83e rfcomm.initd
+672498957049fd301f9c9c1dc9fa49430e5e6d3c3f1f3cdce80df3af7d425d08 rfcomm.confd"
+sha512sums="025d7b8c688c16d13e33f803c339f0c64b1247df43ed483dba31a62fe3521c5bec24a4516a7c13304492c632ed413638c0d308333ceedeaed31a92f8cdb3204b bluez-5.9.tar.bz2
+2c13cde6561c5aa8b2f27306851458966c67853f6ac2358d09019fda14d3d8e3ff6d9f1c90512c67063d1e1954ec05bf117c5fafc7716446cc5786e9cc12c49f bluetooth.initd
+8f14b4e05c9ecaf4586ed2fdc2d2519de6b613de62ae5c95508baa682630f3112c5b6db6850f76679afc49e06f2ad035d148fa30b9b980747b6fb423f7bebe88 rfcomm.initd
+a70aa0dbbabe7e29ee81540a6f98bf191a850da55a28f678975635caf34b363cf4d461a801b3484120ee28fdd21240bd456a4f5d706262700924bd2e9a0972fb rfcomm.confd"
diff --git a/main/bluez5/bluetooth.initd b/main/bluez5/bluetooth.initd
new file mode 100644
index 000000000..a3eab5628
--- /dev/null
+++ b/main/bluez5/bluetooth.initd
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+
+name="Bluetooth"
+command="/usr/lib/bluetooth/bluetoothd"
+pidfile="/var/run/bluetoothd.pid"
+start_stop_daemon_args="--background --make-pidfile"
+
+
+depend() {
+ after coldplug
+ need dbus localmount
+}
+
+start_post() {
+ local adapter
+ eindent
+ for adapter in $AUTO_ENABLE; do
+ ebegin "Enabling $adapter"
+ hciconfig $adapter up
+ eend
+ done
+ eoutdent
+ return 0
+}
+
diff --git a/main/bluez5/rfcomm.confd b/main/bluez5/rfcomm.confd
new file mode 100644
index 000000000..d87acdb28
--- /dev/null
+++ b/main/bluez5/rfcomm.confd
@@ -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/main/bluez5/rfcomm.initd b/main/bluez5/rfcomm.initd
new file mode 100644
index 000000000..d3b819e1a
--- /dev/null
+++ b/main/bluez5/rfcomm.initd
@@ -0,0 +1,27 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/files/rfcomm-init.d,v 1.1 2011/12/31 21:09:18 pacho Exp $
+
+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 $?
+}