6 # pw=foo extract password
7 # version=2.5 make a FINAL build
8 # tag=FOO insert FOO before the date in build names
12 # customizable specific stuff
13 netradiant_release=1.5.0-svn402
14 basepk3=$base/data20090403.pk3 # 2.5
15 hotbasepk3=$base/data20091001.pk3 # hotfix
17 havocdir=$base/nexuiz/havoc
18 dpdir=$base/darkplaces
21 buildfiles=$base/nexuiz/misc/buildfiles
22 mingwdlls=$buildfiles/w32
23 osxapps=$buildfiles/osx
24 copystrip=$buildfiles/copystrip
25 zipdiff=$base/nexuiz/misc/tools/zipdiff
26 fteqccdir="$base/fteqcc"
30 # end system specific stuff
41 : ${date:=`date +%Y%m%d`}
43 echo "date stamp: $date"
54 versiontag=$versiontag
62 7za a -tzip -mx=9 "$@"
66 #if [ -n "$EXPERIMENTAL" ]; then
67 # basepk3=$base/data20071231.pk3 # newer build to make smaller patches
71 # TODO normalize the builds
72 platforms='x86 amd64 osx'
89 rm -f "$fteqccdir"/*.o
90 rm -f "$fteqccdir"/*.bin
91 rsync --exclude "*.o" --exclude "*.d" --exclude "nexuiz-*" --delete-excluded --delete -zvaSHP . "$copystrip" "$fteqccdir" "$host:$path"
92 ssh "$host" ". ~/.profile && cd $path && COPYSTRIP_STRIP=$strip PATH=$path/copystrip:\$PATH make $makeflags clean nexuiz && cd ${fteqccdir##*/} && make $makeflags $fteqcc_cflags"
93 rsync --exclude "*.o" --exclude "*.d" --delete-excluded --delete -zvaSHP "$host:$path/." .
94 for P in -dedicated -sdl -glx -wgl -agl -dedicated.exe -sdl.exe .exe; do
95 [ -f nexuiz$P ] && mv nexuiz$P "$tmpdir/$prefix$P"
96 [ -f nexuiz$P-withdebug ] && mv nexuiz$P-withdebug "$tmpdir/debuginfo/$prefix$P"
97 [ -f nexuiz$P.dSYM ] && mv nexuiz$P.dSYM "$tmpdir/debuginfo/$prefix$P.dSYM"
101 mv "${fteqccdir##*/}"/fteqcc.exe "$tmpdir/fteqcc/$fteqccname"
104 mv "${fteqccdir##*/}"/fteqcc.bin "$tmpdir/fteqcc/$fteqccname"
112 # 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
113 buildon nex686build nexuiz fteqcc.exe /tmp/Darkplaces.build 'DP_MAKE_TARGET=mingw CC="$HOME/mingw32/bin/i386-mingw32-gcc -g -DSUPPORTDIRECTX -I$HOME/dxheaders" WINDRES="$HOME/mingw32/bin/i386-mingw32-windres" SDL_CONFIG="$HOME/sdl-win32/SDL-1.2.13/bin/sdl-config"' '"$HOME/mingw32/bin/i386-mingw32-strip"'
114 buildon nex686build nexuiz-linux-686 fteqcc-linux-686 /tmp/Darkplaces.build 'CC="gcc -g -Wl,--hash-style=sysv" 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
115 # 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
116 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
117 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
118 mv "$tmpdir/nexuiz-osx-agl" "$tmpdir/Nexuiz.app/Contents/MacOS/nexuiz-osx-agl-bin"
119 mv "$tmpdir/nexuiz-osx-sdl" "$tmpdir/Nexuiz-SDL.app/Contents/MacOS/nexuiz-osx-sdl-bin"
124 while [ -f "$zipdir/nexuiz$date$i$ext.zip" ]; do
128 i=`echo "$i" | tr a-y b-z`
133 echo "Using build name nexuiz$date$ext"
137 conflicts=`find "$dpdir" "$nexdir" -name '*.orig' -o -name '*.rej' -o -name '*.mine' -o -name '.#*' -o -name '.*~'`
138 if [ -n "$conflicts" ]; then
139 echo "CONFLICTS OR UNNEEDED FILES HAVE BEEN FOUND!"
140 echo "NOT PROCEEDING"
152 # clean up and patch DP
156 if [ -s patches/series ]; then
157 quilt push -a # apply all patches
160 # prepare directory structure
161 cp -r "$osxapps"/*.app "$tmpdir"
162 mkdir "$tmpdir/debuginfo"
163 mkdir "$tmpdir/fteqcc"
165 # prepare fteqcc build
167 git checkout-index -a -f --prefix="$tmpdir/fteqcc/source/"
168 git log -1 > "$tmpdir/fteqcc/source/fteqcc-base-revision.txt"
169 fteqccrev=`git show --pretty=%ct-%H | head -n 1`
170 echo "fteqcc rev $fteqccrev"
172 # build all executables
178 rm -rf fteqcc copystrip
181 # move shell scripts and license
183 cp "$nexdir/"nexuiz-*.sh "$tmpdir/"
184 cp "$nexdir/gpl.txt" "$tmpdir/"
185 cp "$nexdir/readme.html" "$tmpdir/"
189 svn export . "$tmpdir/data"
190 svn info . > "$tmpdir/data/nexuiz-data-base-revision.txt"
191 svn log > "$tmpdir/data/ChangeLog"
195 svn export . "$tmpdir/havoc"
199 svn export . "$tmpdir/Docs"
203 svn export . "$tmpdir/server"
207 mkdir -p "$tmpdir/sources"
208 mk7z ../sources/gamesource$date.zip qcsrc nexuiz-data-base-revision.txt ChangeLog
212 svn export . "$tmpdir/darkplaces"
213 svn info > "$tmpdir/darkplaces/nexuiz-base-revision.txt"
214 svn diff > "$tmpdir/darkplaces/nexuiz-engine-changes.diff"
215 svn log > "$tmpdir/darkplaces/ChangeLog"
217 mk7z "$tmpdir/sources/enginesource$date.zip" "darkplaces"
220 # make fteqcc archive
222 zip -9r "$tmpdir/sources/fteqcc-binaries-and-source-rev$fteqccrev.zip" "fteqcc"
230 # make local compiler
232 make FTEQCC="$fteqccdir/fteqcc.bin"
235 rm -rf "$tmpdir/data/qcsrc"
237 cp "$dpdir/darkplaces.txt" .
239 mv common-spog.pk3 ..
240 perl -pi -e '/^set g_nexuizversion "?([0-9.]*)[^"]*"?/ and $_ = "set g_nexuizversion '$version'\n"' defaultNexuiz.cfg
241 if [ -z "$versiontag" ]; then
242 perl -pi -e 'm|^//!<showbrand| .. m|^//!>showbrand| and $_ = "";' defaultNexuiz.cfg
245 echo >> defaultNexuiz.cfg
246 echo "$defaultcfg" >> defaultNexuiz.cfg
248 cd "$nexdir/misc/mediasource/menuskins/wickedz/background_builder"
249 sh append.sh "`echo "$version" | sed 's/svn/s/g'`" "$tmpdir/data/gfx/menu/wickedz/"
261 mv data.pk3 data/data$tag$date.pk3
262 mv common-spog.pk3 data/
265 mv havoc.pk3 havoc/data$tag${date}havoc.pk3
267 cp -r "$mingwdlls"/* .
269 chmod 644 *.dll *.exe
273 wget http://www.icculus.org/netradiant/files/netradiant-${netradiant_release}-win32.zip
274 #echo "Downloading netradiant, press enter and type the PWs"
276 #scp divverent@icculus.org:netradiant-webspace/files/netradiant-${netradiant_release}-win32.zip .
277 unzip netradiant-${netradiant_release}-win32.zip
278 mv NetRadiant netradiant-${netradiant_release}-win32
279 rm -f netradiant-${netradiant_release}-win32.zip
280 wget http://www.icculus.org/netradiant/files/netradiant-${netradiant_release}-osxintel.zip
281 #scp divverent@icculus.org:netradiant-webspace/files/netradiant-${netradiant_release}-osxintel.zip .
282 unzip netradiant-${netradiant_release}-osxintel.zip
283 mv NetRadiant.app NetRadiant-${netradiant_release}-osxintel.app
284 rm -f netradiant-${netradiant_release}-osxintel.zip
285 cat >> unsupported.txt <<EOF
286 This directory contains NetRadiant, a stabilized Q3 map editor,
287 configured for Nexuiz.
289 It is not officially supported by Alientrap.
291 Website: http://www.icculus.org/netradiant/
295 # make main structure
299 find . -name .svn -exec rm -rf {} \; -prune
301 rm -f "$zipdir/nexuiz$date$ext.zip"
302 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/*
303 ln -snf nexuiz$date$ext.zip "$zipdir/nexuiz-$newest.zip"
305 rm -f "$zipdir/nexuizengineonly$date$ext.zip"
306 zip $zipflags -9yr "$zipdir/nexuizengineonly$date$ext.zip" Nexuiz/gpl.txt Nexuiz/nexuiz* Nexuiz/Nexuiz* Nexuiz/*.dll
307 ln -snf nexuizengineonly$date$ext.zip "$zipdir/nexuizengineonly-$newest.zip"
309 rm -f "$zipdir/nexuizsource$date$ext.zip"
310 zip $zipflags -9yr "$zipdir/nexuizsource$date$ext.zip" Nexuiz/gpl.txt Nexuiz/sources
311 ln -snf nexuizsource$date$ext.zip "$zipdir/nexuizsource-$newest.zip"
313 # TODO remove these excludes after the version after 2.4.2
314 $zipdiff -o "Nexuiz/data/data$tag$date""patch.pk3" -f "$basepk3" -t Nexuiz/data/data$tag$date.pk3
315 [ -n "$hotbasepk3" ] && $zipdiff -o "Nexuiz/data/data$tag$date""hotfix.pk3" -f "$hotbasepk3" -t Nexuiz/data/data$tag$date.pk3
317 if unzip "Nexuiz/data/data$tag$date.pk3" gfx/brand.tga; then
318 zip -9r "Nexuiz/data/data$tag$date""patch.pk3" gfx/brand.tga
319 [ -n "$hotbasepk3" ] && zip -9r "Nexuiz/data/data$tag$date""hotfix.pk3" gfx/brand.tga
323 rm -f "$zipdir/nexuizpatch$date$ext.zip"
324 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/*
325 ln -snf nexuizpatch$date$ext.zip "$zipdir/nexuizpatch-$newest.zip"
327 [ -n "$hotbasepk3" ] && rm -f "$zipdir/nexuizhotfix$date$ext.zip"
328 [ -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/*
329 [ -n "$hotbasepk3" ] && ln -snf nexuizhotfix$date$ext.zip "$zipdir/nexuizhotfix-$newest.zip"
331 rm -f "$zipdir/nexuizdocs$date$ext.zip"
332 zip $zipflags -9yr "$zipdir/nexuizdocs$date$ext.zip" Nexuiz/gpl.txt Nexuiz/Docs Nexuiz/readme.html
333 ln -snf nexuizdocs$date$ext.zip "$zipdir/nexuizdocs-$newest.zip"
335 rm -f "$zipdir/nexuizdebug$date$ext.zip"
336 zip $zipflags -9yr "$zipdir/nexuizdebug$date$ext.zip" Nexuiz/gpl.txt Nexuiz/debuginfo/* Nexuiz/sources
337 ln -snf nexuizdebug$date$ext.zip "$zipdir/nexuizdebug-$newest.zip"
339 case "$versiontag" in
341 # these builds are public
342 ssh atoffload "sh clean-builds.sh"
343 rsync -vaSHP "$zipdir/nexuiz"*"$date$ext.zip" "$zipdir/nexuiz"*"-$newest.zip" atoffload:offload.alientrap.org/nexuiz/builds/
346 ssh atoffload "sh clean-builds.sh"
347 rsync -vaSHP "$zipdir/nexuiz"*"$date$ext.zip" "$zipdir/nexuiz"*"-$newest.zip" atoffload:offload.alientrap.org/nexuiz/builds.versioned/
350 NOTE: This is a RELEASE BUILD.
352 To upload and finish the build, these things have to be done:
360 - Turn on "developer 1"; watch out for suspicious messages.
361 - While testing, make sure all campaign levels are tested. In CTF/KH levels,
362 try to do a capture. After that, finish the game by prvm_edictset server 1
364 - Play on a server running the new code. Ideally, that server should be public
365 and "somewhat compatible" to old clients, and some other players should be
367 - Post the build on the forum as a test release. E.g. run this script again
368 with the "version" variable NOT SET, so the build gets marked "testing only",
369 and upload it and post it on the forum for testing. Mention the test server
370 that is already running the new code. Wait for at least one week for critical
372 - If needed, fix the reported bugs and re-run this script for a release build.
373 Possibly repeat the testing process.
374 - Upload the "final" build you have just made to Sourceforge (upload.sf.net,
375 incoming). Use the naming scheme nexuiz-25.zip, nexuizpatch-24-to-25.zip
376 - Make the download available on sourceforge.
377 - Announce the build on the forum; update the downloads website. Note that the
378 download may be still unavailable because of the SF mirror system.
379 - Wait for the mirrors to catch up.
380 - Edit the website: make a new news item for the new release, change the logo
381 image in the top left for the new version (ask [-z-]).