File: rules

package info (click to toggle)
libopenaptx 0.2.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 240 kB
  • sloc: ansic: 1,562; makefile: 169
file content (43 lines) | stat: -rwxr-xr-x 1,201 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/pkg-info.mk
# Increase optimisation level for better performance
export DEB_CFLAGS_MAINT_APPEND = -O3

%:
	dh $@

override_dh_auto_build:
	# Enforce Debian's CFLAGS and LDFLAGS in build, as there's no configure pass
	dh_auto_build -- \
		CFLAGS="$(shell dpkg-buildflags --get CFLAGS)" \
		LDFLAGS="$(shell dpkg-buildflags --get LDFLAGS)" \

override_dh_auto_install:
	# Pass PREFIX and LIBDIR that are not taken correctly from Makefile
	dh_auto_install -- \
		PREFIX=/usr \
		LIBDIR=lib/${DEB_HOST_MULTIARCH}

MANPAGES=debian/openaptxenc.1 debian/openaptxdec.1

override_dh_installman: ${MANPAGES}
	# Make sure the MANPAGES are installed
	dh_installman -popenaptx-utils $^

debian/%.1:
	# Generate a manpage from the executable
	PATH=.:$$PATH \
	LD_PRELOAD=./libopenaptx.so.0 \
		help2man \
			--section=1 \
			--version-string=${DEB_VERSION_UPSTREAM} \
			--source="Debian (help2man)" \
			--name="aptX $(patsubst openaptx%,%,$*)oder utility ${DEB_VERSION_UPSTREAM} (using libopenaptx ${DEB_VERSION_UPSTREAM})" \
			--no-info \
			--no-discard-stderr \
			-o$@ $*

execute_after_dh_clean:
	rm -f ${MANPAGES}