forked from DusteDdk/SDL-Ball
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontigrator-buildscript.sh
executable file
·65 lines (47 loc) · 1.45 KB
/
contigrator-buildscript.sh
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
#!/bin/bash
# This file is executed by contigratord when a build is triggered.
# You can execute it manually too by executing /home/contigrator/contigrator/tool/trigBuild.sh
#These variables are available:
# $WD = The workspace $BN = Zero padded build Number (%07i) and $BN_NUM for unpadded.
# $OUT = This empty directory is created for you to store the output of the build.
OUT=/tmp/sdlballout/
mkdir /tmp/sdlballout
make -f Makefile.win clean
make -f Makefile clean
OUTDIR="SDL-Ball_1.04"
WINPKG="$OUTDIR"_windows.zip
LINPKG="$OUTDIR"_linux.tar.bz2
SRCPKG="$OUTDIR"_src.tar.xz
mkdir -p $OUTDIR
# Create the changelog
git log > changelog.txt
cp changelog.txt $OUTDIR
# Compile for linux
make -f Makefile
mv sdl-ball $OUTDIR/sdl-ball_linux_x64
make -f Makefile clean
# Compile for windows
make -f Makefile.win
# Package datafiles
cp -a leveleditor $OUTDIR
cp -a themes $OUTDIR
cp *.txt $OUTDIR
# Package linux version
tar -c $OUTDIR | pbzip2 > $LINPKG
rm $OUTDIR/sdl-ball_linux_x64
# Package windows version
mv sdl-ball.exe $OUTDIR/SDL-Ball.exe
cp win32/readme_SDL.txt $OUTDIR
unix2dos $OUTDIR/*.txt
cp win32/*.dll $OUTDIR
zip -r $WINPKG $OUTDIR
make -f Makefile.win clean
# Build the source code
git archive --prefix="SDL-Ball_src/" HEAD > "$OUTDIR"_src.tar
tar --file "$OUTDIR"_src.tar --append --transform 's%^%SDL-Ball_src/%' changelog.txt
cat "$OUTDIR"_src.tar | pxz > "$OUT/$SRCPKG"
rm -R $OUTDIR *.tar
rm changelog.txt
mv $WINPKG $OUT
mv $LINPKG $OUT
mv $OUT .