#!/usr/bin/make -f
# build rules for bluez-utils

include /usr/share/cdbs/1/rules/buildcore.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/class/autotools.mk

DEB_UPDATE_RCD_PARAMS = "start 25 2 3 4 5 . stop 74 0 1 6 ."

DEB_CONFIGURE_EXTRA_FLAGS := --enable-test --enable-bccmd --enable-glib --disable-usb \
				--disable-sdpd --disable-hid2hci --disable-echo --disable-input

ifneq (,$(findstring thumb,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -mthumb
	CXXFLAGS += -mthumb
endif

post-patches::
	./bootstrap

install/bluez-utils::
	mv $(DEB_DESTDIR)/usr/share/man/man1/l2ping.1 \
		$(DEB_DESTDIR)/usr/share/man/man8/l2ping.8

	# lintian override
	install -D -m 0644 debian/lintian-overrides \
		$(DEB_DESTDIR)/usr/share/lintian/overrides/bluez-utils

	install -D -m 0644 audio/headset.service \
		$(DEB_DESTDIR)/etc/bluetooth/headset.service

	install -D -m 0755 audio/bluetoothd-service-headset \
		$(DEB_DESTDIR)/usr/lib/bluetooth/bluetoothd-service-headset
