File: makebuild.sh

package info (click to toggle)
nexuiz-data 2.5.2-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,294,288 kB
  • sloc: ansic: 10,523; perl: 6,845; sh: 2,188; java: 1,417; xml: 969; lisp: 519; ruby: 136; makefile: 125
file content (380 lines) | stat: -rwxr-xr-x 12,638 bytes parent folder | download | duplicates (6)
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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
#!/bin/bash

set -e

# Options:
#   pw=foo          extract password
#   version=2.5     make a FINAL build
#   tag=FOO         insert FOO before the date in build names

base=`pwd`

# customizable specific stuff
netradiant_release=1.5.0-svn389
basepk3=$base/data20090403.pk3 # 2.5
hotbasepk3= # hotfix
nexdir=$base/nexuiz
havocdir=$base/nexuiz/havoc
dpdir=$base/darkplaces
tmpdir=/tmp/NEX
zipdir=$base/builds
buildfiles=$base/nexuiz/misc/buildfiles
mingwdlls=$buildfiles/w32
osxapps=$buildfiles/osx
copystrip=$buildfiles/copystrip
zipdiff=$base/nexuiz/misc/tools/zipdiff
fteqccdir="$base/fteqcc"
fteqccflags=""
menuqc=menu
newest=NEWEST
aft="perl -I/chroot/debian-etch/usr/share/aft /chroot/debian-etch/usr/bin/aft"
# end system specific stuff

case "$pw" in
	'')
		zipflags=
		;;
	*)
		zipflags="-P $pw"
		;;
esac

: ${date:=`date +%Y%m%d`}
: ${versiontag:=}
echo "date stamp: $date"

case "$version" in
	'')
		version=2.5s
		versiontag=test
		defaultcfg=
		ext=
		;;
	*)
		version=$version
		versiontag=$versiontag
		defaultcfg=
		ext=_$version
		;;
esac

mk7z()
{
	7za a -tzip -mx=9 "$@"
	chmod 644 "$1"
}

#if [ -n "$EXPERIMENTAL" ]; then
#	basepk3=$base/data20071231.pk3 # newer build to make smaller patches
#	nexdir=$base/nexuiz
#fi

# TODO normalize the builds
platforms='x86 amd64 osx'
buildon()
{
	host=$1
	prefix=$2
	fteqccname=$3
	path=$4
	makeflags=$5
	strip=$6

	fteqcc_cflags=
	case "$fteqccname" in
		*.exe)
			fteqcc_cflags=win
			;;
	esac

	rm -f "$fteqccdir"/*.o
	rm -f "$fteqccdir"/*.bin
	rsync --exclude "*.o" --exclude "*.d" --exclude "nexuiz-*" --delete-excluded --delete -zvaSHP . "$copystrip" "$fteqccdir" "$host:$path"
	ssh "$host" ". ~/.profile && cd $path && COPYSTRIP_STRIP=$strip PATH=$path/copystrip:\$PATH make $makeflags clean nexuiz && cd ${fteqccdir##*/} && make $makeflags $fteqcc_cflags"
	rsync --exclude "*.o" --exclude "*.d" --delete-excluded --delete -zvaSHP "$host:$path/." .
	for P in -dedicated -sdl -glx -wgl -agl -dedicated.exe -sdl.exe .exe; do
		[ -f nexuiz$P ] && mv nexuiz$P "$tmpdir/$prefix$P"
		[ -f nexuiz$P-withdebug ] && mv nexuiz$P-withdebug "$tmpdir/debuginfo/$prefix$P"
		[ -f nexuiz$P.dSYM ] && mv nexuiz$P.dSYM "$tmpdir/debuginfo/$prefix$P.dSYM"
	done
	case "$fteqccname" in
		*.exe)
			mv "${fteqccdir##*/}"/fteqcc.exe "$tmpdir/fteqcc/$fteqccname"
			;;
		*)
			mv "${fteqccdir##*/}"/fteqcc.bin "$tmpdir/fteqcc/$fteqccname"
			;;
	esac
	make clean
}

