jobextra/bluez/PKGBUILD-split-5.73-03
2024-03-15 20:49:16 +02:00

214 lines
9.1 KiB
Bash

#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgbase=bluez
pkgname=('bluez' 'bluez-utils' 'bluez-libs' 'bluez-cups' 'bluez-deprecated-tools' 'bluez-hid2hci' 'bluez-mesh' 'bluez-obex')
pkgver=5.73
pkgrel=03
url="http://www.bluez.org/"
# options=('debug') ### uncomment this to have the debug pkgs produced
makedepends=('glibc' 'dbus' 'libical' 'alsa-lib' 'json-c' 'ell' 'python-docutils' 'python-pygments')
source=(https://www.kernel.org/pub/linux/bluetooth/${pkgname}-${pkgver}.tar.{xz,sign}
bluetooth.modprobe)
#https://gitlab.archlinux.org/archlinux/packaging/packages/bluez/-/issues/2
# see https://www.kernel.org/pub/linux/bluetooth/sha256sums.asc
prepare() {
cd $pkgname-$pkgver
# fix autoconnection - https://github.com/bluez/bluez/issues/686
# https://github.com/tedd-an/bluez-upstream-test/pull/484
# patch -Np1 -i ../fix-bluez-5.71-autoconnection.diff
# fix coredump on a2dp suspend - https://gitlab.archlinux.org/archlinux/packaging/packages/bluez/-/issues/3
# https://lore.kernel.org/linux-bluetooth/20231219124916.44173-2-vlad.pruteanu@nxp.com/
# patch -Np1 -i ../fix-bluez-5.71-coredump-on-a2dp-suspend.diff
}
build() {
cd $pkgname-$pkgver
./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--sysconfdir=/etc \
--localstatedir=/var \
--libexecdir=/usr/lib \
--with-dbusconfdir=/usr/share \
--with-udevdir=/usr/lib/udev \
--enable-btpclient \
--enable-midi \
--enable-sixaxis \
--disable-systemd \
--enable-mesh \
--enable-hid2hci \
--enable-experimental \
--enable-datafiles \
--enable-library \
--enable-deprecated # libraries and these tools are deprecated
make
# fake installation to be seperated into packages
make DESTDIR="${srcdir}/fakeinstall" install
# add missing tools FS#41132, FS#41687, FS#42716
for files in `find tools/ -type f -perm -755`; do
filename=$(basename $files)
install -Dm755 "${srcdir}"/"${pkgbase}"-${pkgver}/tools/$filename "${srcdir}/fakeinstall"/usr/bin/$filename
done
}
_install() {
local src f dir
for src; do
f="${src#fakeinstall/}"
dir="${pkgdir}/${f%/*}"
install -m755 -d "${dir}"
# use copy so a new file is created and fakeroot can track properties such as setuid
cp -av "${src}" "${dir}/"
rm -rf "${src}"
done
}
check() {
cd $pkgname-$pkgver
# fails test-vcp due to lto - https://github.com/bluez/bluez/issues/683
make check || /bin/true
}
package_bluez() {
pkgdesc="Daemons for the bluetooth protocol stack w/o systemd"
depends=('glibc' 'dbus' 'glib2' 'alsa-lib')
backup=(etc/bluetooth/{main,input,network}.conf)
# conflicts=('obexd-client' 'obexd-server')
_install fakeinstall/usr/lib/bluetooth/bluetoothd
# _install fakeinstall/usr/lib/systemd/system/bluetooth.service
# _install fakeinstall/usr/share/dbus-1/system-services/org.bluez.service
# _install fakeinstall/usr/share/dbus-1/system.d/bluetooth.conf
# _install fakeinstall/etc/bluetooth/main.conf
# _install fakeinstall/etc/bluetooth/input.conf
# _install fakeinstall/etc/bluetooth/network.conf
_install fakeinstall/usr/share/man/man8/bluetoothd.8
# ship upstream main config files
install -dm555 "${pkgdir}"/etc/bluetooth
install -Dm644 "${srcdir}"/"${pkgbase}"-${pkgver}/src/main.conf "${pkgdir}"/etc/bluetooth/main.conf
install -Dm644 "${srcdir}"/"${pkgbase}"-${pkgver}/profiles/input/input.conf "${pkgdir}"/etc/bluetooth/input.conf
install -Dm644 "${srcdir}"/"${pkgbase}"-${pkgver}/profiles/network/network.conf "${pkgdir}"/etc/bluetooth/network.conf
# add basic documention
install -dm755 "${pkgdir}"/usr/share/doc/"${pkgbase}"/dbus-apis
cp -a "${pkgbase}"-${pkgver}/doc/*.txt "${pkgdir}"/usr/share/doc/"${pkgbase}"/dbus-apis/
# fix module loading errors
install -dm755 "${pkgdir}"/usr/lib/modprobe.d
install -Dm644 "${srcdir}"/bluetooth.modprobe "${pkgdir}"/usr/lib/modprobe.d/bluetooth-usb.conf
# load module at system start required by some functions
# https://bugzilla.kernel.org/show_bug.cgi?id=196621
install -dm755 "$pkgdir"/usr/lib/modules-load.d
echo "crypto_user" > "$pkgdir"/usr/lib/modules-load.d/bluez.conf
}
package_bluez-utils() {
pkgdesc="Development and debugging utilities for the bluetooth protocol stack w/o systemd"
depends=('glibc' 'dbus' 'glib2' 'readline')
optdepends=('ell: for btpclient')
provides=('bluez-plugins')
replaces=('bluez-plugins')
_install fakeinstall/usr/bin/{advtest,amptest,avinfo,avtest,bcmfw,bdaddr,bluemoon,bluetoothctl,bluetooth-player,bneptest,btattach,btconfig,btgatt-client,btgatt-server,btinfo,btiotest,btmgmt,btmon,btpclient,btpclientctl,btproxy,btsnoop,check-selftest,cltest,create-image,eddystone,gatt-service,hcieventmask,hcisecfilter,hex2hcd,hid2hci,hwdb,ibeacon,isotest,l2ping,l2test,mcaptest,mpris-proxy,nokfw,oobtest,rctest,rtlfw,scotest,seq2bseq,test-runner}
_install fakeinstall/usr/share/man/man1/bluetoothctl*.1
_install fakeinstall/usr/share/man/man1/{btattach,btmgmt,btmon,isotest,l2ping,rctest}.1
_install fakeinstall/usr/share/man/man5/org.bluez.{A,B,D,G,I,L,M,N,P}*.5
_install fakeinstall/usr/share/zsh/site-functions/_bluetoothctl
}
package_bluez-deprecated-tools() {
pkgdesc="Deprecated tools that are no longer maintained w/o systemd"
depends=('json-c' 'glib2' 'dbus' 'readline' 'glibc')
_install fakeinstall/usr/bin/{ciptool,hciattach,hciconfig,hcidump,hcitool,meshctl,rfcomm,sdptool}
_install fakeinstall/usr/share/man/man1/{ciptool,hciattach,hciconfig,hcidump,hcitool,rfcomm,sdptool}.1
}
package_bluez-libs() {
pkgdesc="Deprecated libraries for the bluetooth protocol stack"
depends=('glibc')
provides=('libbluetooth.so')
license=('LGPL-2.1-only')
_install fakeinstall/usr/include/bluetooth/*
_install fakeinstall/usr/lib/libbluetooth.so*
_install fakeinstall/usr/lib/pkgconfig/*
}
package_bluez-cups() {
pkgdesc="CUPS printer backend for Bluetooth printers"
depends=('cups' 'glib2' 'glibc' 'dbus')
_install fakeinstall/usr/lib/cups/backend/bluetooth
}
package_bluez-hid2hci() {
pkgdesc="Put HID proxying bluetooth HCI's into HCI mode w/o systemd"
depends=('glibc')
_install fakeinstall/usr/lib/udev/*
_install fakeinstall/usr/share/man/man1/hid2hci.1
}
package_bluez-mesh() {
pkgdesc="Services for bluetooth mesh w/o systemd"
depends=('glibc' 'json-c' 'readline' )
backup=('etc/bluetooth/mesh-main.conf')
_install fakeinstall/usr/bin/{mesh-cfgclient,mesh-cfgtest}
_install fakeinstall/usr/lib/bluetooth/bluetooth-meshd
# _install fakeinstall/usr/lib/systemd/system/bluetooth-mesh.service
# _install fakeinstall/usr/share/dbus-1/system-services/org.bluez.mesh.service
# _install fakeinstall/usr/share/dbus-1/system.d/bluetooth-mesh.conf
_install fakeinstall/usr/share/man/man8/bluetooth-meshd.8
# ship upstream mesh config file
install -dm755 "${pkgdir}"/etc/bluetooth
install -Dm644 "${srcdir}"/"${pkgbase}"-${pkgver}/mesh/mesh-main.conf "${pkgdir}"/etc/bluetooth/mesh-main.conf
}
package_bluez-obex() {
pkgdesc="Object Exchange daemon for sharing content w/o systemd"
depends=('glib2' 'libical' 'dbus' 'readline' 'glibc')
_install fakeinstall/usr/bin/{obexctl,obex-client-tool,obex-server-tool}
_install fakeinstall/usr/lib/bluetooth/obexd
# _install fakeinstall/usr/lib/systemd/user/obex.service
# _install fakeinstall/usr/share/dbus-1/services/org.bluez.obex.service
_install fakeinstall/usr/share/man/man5/org.bluez.obex*.5
# make sure there are no files left to install
rm fakeinstall/usr/lib/libbluetooth.la
# rm fakeinstall/etc/bluetooth
# find fakeinstall -depth -print0 | xargs -0 rmdir
}
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
license=('GPL2')
validpgpkeys=('E932D120BC2AEC444E558F0106CA9F5D1DCF2659') # Marcel Holtmann <marcel@holtmann.org>
sha256sums=(257e9075ce05c70d48c5defd254e78c418416f7584b45f9dddc884ff88e3fc53 # bluez-5.73.tar.xz
c3e20e079e299a6fb384f30980e5dd9d014c8cbd87f9466eab5a204899433576 # bluez-5.73.tar.sign
46c021be659c9a1c4e55afd04df0c059af1f3d98a96338236412e449bf7477b4) # bluetooth.modprobe
## b56d78b7fa857c6fad8417e08872a81ddeb230b63bcee252d1e09ed2b75669df bluez-5.73-03-x86_64.pkg.tar.lz
## 6ba4142b0a8c9ca697c92a184ec14678e3f285325999a6387d4f567959d4cb4c bluez-cups-5.73-03-x86_64.pkg.tar.lz
## 5f36283303461609da14dc1f5d0e5e33987b015c4335f98db46730ff6d7f5e5b bluez-deprecated-tools-5.73-03-x86_64.pkg.tar.lz
## 0c0c2b59d53f57464dffbcccba28cbe38cf7046a0af999e9b6db6dae73ab6b30 bluez-hid2hci-5.73-03-x86_64.pkg.tar.lz
## 9fa78e3fad7681dfa4890d9bb813b6a605ca5271075ee3103355f6b4f484eee2 bluez-libs-5.73-03-x86_64.pkg.tar.lz
## 0f5898cf97f028c1f6efd21425a926636eb9322d6b4515603b02d5b02f0614de bluez-mesh-5.73-03-x86_64.pkg.tar.lz
## 831489c0e435833ab27565d909c8316b1c24eaae5d11fec4ad783ee190990dbd bluez-obex-5.73-03-x86_64.pkg.tar.lz
## 253d950e2697b13754dbe94f1f741e90838159658f1e0f376cb80d204ad80106 bluez-utils-5.73-03-x86_64.pkg.tar.lz