File: rules

package info (click to toggle)
ubertooth 2015.09.R2-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,772 kB
  • ctags: 5,253
  • sloc: ansic: 15,768; cpp: 2,294; python: 527; makefile: 457; asm: 113; perl: 86; sh: 62; ruby: 43
file content (63 lines) | stat: -rwxr-xr-x 2,342 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

SOURCE_DATE ?= $(shell dpkg-parsechangelog --show-field Date)
SOURCE_DATE_UTC ?= $(shell LC_ALL=C date -u -d "$(SOURCE_DATE)")
CHANGELOG_DATE ?= $(shell LC_ALL=C date -u -d "$(SOURCE_DATE)" +"%d %B %Y")

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

UPSTREAM_PACKAGE_VERSION ?= $(shell dpkg-parsechangelog --show-field Version | sed 's/-[^-]*$$//')

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean --sourcedirectory=host
	dh_auto_clean --sourcedirectory=firmware
	$(RM) debian/man/*.1
	$(RM) -r ubertooth-firmware-source
	$(RM) ubertooth-firmware-source.tar.gz
	$(RM) debian/ubertooth.pc

override_dh_auto_configure:
	# Creating ubertooth-firmare-source.tar.gz:
	cp -rf firmware ubertooth-firmware-source
	cd ubertooth-firmware-source ; patch -R -Np2 < ../debian/patches/02_fix_missing_dfu.patch ; \
	  patch -Np1 < ../debian/patches/patch_include_source.patch
	GZIP=-9n tar --mtime='$(SOURCE_DATE_UTC)' --sort=name --owner=root --group=root \
	  --mode=go=rX,u+rw,a-s -czvf ubertooth-firmware-source.tar.gz \
	  ubertooth-firmware-source/
	#
	
	dh_auto_configure --sourcedirectory=host -- -DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH) \
	  -DUBERTOOTH_GROUP=plugdev -DUDEV_RULES_PATH=/lib/udev/rules.d
	dh_auto_configure --sourcedirectory=firmware

override_dh_auto_build:
	dh_auto_build --sourcedirectory=host
	dh_auto_build --sourcedirectory=firmware -- TIMESTAMP="-DTIMESTAMP=''" \
	  COMPILE_BY="-D'COMPILE_BY=\"user\"'" COMPILE_HOST="-D'COMPILE_HOST=\"localhost\"'"
	cat debian/ubertooth.pc.in | sed 's/DEB_HOST_MULTIARCH/$(DEB_HOST_MULTIARCH)/' | \
	  sed 's/UPSTREAM_PACKAGE_VERSION/$(UPSTREAM_PACKAGE_VERSION)/' > debian/ubertooth.pc

override_dh_auto_install:
	chmod a-x firmware/*/*.bin
	dh_auto_install --sourcedirectory=host
	dh_auto_install --sourcedirectory=firmware
	mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
	cp debian/ubertooth.pc debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/

override_dh_strip:
	dh_strip -plibubertooth0 --keep-debug --dbg-package=libubertooth0-dbg
	dh_strip -pubertooth

override_dh_installman:
	cd debian/man ; CHANGELOG_DATE="$(CHANGELOG_DATE)" ./genmanpages.sh
	dh_installman