File: rules

package info (click to toggle)
xpilot 4.5.5beta.20031222-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 7,696 kB
  • ctags: 8,771
  • sloc: ansic: 85,922; cpp: 4,282; tcl: 3,479; sh: 1,731; makefile: 334; perl: 134
file content (335 lines) | stat: -rwxr-xr-x 8,544 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
#!/usr/bin/make -f
# Adapted from sample debian/rules that uses debhelper
# Original by Joey Hess; GNU copyright 1997
# Modified by Matt Kern; GNU copyright 1999
# Modified by Ben Armstrong; GNU copyright 2001, 2002
# Last updated Apr. 15, 2002


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

# This is the debhelper compatability version to use.
export DH_COMPAT=3

BUILD_FILES = Local.* Imakefile README.txt.msub contrib doc lib src

BUILD_CLIENTS = build-stamp-nosound build-stamp-nas build-stamp-rplay
BUILD_CLIENT_EXTRA = build-stamp-replay
BUILD_SERVER = build-stamp-server
BUILD_SERVER_EXTRA = build-stamp-mapedit

# hurd-i386 doesn't have nas yet:
ifeq ($(DEB_BUILD_ARCH),hurd-i386)
BUILD_CLIENTS = build-stamp-nosound build-stamp-rplay
endif
BUILD_TARGETS = $(BUILD_CLIENTS) $(BUILD_CLIENT_EXTRA) \
  $(BUILD_SERVER) $(BUILD_SERVER_EXTRA)

INSTALL_CLIENTS = install-stamp-common \
	install-stamp-nosound install-stamp-nas install-stamp-rplay
INSTALL_SERVER = install-stamp-server

# hurd-i386 doesn't have nas yet:
ifeq ($(DEB_BUILD_ARCH),hurd-i386)
INSTALL_CLIENTS = install-stamp-common \
  install-stamp-nosound install-stamp-rplay
endif
INSTALL_TARGETS = $(INSTALL_CLIENTS) $(INSTALL_SERVER)

configure: configure-stamp
configure-stamp:
	dh_testdir

	# For xpilot-nosound and all other non-client builds:
	ln -sf debian/My.config
	xmkmf -a -DMY_CONFIG

	touch configure-stamp


configure-nas: configure-stamp-nas
configure-stamp-nas:
	dh_testdir

	# Create build tree, replacing old if it exists:
	rm -rf debian/build-nas
	mkdir debian/build-nas
	cp -a $(BUILD_FILES) debian/build-nas

	# Isolate the xpilot-nas build in its own build tree:
	cd debian/build-nas && ln -sf ../My.config
	cd debian/build-nas && xmkmf -a -DMY_CONFIG -DNCD_SOUND
	$(MAKE) -C debian/build-nas clean depend

	touch configure-stamp-nas


configure-rplay: configure-stamp-rplay
configure-stamp-rplay:
	dh_testdir

	# Create build tree, replacing old if it exists:
	rm -rf debian/build-rplay
	mkdir debian/build-rplay
	cp -a $(BUILD_FILES) debian/build-rplay

	# Isolate the xpilot-rplay build in its own build tree:
	cd debian/build-rplay && ln -sf ../My.config
	cd debian/build-rplay && xmkmf -a -DMY_CONFIG -DRPLAY_SOUND
	$(MAKE) -C debian/build-rplay clean depend

	touch configure-stamp-rplay


build: build-stamp
build-stamp: configure-stamp $(BUILD_TARGETS)

	touch build-stamp


build-common: build-stamp-common
build-stamp-common: configure-stamp
	dh_testdir

	$(MAKE) -C src/common
	$(MAKE) -C doc

	touch build-stamp-common


build-replay: build-stamp-replay
build-stamp-replay: build-stamp-common
	dh_testdir

	# Build the xp-replay utility
	$(MAKE) -C src/replay

	touch build-stamp-replay


build-mapedit: build-stamp-mapedit
build-stamp-mapedit: build-stamp-common
	dh_testdir

	# Build the xp-mapedit utility
	$(MAKE) -C src/mapedit

	touch build-stamp-mapedit


build-nosound: build-stamp-nosound
build-stamp-nosound: configure-stamp build-stamp-common
	dh_testdir

	# Build the client without sound support
	$(MAKE) -C src/client

	touch build-stamp-nosound


build-nas: build-stamp-nas
build-stamp-nas: configure-stamp-nas build-stamp-common
	dh_testdir

	# Common needs to know we have sound, so unfortunately we
	# must build it here too:
	$(MAKE) -C debian/build-nas/src/common

	# Build the NAS sound support client
	$(MAKE) -C debian/build-nas/src/client

	touch build-stamp-nas


build-rplay: build-stamp-rplay
build-stamp-rplay: configure-stamp-rplay build-stamp-common
	dh_testdir

	# Common needs to know we have sound, so unfortunately we
	# must build it here too:
	$(MAKE) -C debian/build-rplay/src/common

	# Build the RPlay sound support client
	$(MAKE) -C debian/build-rplay/src/client

	touch build-stamp-rplay


