# $Id$ PNAME="bluez" PVER="5.51" PBUILD="r1" SPLIT_PACKAGES="bluez-libs bluez bluez-cups bluez-utils bluez-hid2hci bluez-plugins" PCAT="net-wlan" HOMEPAGE="http://www.bluez.org/" DBUS_DEPEND=">= sys-apps/dbus-1.10" UDEV_DEPEND=">= sys-fs/udev-242" GLIB_DEPEND=">= dev-libs/glib2-2.62" LIB_DEPEND=">= virtual/glibc" BLUEZ_DEPEND="${GLIB_DEPEND} ${DBUS_DEPEND} >= dev-libs/libical-1" UTILS_DEPEND="${GLIB_DEPEND} ${DBUS_DEPEND} ${UDEV_DEPEND} >= sys-libs/readline-8.0" HID_DEPEND="${UDEV_DEPEND}" PLUGINS_DEPEND="${UDEV_DEPEND}" CUPS_DEPEND="${GLIB_DEPEND} ${DBUS_DEPEND} >= net-print/cups-2.3" SDEPEND="${LIB_DEPEND} ${BLUEZ_DEPEND} ${CUPS_DEPEND} ${UTILS_DEPEND} ${HID_DEPEND} ${PLUGINS_DEPEND} >= dev-util/pkgconfig-0.25" SRCFILE="${PNAME}-${PVER}.tar.xz" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" sminclude mtools multilib mbuild udev systemd cleanutils SRC_URI=( http://www.kernel.org/pub/linux/bluetooth/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/bluetooth.modprobe ) UP2DATE="updatecmd http://www.kernel.org/pub/linux/bluetooth/ | grep ${PNAME}-[0-9] | highesttarball xz" split_info_bluez-libs() { DESCRIPTION="Libraries for the Bluetooth protocol stack." DEPEND="${LIB_DEPEND}" } split_info_bluez() { DESCRIPTION="Daemon and tools for the Bluetooth protocol stack." DEPEND=">= net-wlan/bluez-libs-${PVER} ${BLUEZ_DEPEND}" } split_info_bluez-cups() { DESCRIPTION="CUPS backend for Bluetooth printers." DEPEND=">= net-wlan/bluez-${PVER} ${CUPS_DEPEND}" } split_info_bluez-utils() { DESCRIPTION="Development and debugging utilities for the bluetooth protocol stack." DEPEND=">= net-wlan/bluez-${PVER} ${UTILS_DEPEND}" } split_info_bluez-hid2hci() { DESCRIPTION="CUPS backend for Bluetooth printers." DEPEND=">= net-wlan/bluez-${PVER} ${HID_DEPEND}" } split_info_bluez-plugins() { DESCRIPTION="bluez plugins (like support for the PS3 Sixaxis controller)." DEPEND=">= net-wlan/bluez-${PVER} ${PLUGINS_DEPEND}" } src_compile() { mconfigure \ --libexecdir=/usr/$(mlibdir) \ --localstatedir=/var \ --disable-debug \ --disable-test \ --enable-pie \ --enable-threads \ --enable-library \ --enable-tools \ --enable-monitor \ --enable-client \ --enable-cups \ --enable-obex \ --enable-systemd \ --enable-sixaxis \ || die mmake || die } src_install_bluez-libs() { mmake DESTDIR=${BINDIR} install-libLTLIBRARIES || die mmake DESTDIR=${BINDIR} install-pkgincludeHEADERS || die mmake DESTDIR=${BINDIR} install-pkgconfigDATA || die } src_install_bluez() { mmake DESTDIR=${BINDIR} install-pkglibexecPROGRAMS || die mmake DESTDIR=${BINDIR} install-systemdsystemunitDATA || die mmake DESTDIR=${BINDIR} install-systemduserunitDATA || die mmake DESTDIR=${BINDIR} install-dbussessionbusDATA || die mmake DESTDIR=${BINDIR} install-dbussystembusDATA || die mmake DESTDIR=${BINDIR} install-dbusDATA || die mmake DESTDIR=${BINDIR} install-man8 || die # config minstalldir /etc/bluetooth || die minstallfile src/main.conf /etc/bluetooth || die minstallfile profiles/input/input.conf /etc/bluetooth || die minstallfile profiles/network/network.conf /etc/bluetooth || die #minstallfile profiles/proximity/proximity.conf /etc/bluetooth || die # modprobe config minstalldir /etc/modprobe.d || die minstallfile -s bluetooth.modprobe /etc/modprobe.d/bluetooth.conf || die # load modules at system start required by some functions minstalldir /etc/modules-load.d || die echo "crypto_user" > /etc/modules-load.d/bluez.conf || die # fix obex file transfer, required by some pkgs mlink $(mget-systemd-unit-dir)/obex.service $(mget-systemd-unit-dir)/dbus-org.bluez.obex.service || die minstalldocs AUTHORS ChangeLog README || die } src_install_bluez-cups() { mmake DESTDIR=${BINDIR} install-cupsPROGRAMS || die } src_install_bluez-utils() { mmake DESTDIR=${BINDIR} install-binPROGRAMS || die mmake DESTDIR=${BINDIR} install-man1 || die # provided by hid2hci package mdelete /usr/share/man/man1/hid2hci.1 || die # provided by lib package #mmake DESTDIR=${BINDIR} uninstall-libLTLIBRARIES || die mdelete -r /usr/$(mlibdir) | die } src_install_bluez-hid2hci() { mmake DESTDIR=${BINDIR} install-udevPROGRAMS || die mmake DESTDIR=${BINDIR} install-rulesDATA || die minstallman tools/hid2hci.1 || die } src_install_bluez-plugins() { mmake DESTDIR=${BINDIR} install-pluginLTLIBRARIES || die } postinstall_bluez() { # reload dbus mreloadunit dbus.service # start bluetooth service mstartunit bluetooth.service } postinstall_bluez-hid2hci() { if [[ ${MAGE_BOOTSTRAP} != true ]] && [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] then # reload udev-rules udevadm control --reload-rules udevadm trigger --subsystem-match=usb fi } postremove_bluez() { # stop bluetooth service mstopunit bluetooth.service # reload dbus mreloadunit dbus.service }