build()
{
	buildon nexmacbuild                           nexuiz-osx          fteqcc-osx          /tmp/Darkplaces.build 'CC="gcc -g -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"' strip
#	buildon nexmacbuild                           nexuiz-osx          fteqcc-osx          /tmp/Darkplaces.build 'CC="gcc -g -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"' strip
	buildon eos.thruhere.net                      nexuiz-linux-686    fteqcc-linux-686    /tmp/Darkplaces.build 'CC="gcc -g" DP_MODPLUG_STATIC_LIBDIR=$HOME/modplug-i386/lib DP_LINK_TO_LIBJPEG=1 LDFLAGS_LIBJPEG="$HOME/jpeg7/lib/libjpeg.a" CFLAGS_LIBJPEG="-I$HOME/jpeg7/include"' strip
	buildon alientrap.org                         nexuiz-linux-x86_64 fteqcc-linux-x86_64 /tmp/Darkplaces.build 'CC="gcc -g -Wl,--hash-style=sysv" DP_MODPLUG_STATIC_LIBDIR=/home/divverent/modplug-x86_64/lib DP_LINK_TO_LIBJPEG=1 LDFLAGS_LIBJPEG="$HOME/jpeg7/lib/libjpeg.a" CFLAGS_LIBJPEG="-I$HOME/jpeg7/include"' strip
	buildon alientrap.org                         nexuiz              fteqcc.exe          /tmp/Darkplaces.build 'DP_MAKE_TARGET=mingw CC="/chroot/debian-etch/usr/bin/i586-mingw32msvc-gcc -g -DSUPPORTDIRECTX -I$HOME/dxheaders" WINDRES=/chroot/debian-etch/usr/bin/i586-mingw32msvc-windres SDL_CONFIG=$HOME/sdl-win32/SDL-1.2.13/bin/sdl-config' /chroot/debian-etch/usr/bin/i586-mingw32msvc-strip
		mv "$tmpdir/nexuiz-osx-agl"     "$tmpdir/Nexuiz.app/Contents/MacOS/nexuiz-osx-agl-bin"
		mv "$tmpdir/nexuiz-osx-sdl"     "$tmpdir/Nexuiz-SDL.app/Contents/MacOS/nexuiz-osx-sdl-bin"
}

# avoid dupes
i=
while [ -f "$zipdir/nexuiz$date$i$ext.zip" ]; do
	if [ -z "$i" ]; then
		i=a
	else
		i=`echo "$i" | tr a-y b-z`
	fi
done
ext=$i$ext

echo "Using build name nexuiz$date$ext"
sleep 3

# check for remains
conflicts=`find "$dpdir" "$nexdir" -name '*.orig' -o -name '*.rej' -o -name '*.mine' -o -name '.#*' -o -name '.*~'`
if [ -n "$conflicts" ]; then
	echo "CONFLICTS OR UNNEEDED FILES HAVE BEEN FOUND!"
	echo "NOT PROCEEDING"
	echo
	echo "$conflicts"
	exit 1
fi

set -x

# prepare temp dir
rm -rf "$tmpdir"
mkdir -p "$tmpdir"

# clean up and patch DP
cd "$dpdir"
quilt pop -a || true
svn revert -R .
if [ -s patches/series ]; then
	quilt push -a # apply all patches
fi

