Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 include /usr/share/dpkg/pkg-info.mk
4
5 %:
6 dh $@
7
8 # Don't split debug info from Hexagon libraries
9 override_dh_dwz:
10 dh_dwz -Xusr/share/hexagon-dsp
11
12 override_dh_strip:
13 dh_strip -Xusr/share/hexagon-dsp
14
15 override_dh_shlibdeps:
16 dh_shlibdeps -Xusr/share/hexagon-dsp
17
18 # Upstream check.py can't work with Debian's packaging, it requires original
19 # Git repo. Ignore it, as its main goal is to verify that files under Git
20 # control match the WHENCE and config files.
21 override_dh_auto_test:
22
23 # Override the target location
24 override_dh_auto_install:
25 $(MAKE) install DESTDIR=debian/tmp DSPDIR=usr/share/hexagon-dsp
26 [ -e firmware/WHENCE-orig ] || mv firmware/WHENCE firmware/WHENCE-orig
27 debian/filter-firmware-whence.py firmware/WHENCE-orig firmware/WHENCE
28 cd firmware && ./copy-firmware.sh ../debian/tmp/usr/lib/firmware
29 ./firmware/dedup-firmware.sh debian/tmp/usr/lib/firmware/
30
31 override_dh_install:
32 dh_install
33 debian/check-symlinks
34
35 override_dh_clean:
36 dh_clean
37 if [ -e firmware/WHENCE-orig ] ; then mv firmware/WHENCE-orig firmware/WHENCE ; fi
38 # possible leftover of dedup-firmware.sh
39 rm -f results.txt
40
41 REGEN = debian/regen.sh
42 CONTROLTEMPLATES = debian/control.head.in debian/control.dev.in debian/control.main.in debian/pkgname.lintian-overrides.in
43
44 VERSION_BASE := $(shell echo "$(DEB_VERSION)" | sed -e 's,-[^-]*$$,,')
45 VERSION_UPSTREAM := $(shell echo "$(VERSION_BASE)" | sed -e 's,^0~,,g')
46 VERSION_BINNMU := $(shell echo "$(DEB_VERSION)" | sed -rne 's,.*\+b([0-9]+)$$,\1,p')
47 VERSION_SOURCE := $(patsubst %+b$(VERSION_BINNMU),%,$(DEB_VERSION))
48
49 DIR_ORIG = ../orig/$(DEB_SOURCE)-$(VERSION_UPSTREAM)
50 TAR_ORIG_NAME = $(DEB_SOURCE)_$(VERSION_BASE).orig.tar.gz
51 TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME)))
52
53 DIR_FW_ORIG = ../orig/$(DEB_SOURCE)-firmware-$(VERSION_UPSTREAM)
54 TAR_FW_ORIG_NAME = $(DEB_SOURCE)_$(VERSION_BASE).orig-firmware.tar.gz
55 TAR_FW_ORIG = $(firstword $(wildcard ../$(TAR_FW_ORIG_NAME)) $(wildcard ../orig/$(TAR_FW_ORIG_NAME)))
56
57 $(DIR_ORIG):
58 ifeq ($(TAR_ORIG),)
59 $(error Cannot find orig tarball $(TAR_ORIG_NAME))
60 else
61 mkdir -p $(DIR_ORIG)
62 tar -C $(DIR_ORIG) --strip-components=1 -xaf $(TAR_ORIG)
63 endif
64
65 $(DIR_FW_ORIG):
66 ifeq ($(TAR_FW_ORIG),)
67 $(error Cannot find orig tarball $(TAR_FW_ORIG_NAME))
68 else
69 mkdir -p $(DIR_FW_ORIG)
70 tar -C $(DIR_FW_ORIG) --strip-components=1 -xaf $(TAR_FW_ORIG)
71 endif
72
73 orig: $(DIR_ORIG) $(DIR_FW_ORIG)
74 rsync --delete --exclude /debian --exclude /.git --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ .
75 # QUILT_PATCHES='$(CURDIR)/debian/patches' QUILT_PC=.pc quilt push --quiltrc - -a -q --fuzz=0
76 rsync --delete --exclude /debian --exclude /.git --link-dest=../$(DIR_FW_ORIG)/ -a $(DIR_FW_ORIG)/ firmware/
77
78 # debian/regen.sh uses debian/changelog as input, but the
79 # output only depends on the source name and version. To avoid
80 # frequent changes to debian/control.md5sum, include only those fields
81 # in the checksum.
82 debian/build/version-info: debian/changelog
83 mkdir -p $(@D)
84 printf >$@ 'Source: %s\nVersion: %s\n' $(DEB_SOURCE) $(VERSION_SOURCE)
85
86 debian/control: $(REGEN) config.txt $(CONTROLTEMPLATES) debian/build/version-info
87 ifeq ($(wildcard debian/control.md5sum),)
88 $(MAKE) -f debian/rules debian/control-real
89 else
90 md5sum --check debian/control.md5sum --status || \
91 $(MAKE) -f debian/rules debian/control-real
92 endif
93
94 debian/control-real: $(REGEN) config.txt $(CONTROLTEMPLATES) debian/changelog
95 $(REGEN) $(VERSION_UPSTREAM)
96 md5sum $^ > debian/control.md5sum
97 @echo
98 @echo This target is made to fail intentionally, to make sure
99 @echo that it is NEVER run during the automated build. Please
100 @echo ignore the following error, the debian/control file has
101 @echo been generated SUCCESSFULLY.
102 @echo
103 exit 1
104
105 .PHONY: debian/control-real