| 1 | #!/bin/bash |
| 2 | # This file is executed by contigratord when a build is triggered. |
| 3 | # You can execute it manually too by executing /home/contigrator/contigrator/tool/trigBuild.sh |
| 4 | |
| 5 | #These variables are available: |
| 6 | # $WD = The workspace $BN = Zero padded build Number (%07i) and $BN_NUM for unpadded. |
| 7 | # $OUT = This empty directory is created for you to store the output of the build. |
| 8 | |
| 9 | OUT=/tmp/sdlballout/ |
| 10 | mkdir /tmp/sdlballout |
| 11 | |
| 12 | make -f Makefile.win clean |
| 13 | make -f Makefile clean |
| 14 | |
| 15 | |
| 16 | OUTDIR="SDL-Ball_1.04" |
| 17 | |
| 18 | WINPKG="$OUTDIR"_windows.zip |
| 19 | LINPKG="$OUTDIR"_linux.tar.bz2 |
| 20 | SRCPKG="$OUTDIR"_src.tar.xz |
| 21 | |
| 22 | mkdir -p $OUTDIR |
| 23 | |
| 24 | # Create the changelog |
| 25 | git log > changelog.txt |
| 26 | cp changelog.txt $OUTDIR |
| 27 | |
| 28 | # Compile for linux |
| 29 | make -f Makefile |
| 30 | mv sdl-ball $OUTDIR/sdl-ball_linux_x64 |
| 31 | make -f Makefile clean |
| 32 | |
| 33 | # Compile for windows |
| 34 | make -f Makefile.win |
| 35 | |
| 36 | # Package datafiles |
| 37 | cp -a leveleditor $OUTDIR |
| 38 | cp -a themes $OUTDIR |
| 39 | cp *.txt $OUTDIR |
| 40 | |
| 41 | # Package linux version |
| 42 | |
| 43 | tar -c $OUTDIR | pbzip2 > $LINPKG |
| 44 | rm $OUTDIR/sdl-ball_linux_x64 |
| 45 | |
| 46 | # Package windows version |
| 47 | mv sdl-ball.exe $OUTDIR/SDL-Ball.exe |
| 48 | cp win32/readme_SDL.txt $OUTDIR |
| 49 | unix2dos $OUTDIR/*.txt |
| 50 | cp win32/*.dll $OUTDIR |
| 51 | zip -r $WINPKG $OUTDIR |
| 52 | make -f Makefile.win clean |
| 53 | |
| 54 | # Build the source code |
| 55 | git archive --prefix="SDL-Ball_src/" HEAD > "$OUTDIR"_src.tar |
| 56 | tar --file "$OUTDIR"_src.tar --append --transform 's%^%SDL-Ball_src/%' changelog.txt |
| 57 | cat "$OUTDIR"_src.tar | pxz > "$OUT/$SRCPKG" |
| 58 | |
| 59 | rm -R $OUTDIR *.tar |
| 60 | rm changelog.txt |
| 61 | |
| 62 | mv $WINPKG $OUT |
| 63 | mv $LINPKG $OUT |
| 64 | |
| 65 | mv $OUT . |