# prepare directory structure
cp -r "$osxapps"/*.app "$tmpdir"
mkdir "$tmpdir/debuginfo"
mkdir "$tmpdir/fteqcc"

# prepare fteqcc build
cd "$fteqccdir"
git checkout-index -a -f --prefix="$tmpdir/fteqcc/source/"
git log -1 > "$tmpdir/fteqcc/source/fteqcc-base-revision.txt"
fteqccrev=`git show --pretty=%ct-%H | head -n 1`
echo "fteqcc rev $fteqccrev"

# build all executables
cd "$dpdir"
rm -rf nexuiz-* *.o
make clean
build
rm -rf nexuiz-* *.o
rm -rf fteqcc copystrip
make clean

# move shell scripts and license
cd "$tmpdir"
cp "$nexdir/"nexuiz-*.sh "$tmpdir/"
cp "$nexdir/gpl.txt" "$tmpdir/"
cp "$nexdir/readme.html" "$tmpdir/"

# prepare data
cd "$nexdir/data"
svn export . "$tmpdir/data"
svn info . > "$tmpdir/data/nexuiz-data-base-revision.txt"
svn log > "$tmpdir/data/ChangeLog"

# prepare havoc
cd "$havocdir"
svn export . "$tmpdir/havoc"

# prepare Docs
cd "$nexdir/Docs"
svn export . "$tmpdir/Docs"

# prepare server
cd "$nexdir/server"
svn export . "$tmpdir/server"

# make gamesource
cd "$tmpdir/data"
mkdir -p "$tmpdir/sources"
mk7z ../sources/gamesource$date.zip qcsrc nexuiz-data-base-revision.txt ChangeLog

# make enginesource
cd "$dpdir"
svn export . "$tmpdir/darkplaces"
svn info > "$tmpdir/darkplaces/nexuiz-base-revision.txt"
svn diff > "$tmpdir/darkplaces/nexuiz-engine-changes.diff"
svn log > "$tmpdir/darkplaces/ChangeLog"
cd "$tmpdir"
mk7z "$tmpdir/sources/enginesource$date.zip" "darkplaces"
rm -rf darkplaces

# make fteqcc archive
cd "$tmpdir"
zip -9r "$tmpdir/sources/fteqcc-binaries-and-source-rev$fteqccrev.zip" "fteqcc"
rm -rf fteqcc

# clean fteqcc dir
cd "$fteqccdir"
rm -f *.o *.bin
make

# make local compiler
cd "$tmpdir/data"
make FTEQCC="$fteqccdir/fteqcc.bin"

# prepare root
rm -rf "$tmpdir/data/qcsrc"
cd "$tmpdir/Docs"
cp "$dpdir/darkplaces.txt" .
cd "$tmpdir/data"
mv common-spog.pk3 ..
perl -pi -e '/^set g_nexuizversion "?([0-9.]*)[^"]*"?/ and $_ = "set g_nexuizversion '$version'\n"' defaultNexuiz.cfg
if [ -z "$versiontag" ]; then
	perl -pi -e 'm|^//!<showbrand| .. m|^//!>showbrand| and $_ = "";' defaultNexuiz.cfg
	rm -f gfx/brand.tga
fi
echo >> defaultNexuiz.cfg
echo "$defaultcfg" >> defaultNexuiz.cfg

cd "$nexdir/misc/mediasource/menuskins/wickedz/background_builder"
sh append.sh "`echo "$version" | sed 's/svn/s/g'`" "$tmpdir/data/gfx/menu/wickedz/"
cd "$tmpdir/data"

mk7z ../data.pk3 .

cd "$tmpdir/havoc"
mk7z ../havoc.pk3 .

# make data pk3
cd "$tmpdir"
rm -rf data
mkdir data
mv data.pk3 data/data$tag$date.pk3
mv common-spog.pk3 data/
rm -rf havoc
mkdir havoc
mv havoc.pk3 havoc/data$tag${date}havoc.pk3

cp -r "$mingwdlls"/* .
# fix up permissions
chmod 644 *.dll *.exe

mkdir extra
cd extra
wget http://www.icculus.org/netradiant/files/netradiant-${netradiant_release}-win32.zip
#echo "Downloading netradiant, press enter and type the PWs"
#read -r DUMMY
#scp divverent@icculus.org:netradiant-webspace/files/netradiant-${netradiant_release}-win32.zip .
unzip netradiant-${netradiant_release}-win32.zip
mv NetRadiant netradiant-${netradiant_release}-win32
rm -f netradiant-${netradiant_release}-win32.zip
wget http://www.icculus.org/netradiant/files/netradiant-${netradiant_release}-osxintel.zip
#scp divverent@icculus.org:netradiant-webspace/files/netradiant-${netradiant_release}-osxintel.zip .
unzip netradiant-${netradiant_release}-osxintel.zip
mv NetRadiant.app NetRadiant-${netradiant_release}-osxintel.app
rm -f netradiant-${netradiant_release}-osxintel.zip
cat >> unsupported.txt <<EOF
This directory contains NetRadiant, a stabilized Q3 map editor,
configured for Nexuiz.

It is not officially supported by Alientrap.

Website: http://www.icculus.org/netradiant/
EOF
cd ..

# make main structure
mkdir Nexuiz
mv * Nexuiz/ || true

find . -name .svn -exec rm -rf {} \; -prune

rm -f "$zipdir/nexuiz$date$ext.zip"
zip $zipflags -9yr "$zipdir/nexuiz$date$ext.zip"           Nexuiz/gpl.txt Nexuiz/nexuiz* Nexuiz/Nexuiz* Nexuiz/*.dll Nexuiz/sources Nexuiz/Docs Nexuiz/readme.html Nexuiz/server Nexuiz/data/data$tag$date.pk3 Nexuiz/data/common-spog.pk3 Nexuiz/havoc/* Nexuiz/extra/*
ln -snf nexuiz$date$ext.zip "$zipdir/nexuiz-$newest.zip"

rm -f "$zipdir/nexuizengineonly$date$ext.zip"
zip $zipflags -9yr "$zipdir/nexuizengineonly$date$ext.zip" Nexuiz/gpl.txt Nexuiz/nexuiz* Nexuiz/Nexuiz* Nexuiz/*.dll
ln -snf nexuizengineonly$date$ext.zip "$zipdir/nexuizengineonly-$newest.zip"

rm -f "$zipdir/nexuizsource$date$ext.zip"
zip $zipflags -9yr "$zipdir/nexuizsource$date$ext.zip"     Nexuiz/gpl.txt                                            Nexuiz/sources
ln -snf nexuizsource$date$ext.zip "$zipdir/nexuizsource-$newest.zip"

# TODO remove these excludes after the version after 2.4.2
$zipdiff -o "Nexuiz/data/data$tag$date""patch.pk3" -f "$basepk3" -t Nexuiz/data/data$tag$date.pk3
[ -n "$hotbasepk3" ] && $zipdiff -o "Nexuiz/data/data$tag$date""hotfix.pk3" -f "$hotbasepk3" -t Nexuiz/data/data$tag$date.pk3
mkdir -p gfx
if unzip "Nexuiz/data/data$tag$date.pk3" gfx/brand.tga; then
	zip -9r "Nexuiz/data/data$tag$date""patch.pk3" gfx/brand.tga
	[ -n "$hotbasepk3" ] && zip -9r "Nexuiz/data/data$tag$date""hotfix.pk3" gfx/brand.tga
	rm -rf gfx
fi

rm -f "$zipdir/nexuizpatch$date$ext.zip"
zip $zipflags -9yr "$zipdir/nexuizpatch$date$ext.zip"      Nexuiz/gpl.txt Nexuiz/nexuiz* Nexuiz/Nexuiz* Nexuiz/*.dll Nexuiz/sources Nexuiz/Docs Nexuiz/readme.html Nexuiz/server Nexuiz/data/data$tag$date""patch.pk3 Nexuiz/havoc/*
ln -snf nexuizpatch$date$ext.zip "$zipdir/nexuizpatch-$newest.zip"

[ -n "$hotbasepk3" ] && rm -f "$zipdir/nexuizhotfix$date$ext.zip"
[ -n "$hotbasepk3" ] && zip $zipflags -9yr "$zipdir/nexuizhotfix$date$ext.zip"      Nexuiz/gpl.txt Nexuiz/nexuiz* Nexuiz/Nexuiz* Nexuiz/*.dll Nexuiz/sources Nexuiz/Docs Nexuiz/readme.html Nexuiz/server Nexuiz/data/data$tag$date""hotfix.pk3 Nexuiz/havoc/*
[ -n "$hotbasepk3" ] && ln -snf nexuizhotfix$date$ext.zip "$zipdir/nexuizhotfix-$newest.zip"

rm -f "$zipdir/nexuizdocs$date$ext.zip"
zip $zipflags -9yr "$zipdir/nexuizdocs$date$ext.zip"       Nexuiz/gpl.txt Nexuiz/Docs Nexuiz/readme.html
ln -snf nexuizdocs$date$ext.zip "$zipdir/nexuizdocs-$newest.zip"

rm -f "$zipdir/nexuizdebug$date$ext.zip"
zip $zipflags -9yr "$zipdir/nexuizdebug$date$ext.zip"      Nexuiz/gpl.txt Nexuiz/debuginfo/* Nexuiz/sources
ln -snf nexuizdebug$date$ext.zip "$zipdir/nexuizdebug-$newest.zip"

case "$versiontag" in
	test)
		;;
	*)
		cat <<'EOF'

NOTE: This is a RELEASE BUILD.

To upload and finish the build, these things have to be done:

- Test the build:
  - On Linux/ATI
  - On Vista/nvidia
  - On Vista/ATI
  - On Vista/Intel
  - On OSX/ATI
  - Turn on "developer 1"; watch out for suspicious messages.
  - While testing, make sure all campaign levels are tested. In CTF/KH levels,
    try to do a capture. After that, finish the game by prvm_edictset server 1
    frags 1000.
  - Play on a server running the new code. Ideally, that server should be public
    and "somewhat compatible" to old clients, and some other players should be
    on it.
- Post the build on the forum as a test release. E.g. run this script again
  with the "version" variable NOT SET, so the build gets marked "testing only",
  and upload it and post it on the forum for testing. Mention the test server
  that is already running the new code. Wait for at least one week for critical
  bug reports.
- If needed, fix the reported bugs and re-run this script for a release build.
  Possibly repeat the testing process.
- Upload the "final" build you have just made to Sourceforge (upload.sf.net,
  incoming). Use the naming scheme nexuiz-25.zip, nexuizpatch-24-to-25.zip
- Make the download available on sourceforge.
- Announce the build on the forum; update the downloads website. Note that the
  download may be still unavailable because of the SF mirror system.
- Wait for the mirrors to catch up.
- Edit the website: make a new news item for the new release, change the logo
  image in the top left for the new version (ask [-z-]).

EOF
		;;
esac