build-server: build-stamp-server
build-stamp-server: configure-stamp build-stamp-common
	dh_testdir

	# Build the server
	$(MAKE) -C src/server

	touch build-stamp-server


clean:
	dh_testdir
	dh_testroot
	rm -f configure-stamp* build-stamp* install-stamp*

	# Clean up any files we made
	-test -f Makefile && $(MAKE) clean || true
	-rm -f My.config
	-rm -f `find . -name Makefile`
	-rm -rf debian/build-*

	dh_clean


install: install-stamp
install-stamp: $(INSTALL_TARGETS)
	touch install-stamp


install-common: install-stamp-common
install-stamp-common: build-stamp-common build-stamp-replay
	dh_testdir
	dh_testroot
	dh_clean -p xpilot-client-common -k
	dh_installdirs -p xpilot-client-common

	# Install common files for client:
	$(MAKE) -C lib/textures \
	  DESTDIR=$(CURDIR)/debian/xpilot-client-common install
	$(MAKE) -C src/replay \
	  DESTDIR=$(CURDIR)/debian/xpilot-client-common install
	cp lib/sounds \
	  debian/xpilot-client-common/etc/xpilot/

	touch install-stamp-common


install-nosound: install-stamp-nosound
install-stamp-nosound: build-stamp-nosound build-stamp-replay
	dh_testdir
	dh_testroot
	dh_clean -p xpilot-client-nosound -k
	dh_installdirs -p xpilot-client-nosound

	# Install nosound version of client:
	cp src/client/xpilot \
	  debian/xpilot-client-nosound/usr/games/xpilot-nosound

	touch install-stamp-nosound


install-nas: install-stamp-nas
install-stamp-nas: build-stamp-nas build-stamp-replay
	dh_testdir
	dh_testroot
	dh_clean -p xpilot-client-nas -k
	dh_installdirs -p xpilot-client-nas

	# Install nas version of client:
	cp debian/build-nas/src/client/xpilot \
	  debian/xpilot-client-nas/usr/games/xpilot-nas

	touch install-stamp-nas


install-rplay: install-stamp-rplay
install-stamp-rplay: build-stamp-rplay build-stamp-replay
	dh_testdir
	dh_testroot
	dh_clean -p xpilot-client-rplay -k
	dh_installdirs -p xpilot-client-rplay

	# Install rplay version of client:
	cp debian/build-rplay/src/client/xpilot \
	  debian/xpilot-client-rplay/usr/games/xpilot-rplay

	touch install-stamp-rplay


install-server: install-stamp-server
install-stamp-server: build-stamp-server build-stamp-mapedit
	dh_testdir
	dh_testroot
	dh_clean -k -p xpilot-server
	dh_installdirs -p xpilot-server

	# Install server:
	$(MAKE) -C lib DESTDIR=$(CURDIR)/debian/xpilot-server install
	$(MAKE) -C src/server DESTDIR=$(CURDIR)/debian/xpilot-server install
	$(MAKE) -C src/mapedit DESTDIR=$(CURDIR)/debian/xpilot-server install

	# Fix-up xpilot-server:
	# - first remove the client-specific files:
	rm -rf debian/xpilot-server/usr/share/games/xpilot/textures
	rm -f debian/xpilot-server/usr/share/games/xpilot/sounds

	# - some custom stuff we provide:
	install -o 0 -g 0 -m 755 debian/start-xpilots \
	  debian/xpilot-server/usr/games
	install -o 0 -g 0 -m 644 debian/blood-music.xp \
	  debian/xpilot-server/usr/share/games/xpilot/maps
	mv debian/xpilot-server/usr/share/games/xpilot/maps/default.xp \
	  debian/xpilot-server/usr/share/games/xpilot/maps/newbie-globe.xp
	ln -s blood-music.xp \
	  debian/xpilot-server/usr/share/games/xpilot/maps/default.xp

	# Conf files need some special treatment:
	mv debian/xpilot-server/usr/share/games/xpilot/defaults \
	  debian/xpilot-server/etc/xpilots
	mv debian/xpilot-server/usr/share/games/xpilot/password \
	  debian/xpilot-server/etc/xpilots
	chmod 600 debian/xpilot-server/etc/xpilots/password

	touch install-stamp-server


# Build architecture-independent files here.
binary-indep: build install
#	dh_testversion -i
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	dh_installchangelogs -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i


# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installdocs -p xpilot-client-common
	dh_installdocs -p xpilot-server
	dh_installmenu -a
	# Don't modify scripts so we can stop reliably in prerm
	dh_installinit -p xpilot-server --init-script=xpilots --noscripts
	dh_installman -p xpilot-client-common \
	  doc/man/xp-replay.man doc/man/xpilot.man
	dh_installman -p xpilot-server \
	  doc/man/xpilots.man debian/start-xpilots.8 debian/xp-mapedit.6
	dh_installchangelogs -p xpilot-client-common doc/ChangeLog
	dh_installchangelogs -p xpilot-server doc/ChangeLog
	dh_installchangelogs -p xpilot
	dh_strip -a
	dh_link -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
# This is being worked on.  Not ready quite yet.
#	dh_installdebconf -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a


source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false


binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install