| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto |
| 6 |
CONFIGURE_FLAGS := \ |
| 7 |
--with-dbusconfdir=/usr/share \ |
| 8 |
--enable-static \ |
| 9 |
--enable-tools \ |
| 10 |
--enable-cups \ |
| 11 |
--enable-mesh \ |
| 12 |
--enable-midi \ |
| 13 |
--enable-datafiles \ |
| 14 |
--enable-threads \ |
| 15 |
--enable-backtrace \ |
| 16 |
--enable-debug \ |
| 17 |
--enable-library \ |
| 18 |
--enable-test \ |
| 19 |
--enable-nfc \ |
| 20 |
--enable-monitor \ |
| 21 |
--enable-udev \ |
| 22 |
--enable-obex \ |
| 23 |
--enable-client \ |
| 24 |
--enable-testing \ |
| 25 |
--enable-systemd \ |
| 26 |
--enable-threads \ |
| 27 |
--enable-sixaxis \ |
| 28 |
--enable-deprecated \ |
| 29 |
--enable-health \ |
| 30 |
--enable-hid2hci \ |
| 31 |
--enable-external-ell \ |
| 32 |
--enable-experimental |
| 33 |
|
| 34 |
DEB_CFLAGS_MAINT_APPEND += -DFIRMWARE_DIR=/lib/firmware |
| 35 |
export DEB_CFLAGS_MAINT_APPEND |
| 36 |
|
| 37 |
ifeq (,$(filter pkg.bluez.noeds,$(DEB_BUILD_PROFILES))) |
| 38 |
|
| 39 |
ifeq (,$(filter $(DEB_HOST_ARCH),i386)) |
| 40 |
CONFIGURE_FLAGS += --with-phonebook=ebook |
| 41 |
endif |
| 42 |
endif |
| 43 |
|
| 44 |
ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes) $(DEB_HOST_ARCH), yes i386) |
| 45 |
skip_packages = -Nbluez-cups |
| 46 |
endif |
| 47 |
|
| 48 |
export deb_systemdsystemunitdir = $(shell pkg-config --variable=systemdsystemunitdir systemd | sed s,^/,,) |
| 49 |
export deb_udevdir = $(shell pkg-config --variable=udevdir udev | sed s,^/,,) |
| 50 |
|
| 51 |
%: |
| 52 |
dh $@ --exclude=.la |
| 53 |
|
| 54 |
execute_before_dh_install: |
| 55 |
|
| 56 |
|
| 57 |
rm -rf debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/bluez |
| 58 |
|
| 59 |
override_dh_auto_configure: |
| 60 |
dh_auto_configure -- $(CONFIGURE_FLAGS) |
| 61 |
|
| 62 |
override_dh_installinit: |
| 63 |
dh_installinit -pbluez --name=bluetooth --restart-after-upgrade |
| 64 |
|
| 65 |
override_dh_installsystemd: |
| 66 |
dh_installsystemd -pbluez --name=bluetooth bluetooth.service |
| 67 |
|
| 68 |
override_dh_auto_test: |
| 69 |
|
| 70 |
|
| 71 |
override_dh_builddeb: |
| 72 |
dh_builddeb ${skip_packages} |
| 73 |
|
| 74 |
override_dh_gencontrol: |
| 75 |
dh_gencontrol ${skip_packages} |
| 76 |
|
| 77 |
execute_after_dh_fixperms-indep: |
| 78 |
ifneq ($(filter bluez-test-scripts,$(shell dh_listpackages)),) |
| 79 |
chmod 0644 debian/bluez-test-scripts/usr/share/doc/bluez-test-scripts/examples/* |
| 80 |
endif |
| 81 |
|
| 82 |
override_dh_auto_install-indep: build_bluez-source |
| 83 |
BUILDDIRSOURCE := $(shell pwd)/debian/tmp-source/bluez-source |
| 84 |
build_bluez-source: |
| 85 |
install -d debian/bluez-source/usr/src |
| 86 |
mkdir -p $(BUILDDIRSOURCE) |
| 87 |
tar --exclude debian --exclude .git --exclude .pc \ |
| 88 |
--exclude autom4te.cache \ |
| 89 |
--exclude config.log \ |
| 90 |
--exclude config.status \ |
| 91 |
--exclude Makefile \ |
| 92 |
--exclude libtool \ |
| 93 |
-cf - . | (cd $(BUILDDIRSOURCE) && tar -xf -) |
| 94 |
cd $(dir $(BUILDDIRSOURCE)) \ |
| 95 |
&& tar --sort=name \ |
| 96 |
--mtime="@${SOURCE_DATE_EPOCH}" \ |
| 97 |
--owner=0 --group=0 --numeric-owner \ |
| 98 |
--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \ |
| 99 |
-cjf $(shell pwd)/debian/bluez-source/usr/src/bluez.tar.bz2 \ |
| 100 |
$(notdir $(BUILDDIRSOURCE)) |