File: rules

package info (click to toggle)
mangler 1.2.5-5.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,912 kB
  • sloc: ansic: 65,412; sh: 11,081; cpp: 10,805; makefile: 144
file content (54 lines) | stat: -rwxr-xr-x 1,802 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed

DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | \
			sed -rne 's,^Version: ([^-]+).*,\1,p')

%:
	dh $@

override_dh_auto_configure:
	# Disable ALSA support on non-Linux archs
	if [ $(DEB_HOST_ARCH_OS) = linux ]; then \
		dh_auto_configure -- --disable-g15; \
	else \
		dh_auto_configure -- --disable-g15 --without-alsa; \
	fi

override_dh_auto_build:
	# Generate icons/mangler-icons.h
	cd icons/ && make mangler-icons.h

	# Generate src/manglerui.h
	cd src/ && echo -n "char ManglerUI[] = " > manglerui.h && \
	cat mangler.ui  | sed 's/"/\\"/g' | sed 's/^/"/' | \
	sed 's/$$/\\n"/' >> manglerui.h && echo ";" >> manglerui.h

	dh_auto_build

override_dh_auto_test:

get-orig-source:
	# Remove existing mangler directory and tarball, if existing
	rm -rf mangler-$(DEB_UPSTREAM_VERSION)
	rm -f mangler_$(DEB_UPSTREAM_VERSION).orig.tar.gz
	# Fetch latest upstream tarball
	uscan --noconf --force-download --download-current-version \
	--destdir=.
	# Unpack and remove tarball
	tar -xzf mangler-$(DEB_UPSTREAM_VERSION).tar.gz
	rm -f mangler-$(DEB_UPSTREAM_VERSION).tar.gz
	# Remove potentially non-DFSG-compliant (and other unwanted) files
	rm -rf mangler-$(DEB_UPSTREAM_VERSION)/debian/
	rm -rf mangler-$(DEB_UPSTREAM_VERSION)/rpm/
	rm -rf mangler-$(DEB_UPSTREAM_VERSION)/android/
	rm -rf mangler-$(DEB_UPSTREAM_VERSION)/iphone/
	rm -rf mangler-$(DEB_UPSTREAM_VERSION)/libventrilo3/codec-test/
	rm -rf mangler-$(DEB_UPSTREAM_VERSION)/icons/mangler-icons.h
	rm -rf mangler-$(DEB_UPSTREAM_VERSION)/src/manglerui.h
	# Repack tarball
	tar -czf mangler_$(DEB_UPSTREAM_VERSION).orig.tar.gz mangler-\
	$(DEB_UPSTREAM_VERSION)/