]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/tools/all/release.subr
Same sync for OS X.
[xonotic/xonotic.git] / misc / tools / all / release.subr
1 release_common()
2 {
3         export LC_ALL=C
4
5         release_args="$cmd $*"
6         msg "*** $release_args: start"
7         release_starttime=`date +%s`
8         release_end()
9         {
10                 release_endtime=`date +%s`
11                 release_deltatime=$(($release_endtime - $release_starttime))
12                 msg "*** $release_args: $release_deltatime seconds"
13         }
14         trap release_end EXIT
15         release_tempstarttime=$release_starttime
16         release_timereport()
17         {
18                 release_endtime=`date +%s` # RELEASE NOW!!!
19                 if [ -n "$*" ]; then
20                         release_deltatime=$(($release_endtime - $release_tempstarttime))
21                         msg "**** $release_args: $*: $release_deltatime seconds"
22                 fi
23                 release_tempstarttime=$release_endtime
24         }
25         release_git_extract_dir()
26         {
27                 release_src=$1; shift
28                 release_dst=$1; shift
29                 # try to create a hardlink
30                 if ln -f "$release_src/.git/HEAD" "$release_dst/.hardlink-test"; then
31                         rm -f "$release_dst/.hardlink-test"
32                         {
33                                 verbose cd "$release_src"
34                                 git ls-files HEAD -- "$@"
35                         } | {
36                                 while IFS= read -r F; do
37                                         case "$F" in */*) mkdir -p "$release_dst/${F%/*}" ;; esac
38                                         verbose ln -f "$release_src/$F" "$release_dst/$F"
39                                 done
40                         }
41                 else
42                         {
43                                 verbose cd "$release_src"
44                                 verbose git archive --format=tar HEAD -- "$@"
45                         } | {
46                                 verbose cd "$release_dst"
47                                 verbose tar xvf -
48                         }
49                 fi
50         }
51
52         mkzipr()
53         {
54                 archive=$1; shift
55
56                 # get rid of this hack once we have done large enough changes
57                 # to be no longer rsync compatible (and then enable the below
58                 # code)
59                 sevenzipflags=-mx=9
60                 zipflags=-9
61                 find "$@" -exec touch -d "2001-01-01 01:01:01 +0000" {} \+ # ugly hack to make the pk3 files rsync-friendly
62                 ziplist=`mktemp`
63                 find "$@" -xtype f \( -executable -or -type l \) -print | sed 's,\([./][^./]*$\),\1 \1,' | sort -k2 | cut -d\  -f1 > "$ziplist"
64                 7za a -tzip $sevenzipflags -x@"$ziplist" "$archive" "$@" || true
65                 zip         $zipflags -y   -@<"$ziplist" "$archive"      || true
66                 rm -f "$ziplist"
67
68                 #zipflags=-1r
69                 #find "$@" -exec touch -d "2001-01-01 01:01:01 +0000" {} \+ # ugly hack to make the pk3 files rsync-friendly
70                 #zip $zipflags -y "$archive" "$@" || true
71                 #advzip -4 "$archive"
72         }
73
74         mkzip()
75         {
76                 archive=$1; shift
77                 zipflags=-1ry
78                 zip $zipflags "$archive" "$@" || true
79                 advzip -z -4 "$archive"
80         }
81
82         mkzip0()
83         {
84                 archive=$1; shift
85                 zipflags=-0ry
86                 zip $zipflags "$archive" "$@" || true
87         }
88
89         getversion()
90         {
91                 gv=`grep "^gameversion " "$1/xonotic-common.cfg" | awk '{ print $2 }'`
92                 major=$(($gv / 10000))
93                 minor=$((($gv / 100) - ($major * 100)))
94                 patch=$(($gv - ($major * 10000) - ($minor * 100)))
95                 versionstr="$major.$minor.$patch"
96         }
97 }
98
99 handled=true
100 case "$cmd" in
101         # release building goes here
102         release-prepare)
103                 release_common
104                 #"$SELF" each git clean -fxd
105                 case "$RELEASETYPE" in
106                         '')
107                                 $ECHO >&2 -n "$ESC[2J$ESC[H"
108                                 msg ""
109                                 msg ""
110                                 msg ""
111                                 msg ""
112                                 msg ""
113                                 msg ""
114                                 msg "        +---------------------------------------------------------.---+"
115                                 msg "        | NOTE                                                    | X |"
116                                 msg "        +---------------------------------------------------------^---+"
117                                 msg "        |   ____                                                      |"
118                                 msg "        |  /    \  This is the official release build system.         |"
119                                 msg "        | |      | If you are not a member of the Xonotic Core Team,  |"
120                                 msg "        | | STOP | you are not supposed to use this script and should |"
121                                 msg "        | |      | instead use ./all compile to compile the engine    |"
122                                 msg "        |  \____/  and game code.                                     |"
123                                 msg "        |                                                             |"
124                                 msg "        |                      [ I understand ]                       |"
125                                 msg "        +-------------------------------------------------------------+"
126                                 sleep 10
127                                 # A LOT of build infrastructure is required:
128                                 # - vorbis-tools
129                                 # - ImageMagick
130                                 # - .ssh/config must be configured so the following
131                                 #   host names are reachable and have a compile
132                                 #   infrastructure set up:
133                                 #   - xonotic-build-linux64 (with gcc on x86_64)
134                                 #   - xonotic-build-win32 (with i686-w64-mingw32)
135                                 #   - xonotic-build-win64 (with x86_64-w64-mingw32)
136                                 #   - xonotic-build-osx (with Xcode and SDL.framework)
137                                 # - AMD Compressonator installed in WINE
138                                 # - ResEdit installed in WINE
139                                 # - a lot of other requirements you will figure out
140                                 #   while reading the error messages
141                                 # - environment variable RELEASETYPE set
142                                 # - optionally, environment variable RELEASEDATE set
143                                 #   (YYYYMMDD)
144                                 exit 1
145                                 ;;
146                         release)
147                                 msg "Building a FINISHED RELEASE"
148                                 getversion data/xonotic-data.pk3dir
149                                 verbose "$SELF" each -k git tag -m "TEMP TAG" -f "xonotic-v$versionstr"
150                                 ;;
151                         *)
152                                 msg "Building a $RELEASETYPE"
153                                 ;;
154                 esac
155                 verbose rm -rf Xonotic Xonotic*.zip
156                 verbose mkdir -p Xonotic
157                 if [ -n "$RELEASEDATE" ]; then
158                         verbose $ECHO "$RELEASEDATE" > Xonotic/stamp.txt
159                         case "$RELEASETYPE" in
160                                 release)
161                                         verbose $ECHO "${RELEASEDATE%_*}" > Xonotic/pk3stamp.txt
162                                         ;;
163                                 *)
164                                         verbose $ECHO "$RELEASEDATE" > Xonotic/pk3stamp.txt
165                                         ;;
166                         esac
167                 else
168                         verbose date +%Y%m%d > Xonotic/stamp.txt
169                         verbose date +%Y%m%d > Xonotic/pk3stamp.txt
170                 fi
171                 release_git_extract_dir "." "Xonotic" Docs misc server xonotic-linux-glx.sh xonotic-linux-sdl.sh xonotic-linux-dedicated.sh Makefile misc/buildfiles key_0.d0pk COPYING GPL-2 GPL-3
172                 (
173                         verbose cd Xonotic
174                         verbose mkdir data source source/darkplaces source/gmqcc source/d0_blind_id mapping
175                         verbose rm -rf misc/builddeps
176                         verbose mv misc/buildfiles/win32 bin32 || true
177                         verbose mv bin32/SDL.dll . || true
178                         verbose mv misc/buildfiles/win64 bin64 || true
179                         verbose mv misc/buildfiles/osx/* . || true
180                         verbose rm -rf misc/buildfiles
181                         verbose rm -rf misc/pki
182                 )
183                 release_git_extract_dir "darkplaces" "Xonotic/source/darkplaces" .
184                 release_git_extract_dir "gmqcc" "Xonotic/source/gmqcc" .
185                 release_git_extract_dir "data/xonotic-data.pk3dir" "Xonotic/source" qcsrc Makefile
186                 release_git_extract_dir "d0_blind_id" "Xonotic/source/d0_blind_id" .
187                 (
188                         verbose cd Xonotic/source/d0_blind_id
189                         verbose sh autogen.sh
190                 )
191                 rm -f Xonotic/key_15.d0pk
192                 (
193                         verbose cd Xonotic/mapping
194                         verbose wget http://www.icculus.org/netradiant/files/netradiant-1.5.0-20120301.tar.bz2
195                         verbose wget http://www.icculus.org/netradiant/files/netradiant-1.5.0-20120301-win32-7z.exe
196                         for X in *-7z.exe; do
197                                 7za x "$X"
198                                 rm -f "$X"
199                         done
200                         # TODO possibly include other tools?
201                 )
202                 ./all each git rev-parse HEAD > Xonotic/misc/git-revisions.txt
203                 ;;
204         release-compile-run)
205                 release_common
206                 host=$1
207                 buildpath=$2
208                 maketargets=$3
209                 makeflags=$4
210                 srcdir=$5
211                 depsdir=$6
212                 targetfiles=$7
213                 set -x
214                 if [ -z "$targetfiles" ]; then
215                         exit
216                 fi
217                 case " $HOSTS_THAT_ARE_DISABLED " in
218                         *\ $host\ *)
219                                 exit
220                                 ;;
221                 esac
222                 case " $HOSTS_THAT_ARE_MYSELF " in
223                         *\ $host\ *)
224                                 verbose rsync --delete -zLvaSHP "$srcdir"/ "$buildpath/"
225                                 verbose rsync --delete -zLvaSHP misc/logos/icons_ico/xonotic.ico "$buildpath"/darkplaces.ico
226                                 verbose rsync --delete -zLvaSHP "$depsdir"/*/ "$buildpath.deps/"
227                                 verbose ln -snf "$buildpath.deps" "$buildpath/.deps"
228                                 verbose eval make -C "$buildpath" clean $maketargets $makeflags
229                                 for f in $targetfiles; do
230                                         verbose mv "$buildpath/${f%:*}" "${f##*:}" || true
231                                 done
232                                 ;;
233                         *)
234                                 verbose rsync --delete -zLvaSHP "$srcdir"/ "$host":"$buildpath/"
235                                 verbose rsync --delete -zLvaSHP misc/logos/icons_ico/xonotic.ico "$host":"$buildpath"/darkplaces.ico
236                                 verbose rsync --delete -zLvaSHP "$depsdir"/*/ "$host":"$buildpath.deps/"
237                                 verbose ssh "$host" "[ -f /etc/profile ] && . /etc/profile; [ -f ~/.profile ] && . ~/.profile; export LC_ALL=C; ln -snf $buildpath.deps $buildpath/.deps && cd $buildpath && nice -`nice` make clean $maketargets $makeflags"
238                                 for f in $targetfiles; do
239                                         verbose rsync -zvaSHP "$host:$buildpath/${f%:*}" "${f##*:}" || true
240                                 done
241                                 ;;
242                 esac
243                 ;;
244         release-compile)
245                 release_common
246                 suffix=$1
247                 makeflags=$2
248                 darkplaces_maketargets=$3
249                 darkplaces_files=$4
250                 host=xonotic-build-$suffix
251                 verbose "$SELF" release-compile-run "$host" /tmp/Darkplaces.build."$suffix" "$darkplaces_maketargets" "$makeflags" "Xonotic/source/darkplaces" "$d0/misc/builddeps/$suffix" "$darkplaces_files"
252                 ;;
253         release-getbinary)
254                 release_common
255                 binary=$1
256                 basename=${binary##*/}
257                 dpname=darkplaces${basename#xonotic}
258                 rev=`( cd "$d0/darkplaces" && git rev-parse HEAD )`
259                 verbose wget -O "$binary" "http://beta.xonotic.org/autobuild-bin/$rev/$dpname"
260                 [ -s "$binary" ] || rm -f "$binary"
261                 [ -f "$binary" ]
262                 case "$binary" in
263                         Xonotic/*osx*|Xonotic/*linux*)
264                                 chmod +x "$binary"
265                                 ;;
266                 esac
267                 ;;
268         release-engine-win32)
269                 release_common
270                 #good=true
271                 #verbose "$SELF" release-getbinary Xonotic/xonotic-x86.exe || good=false
272                 #verbose "$SELF" release-getbinary Xonotic/xonotic-x86-dedicated.exe || good=false
273                 #$good
274                 verbose "$SELF" release-compile win32 \
275                         'STRIP=: D3D=1 DP_MAKE_TARGET=mingw UNAME=MINGW32 WIN32RELEASE=1
276                         'CC="i686-w64-mingw32-gcc -static -g1 -mstackrealign -Wl,--dynamicbase -Wl,--nxcompat -I../../../.deps/include -L../../../.deps/lib -DSUPPORTIPV6" WINDRES="i686-w64-mingw32-windres" SDL_CONFIG="../../../.deps/bin/sdl2-config" DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_ZLIB=dlopen' \
277                         release 'darkplaces.exe:Xonotic/xonotic.exe darkplaces-sdl.exe:Xonotic/xonotic-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated.exe'
278                 ;;
279         release-engine-win64)
280                 release_common
281                 #good=true
282                 #verbose "$SELF" release-getbinary Xonotic/xonotic.exe || good=false
283                 #verbose "$SELF" release-getbinary Xonotic/xonotic-dedicated.exe || good=false
284                 #$good
285                 verbose "$SELF" release-compile win64 \
286                         'STRIP=: D3D=1 DP_MAKE_TARGET=mingw UNAME=MINGW32 WIN64RELEASE=1 CC="x86_64-w64-mingw32-gcc -static -g1 -Wl,--dynamicbase -Wl,--nxcompat -I../../../.deps/include -L../../../.deps/lib -DSUPPORTIPV6" WINDRES="x86_64-w64-mingw32-windres" SDL_CONFIG="../../../.deps/bin/sdl2-config" DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_ZLIB=dlopen' \
287                         release 'darkplaces.exe:Xonotic/xonotic-x64.exe darkplaces-sdl.exe:Xonotic/xonotic-x64-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-x64-dedicated.exe'
288                 ;;
289         release-engine-osx)
290                 release_common
291                 #good=true
292                 #verbose "$SELF" release-getbinary Xonotic/Xonotic.app/Contents/MacOS/xonotic-osx-sdl-bin || good=false
293                 #verbose "$SELF" release-getbinary Xonotic/xonotic-osx-dedicated || good=false
294                 #$good
295                 # Note: travis build script also had SDLCONFIG_MACOSX* flags; need to check if they're still needed with osxcross.
296                 verbose "$SELF" release-compile osx \
297                         'STRIP=: CC="gcc -g1 -arch x86_64 -mmacosx-version-min=10.6 -Wl,-rpath -Wl,@loader_path/../Frameworks -Wl,-rpath -Wl,@loader_path -I../../../.deps/include -L../../../.deps/lib -DSUPPORTIPV6" DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_ZLIB=shared' \
298                         'sv-release sdl-release' 'darkplaces-sdl:Xonotic/Xonotic.app/Contents/MacOS/xonotic-osx-sdl-bin darkplaces-dedicated:Xonotic/xonotic-osx-dedicated'
299                 ;;
300         release-engine-linux64)
301                 release_common
302                 #good=true
303                 #verbose "$SELF" release-getbinary Xonotic/xonotic-linux64-sdl || good=false
304                 #verbose "$SELF" release-getbinary Xonotic/xonotic-linux64-glx || good=false
305                 #verbose "$SELF" release-getbinary Xonotic/xonotic-linux64-dedicated || good=false
306                 #$good
307                 verbose "$SELF" release-compile linux64 \
308                         'STRIP=: CC="gcc -m64 -g1 -I../../../.deps/include -L../../../.deps/lib -DSUPPORTIPV6" DP_LINK_CRYPTO=shared LIB_CRYPTO="../../../.deps/lib/libd0_blind_id.a ../../../.deps/lib/libgmp.a" DP_LINK_CRYPTO_RIJNDAEL=dlopen DP_LINK_JPEG=shared LIB_JPEG=../../../.deps/lib/libjpeg.a DP_LINK_ODE=shared CFLAGS_ODE="-DUSEODE -DLINK_TO_LIBODE -DdDOUBLE" LIB_ODE="../../../.deps/lib/libode.a -lstdc++" DP_LINK_ZLIB=shared' \
309                         release 'darkplaces-glx:Xonotic/xonotic-linux64-glx darkplaces-sdl:Xonotic/xonotic-linux64-sdl darkplaces-dedicated:Xonotic/xonotic-linux64-dedicated'
310                 ;;
311         release-engine)
312                 release_common
313                 # TODO report failures here.
314                 good=false
315                 verbose "$SELF" release-engine-linux64 && good=true
316                 verbose "$SELF" release-engine-win32 && good=true
317                 verbose "$SELF" release-engine-win64 && good=true
318                 #verbose "$SELF" release-engine-osx && good=true
319                 $good
320                 ;;
321         release-maps)
322                 release_common
323                 verbose "$SELF" update-maps
324                 ;;
325         release-qc)
326                 release_common
327                 verbose make -C "$d0/gmqcc" gmqcc
328                 verbose env GIT_DIR="$d0/data/xonotic-data.pk3dir/.git" make -C Xonotic/source QCC="$d0/gmqcc/gmqcc" XON_BUILDSYSTEM=1 clean qc
329                 ;;
330         release-buildpk3-transform-raw)
331                 release_common
332                 dir=$1
333                 ;;
334         release-buildpk3-transform-normal)
335                 release_common
336                 dir=$1
337                 verbose cd "$dir"
338                 # texture: convert to jpeg and dds
339                 verbose export do_jpeg=true
340                 verbose export jpeg_qual_rgb=97
341                 verbose export jpeg_qual_a=99
342                 verbose export do_dds=false
343                 verbose export do_ogg=true
344                 verbose export ogg_ogg=false
345                 verbose export del_src=true
346                 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
347                 ;;
348         release-buildpk3-transform-normaldds)
349                 release_common
350                 dir=$1
351                 verbose cd "$dir"
352                 # texture: convert to jpeg and dds
353                 # music: reduce bitrate
354                 verbose export do_jpeg=false
355                 verbose export do_jpeg_if_not_dds=true
356                 verbose export jpeg_qual_rgb=95
357                 verbose export jpeg_qual_a=99
358                 verbose export do_dds=true
359                 verbose export dds_flags=
360                 verbose export do_ogg=true
361                 verbose export ogg_ogg=false
362                 verbose export del_src=true
363                 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
364                 ;;
365         release-buildpk3-transform-mapping)
366                 release_common
367                 dir=$1
368                 verbose cd "$dir"
369                 # remove stuff radiant has no use for
370                 verbose find . -name \*_norm.\* -exec rm -f {} \;
371                 verbose find . -name \*_bump.\* -exec rm -f {} \;
372                 verbose find . -name \*_glow.\* -exec rm -f {} \;
373                 verbose find . -name \*_gloss.\* -exec rm -f {} \;
374                 verbose find . -name \*_pants.\* -exec rm -f {} \;
375                 verbose find . -name \*_shirt.\* -exec rm -f {} \;
376                 verbose find . -name \*_reflect.\* -exec rm -f {} \;
377                 verbose find . -not \( -name \*.tga -o -name \*.png -o -name \*.jpg \) -exec rm -f {} \;
378                 # texture: convert to jpeg and dds
379                 # music: reduce bitrate
380                 verbose export do_jpeg=true
381                 verbose export jpeg_qual_rgb=80
382                 verbose export jpeg_qual_a=97
383                 verbose export do_dds=false
384                 verbose export do_ogg=true
385                 verbose export ogg_qual=1
386                 verbose export del_src=true
387                 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
388                 ;;
389         release-buildpk3)
390                 release_common
391                 src=$1
392                 dst=$2
393                 transform=$3
394                 case "$dst" in
395                         /*)
396                                 ;;
397                         */)
398                                 dst="$PWD/$dst"
399                                 ;;
400                 esac
401                 release_timereport
402                 verbose rm -rf Xonotic/temp
403                 release_timereport "deleted temp directory"
404                 verbose mkdir -p Xonotic/temp
405                 release_git_extract_dir "$src" "Xonotic/temp" .
406                 release_timereport "extracted data"
407                 verbose cd Xonotic/temp
408                 if [ x"$src" = x"data/xonotic-data.pk3dir" ]; then
409                         verbose cp ../source/progs.dat .
410                         verbose cp ../source/csprogs.dat .
411                         verbose cp ../source/menu.dat .
412                         # Include line numbers in qc errors
413                         verbose cp ../source/progs.lno .
414                         verbose cp ../source/csprogs.lno .
415                         verbose cp ../source/menu.lno .
416                         verbose rm -rf qcsrc
417                         getversion .
418                         case "$RELEASETYPE" in
419                                 release)
420                                         ;;
421                                 *)
422                                         versionstr="$versionstr$RELEASETYPE"
423                                         ;;
424                         esac
425                         if [ $gv -lt 9900 ]; then
426                                 # pre-1.0: compatible with any other pre-1.0
427                                 verbose sed "
428                                         s/^set g_xonoticversion [^ ]* /set g_xonoticversion $versionstr /;
429                                         s/^gameversion_min [0-9]*/gameversion_min     0/;
430                                         s/^gameversion_max [0-9]*/gameversion_max  9999/;
431                                 " < xonotic-common.cfg > xonotic-common.cfg.new
432                         else
433                                 # >= 1.0
434                                 verbose sed "
435                                         s/^set g_xonoticversion [^ ]* /set g_xonoticversion $versionstr /;
436                                         s/^gameversion_min [0-9]*/gameversion_min $(( ($gv / 100) * 100 - 100 ))/;
437                                         s/^gameversion_max [0-9]*/gameversion_max $(( ($gv / 100) * 100 + 199 ))/;
438                                 " < xonotic-common.cfg > xonotic-common.cfg.new
439                         fi
440                         mv xonotic-common.cfg.new xonotic-common.cfg
441                         case "$RELEASETYPE" in
442                                 release)
443                                         echo "" >> xonotic-common.cfg
444                                         echo "// nicer menu" >> xonotic-common.cfg
445                                         echo "set menu_watermark \"\"" >> xonotic-common.cfg
446                                         ;;
447                         esac
448                         (
449                                 verbose cd gfx/menu/luminos
450                                 verbose rm -f background_l2.tga background_ingame_l2.tga
451                                 verbose cp "$d0"/mediasource/gfx/menu/luminos_versionbuilder/background_l2.svg .
452                                 verbose "$d0"/mediasource/gfx/menu/luminos_versionbuilder/versionbuilder "$versionstr"
453                                 verbose rm background_l2.svg
454                         )
455                         verbose "$d0"/mediasource/gfx/luma/render-version.sh "$d0/mediasource/gfx/luma" "$PWD" "$versionstr"
456                 fi
457                 if [ x"$src" = x"data/xonotic-maps.pk3dir" ]; then
458                         for X in ../../data/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
459                                 if [ -f "$X" ]; then
460                                         verbose unzip "$X"
461                                         verbose rm -f maps/*.log maps/*.irc maps/*.lin
462                                 fi
463                         done
464                 fi
465                 verbose export git_src_repo="$d0/$src" # skip hash-object
466                 release_timereport "processed data"
467                 verbose "$SELF" release-buildpk3-transform-$transform "Xonotic/temp"
468                 release_timereport "transformed data"
469                 find . -type f -size +4k | verbose "$d0"/misc/tools/symlink-deduplicate.sh
470                 release_timereport "deduplicated data"
471                 verbose mkzipr "../../$dst" *
472                 release_timereport "zipped data"
473                 verbose cd ../..
474                 verbose rm -rf Xonotic/temp
475                 release_timereport "deleted temp directory again"
476                 ;;
477         release-buildpk3s)
478                 release_common
479                 pk3stamp=`cat Xonotic/pk3stamp.txt`
480                 src=$1
481                 shift
482                 dst=${src%.pk3dir}
483                 case "$dst" in
484                         data/xonotic-*)
485                                 dst="data/xonotic-$pk3stamp-${dst#data/xonotic-}"
486                                 ;;
487                         *)
488                                 dst="$dst-$pk3stamp"
489                                 ;;
490                 esac
491                 while [ "$#" -gt 1 ]; do
492                         verbose "$SELF" release-buildpk3 "$src" "Xonotic/$dst$2.pk3" "$1"
493                         shift
494                         shift
495                 done
496                 ;;
497         release-pack)
498                 release_common
499                 verbose "$SELF" release-buildpk3s data/font-unifont.pk3dir      raw ''
500                 verbose "$SELF" release-buildpk3s data/font-xolonium.pk3dir     raw ''
501                 verbose "$SELF" release-buildpk3s data/xonotic-data.pk3dir             normaldds ''                    normal '-high'
502                 verbose "$SELF" release-buildpk3s data/xonotic-maps.pk3dir             normaldds '' mapping '-mapping' normal '-high'
503                 verbose "$SELF" release-buildpk3s data/xonotic-music.pk3dir     raw ''
504                 verbose "$SELF" release-buildpk3s data/xonotic-nexcompat.pk3dir        normaldds ''                    normal '-high'
505                 ;;
506         release-pack-needsx11)
507                 release_common
508                 case "$DISPLAY" in
509                         '')
510                                 verbose startx "$SELF" release-pack -- /usr/bin/Xvfb :7
511                                 ;;
512                         *)
513                                 verbose "$SELF" release-pack
514                                 ;;
515                 esac
516                 ;;
517         release-zip)
518                 release_common
519                 stamp=`cat Xonotic/stamp.txt`
520                 pk3stamp=`cat Xonotic/pk3stamp.txt`
521                 # exe and dll files do not need +x, so this makes them eligible for 7zip compression too
522                 chmod a-x Xonotic/*.exe Xonotic/*.dll || true
523                 # build the archives
524                 verbose mkzip Xonotic-$stamp-enginesource.zip \
525                         Xonotic/Makefile \
526                         Xonotic/source/darkplaces/ \
527                         Xonotic/COPYING Xonotic/GPL-2 Xonotic/GPL-3
528                 verbose cp Xonotic-$stamp-enginesource.zip Xonotic-$stamp-engine.zip
529                 verbose mkzip Xonotic-$stamp-engine.zip \
530                         Xonotic/*.dll \
531                         Xonotic/bin32/*.dll \
532                         Xonotic/bin64/*.dll \
533                         Xonotic/*.app \
534                         Xonotic/xonotic-* \
535                         Xonotic/xonotic.exe
536                 verbose cp Xonotic-$stamp-engine.zip Xonotic-$stamp-common.zip
537                 verbose mkzip Xonotic-$stamp-common.zip \
538                         Xonotic/source/d0_blind_id/ \
539                         Xonotic/source/gmqcc/ \
540                         Xonotic/source/qcsrc/ \
541                         Xonotic/Docs \
542                         Xonotic/misc \
543                         Xonotic/gmqcc \
544                         Xonotic/server \
545                         Xonotic/key_0.d0pk \
546                         Xonotic/data/font-unifont-$pk3stamp.pk3 \
547                         Xonotic/data/font-xolonium-$pk3stamp.pk3
548                 verbose cp Xonotic-$stamp-enginesource.zip Xonotic-$stamp-source.zip
549                 verbose mkzip Xonotic-$stamp-source.zip \
550                         Xonotic/source/d0_blind_id/ \
551                         Xonotic/source/gmqcc/ \
552                         Xonotic/source/qcsrc/ \
553                         Xonotic/misc/logos
554                 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp.zip
555                 verbose mkzip0 Xonotic-$stamp.zip \
556                         Xonotic/data/xonotic-$pk3stamp-data.pk3 \
557                         Xonotic/data/xonotic-$pk3stamp-maps.pk3 \
558                         Xonotic/data/xonotic-$pk3stamp-music.pk3 \
559                         Xonotic/data/xonotic-$pk3stamp-nexcompat.pk3
560                 verbose mv Xonotic-$stamp-common.zip Xonotic-$stamp-high.zip
561                 verbose mkzip0 Xonotic-$stamp-high.zip \
562                         Xonotic/data/xonotic-$pk3stamp-data-high.pk3 \
563                         Xonotic/data/xonotic-$pk3stamp-maps-high.pk3 \
564                         Xonotic/data/xonotic-$pk3stamp-music.pk3 \
565                         Xonotic/data/xonotic-$pk3stamp-nexcompat-high.pk3
566                 verbose mkzip Xonotic-$stamp-mappingsupport.zip \
567                         Xonotic/mapping
568                 verbose mkzip0 Xonotic-$stamp-mappingsupport.zip \
569                         Xonotic/data/xonotic-$pk3stamp-maps-mapping.pk3
570                 verbose mkzip gmqcc-$stamp.zip \
571                         Xonotic/gmqcc \
572                         Xonotic/source/gmqcc
573                 ;;
574         release)
575                 release_common
576                 verbose "$SELF" release-prepare
577                 verbose "$SELF" release-maps
578                 verbose "$SELF" release-engine
579                 verbose "$SELF" release-qc
580                 verbose "$SELF" release-pack
581                 verbose "$SELF" release-zip
582                 ;;
583         *)
584                 handled=false
585                 ;;
586 esac