Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 export TZ=UTC
7
8 include /usr/share/dpkg/default.mk
9
10 %:
11 dh $@
12
13 paks := $(shell cat debian/$(DEB_SOURCE).paks)
14
15 # We cannot apply dh_strip_nondeterminism to the PK3 files because
16 # it would sort the files inside the archive, and the idTech3 engine
17 # is sensitive to order: an archive with re-ordered files is not
18 # considered network-compatible. The order of files is arbitrary but
19 # deterministic, and is chosen to match the arbitrary order that
20 # is present in upstream binary releases.
21 override_dh_strip_nondeterminism:
22 dh_strip_nondeterminism -X.pk3
23
24 override_dh_auto_build: $(patsubst %,build/%,$(paks))
25 :
26
27 debian/%.pk3.contents.raw: debian/%.pk3.contents
28 sed -n -e 's/#.*//; /./p;' < $< > $@
29
30 debian/%.pk3.filenames: debian/%.pk3.contents
31 sed -n -e 's/#.*//; s/.*\t//p;' < $< > $@
32
33 debian/%.pk3.qvms: debian/%.pk3.contents
34 sed -n -e 's/#.*//; s/\.qvm$$//p;' < $< > $@
35
36 build/%: debian/%.pk3.qvms debian/%.pk3.filenames debian/%.pk3.contents.raw
37 set -e; while read crc filename; do \
38 test -f $*-$$crc.qvm || \
39 $(MAKE) -f debian/rules QVMPREFIX=$(*F) QVMCRC=$$crc \
40 debian/$(*F)-$$crc.qvm; \
41 install -d $*/vm; \
42 install -v -m644 debian/$(*F)-$$crc.qvm $*/$$filename.qvm; \
43 touch --date='@$(SOURCE_DATE_EPOCH)' $*/$$filename.qvm; \
44 touch --date='@$(SOURCE_DATE_EPOCH)' $*/vm; \
45 done < debian/$*.pk3.qvms
46 rm -f $*.pk3
47 ( set -e; cd $*; while read crc filename; do \
48 if test $$crc = directory; then \
49 chmod 0755 "$$filename"; \
50 else \
51 chmod 0644 "$$filename"; \
52 fi; \
53 done ) < debian/$*.pk3.contents.raw
54 ( cd $* && zip -X -o -q -9 $(CURDIR)/$*.pk3 -@ ) < \
55 debian/$*.pk3.filenames
56
57 override_dh_auto_test: $(patsubst %,check/%,$(paks))
58 :
59
60 check/pak0: build/pak0
61 grep "NTVEpak0" pak0/vm/cgame.qvm
62 grep "NTVEpak0" pak0/vm/qagame.qvm
63 grep "NTVEpak0" pak0/vm/ui.qvm
64
65 check/mp-pak0: build/mp-pak0
66 grep "NTVEmp-pak0" mp-pak0/vm/cgame.qvm
67 grep "NTVEmp-pak0" mp-pak0/vm/qagame.qvm
68 grep "NTVEmp-pak0" mp-pak0/vm/ui.qvm
69
70 check/pak6-patch085: build/pak6-patch085
71 grep "NTVEpak6-patch085" pak6-patch085/vm/cgame.qvm
72 grep "NTVEpak6-patch085" pak6-patch085/vm/qagame.qvm
73 grep "NTVEpak6-patch085" pak6-patch085/vm/ui.qvm
74
75 check/pak6-patch088: build/pak6-patch088
76 grep "NTVEpak6-patch088" pak6-patch088/vm/cgame.qvm
77 grep "NTVEpak6-patch088" pak6-patch088/vm/qagame.qvm
78 grep "NTVEpak6-patch088" pak6-patch088/vm/ui.qvm
79
80 # otherwise there's nothing to check
81 check/%: build/%
82 :
83
84 # check that the PK3s are still compatible (do this as late as
85 # possible so that they aren't going to be modified further)
86 override_dh_builddeb: $(patsubst %,check-compat/%,$(paks))
87 dh_builddeb
88
89 check-compat/%: debian/%.pk3.contents.raw
90 perl debian/list-pk3.pl \
91 debian/*/usr/share/games/openarena/*/$*.pk3 | \
92 sed -n -e 's/#.*//; /./p' | \
93 diff -u debian/$*.pk3.contents.raw -
94
95 build-indep: debian/openarena-088-data.README.Debian
96 debian/openarena-088-data.README.Debian: debian/qvms.README.Debian
97 install -m644 $< $@
98
99 build-indep: debian/openarena-085-data.README.Debian
100 debian/openarena-085-data.README.Debian: debian/qvms.README.Debian
101 install -m644 $< $@
102
103 build-indep: debian/openarena-data.README.Debian
104 debian/openarena-data.README.Debian: debian/qvms.README.Debian
105 install -m644 $< $@
106
107 ifeq ($(filter-out openarena-oacmp1,$(DEB_SOURCE)),)
108 build-indep: oacmp-volume1-v3/docs/README
109 oacmp-volume1-v3/docs/README: oacmp-volume1-v3/docs/OACMP-Readme.txt
110 install -m644 $< $@
111 endif
112
113 # order-only dependency: once we've generated it, no need to waste time
114 # generating it again, it'll come out the same
115 debian/$(QVMPREFIX)-$(QVMCRC).qvm: | debian/qvmbrute
116 ./debian/qvmbrute 0x$(QVMCRC) $@ $(QVMPREFIX)
117
118 debian/qvmbrute: | debian/qvmbrute.c
119 $(DEB_BUILD_GNU_TYPE)-gcc \
120 $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -Wall \
121 -o debian/qvmbrute debian/qvmbrute.c \
122 $(LDFLAGS_FOR_BUILD) -lz
123
124 tarball := $(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM).orig.tar.xz
125 tardir := $(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM).orig
126
127 ifeq ($(filter-out openarena-oacmp1,$(DEB_SOURCE)),)
128 sources = oacmp-volume1-v3
129 import-orig: pre-import-orig $(patsubst %,import-orig-zip/%,$(sources))
130 :
131 else
132 sources = source
133 import-orig: pre-import-orig $(patsubst %,import-orig-pk3/%,$(paks))
134 :
135 endif
136
137 pre-import-orig:
138 rm -rf $(sources)
139
140 import-orig-pk3/%: pre-import-orig
141 @if ! test -f $*.pk3; then \
142 echo "Copy upstream pk3 file to $*.pk3";\
143 exit 1;\
144 fi
145 rm -f debian/$*.pk3.contents
146 rm -rf ./$*
147 install -d $*
148 perl debian/list-pk3.pl $*.pk3 > debian/$*.pk3.contents
149 unzip -q $*.pk3 -x '*.qvm' '../*' -d $*
150 set -e && if test mp-pak0 = $*; then \
151 unzip -o -j mp-pak0.pk3 ../COPYING ../CREDITS; \
152 fi
153 # r901 is 0.8.1; r931 is 0.8.5 (despite the commit message)
154 # r947 is 0.8.8
155 # source/assets/textures/trak/ are not GPL-compatible
156 set -e; for r in 901 931 947; do \
157 if ! test -e debian/$*.svn$$r; then \
158 continue; \
159 fi; \
160 install -d debian/svn-r$$r/source; \
161 test -d debian/svn-r$$r/source/assets || svn export -r$$r \
162 https://openarena.ws/svn/source/assets \
163 debian/svn-r$$r/source/assets; \
164 rm -rf debian/svn-r$$r/source/assets/textures/trak/; \
165 while read s; do \
166 rsync --link-dest=debian/svn-r$$r \
167 --files-from=debian/$*.svn$$r -r \
168 debian/svn-r$$r/ ./; \
169 done < debian/$*.svn$$r; \
170 done
171
172 import-orig-zip/%:
173 @if ! test -f $*.zip; then \
174 echo "Copy upstream download to $*.zip";\
175 exit 1;\
176 fi
177 unzip $*.zip -d $*
178 mv $*/*/*.pk3 .
179
180 export-orig:
181 rm -rf $(tardir)
182 install -d $(tardir)
183 set -e && for x in $(paks) $(sources); do \
184 cp -al $$x $(tardir)/$$x; \
185 done
186 ifneq ($(filter-out openarena-oacmp1,$(DEB_SOURCE)),)
187 install -m644 CHANGES COPYING CREDITS CREDITS-0.8.5 CREDITS-0.8.8 LINUXNOTES README WENEED readme_085.txt readme_088.txt $(tardir)
188 endif
189 tar -Jvcf ../$(tarball) $(tardir)
190 rm -rf $(tardir)