forked from OpenRA/OpenRA
-
Notifications
You must be signed in to change notification settings - Fork 3
/
package-all.sh
executable file
·124 lines (106 loc) · 3.35 KB
/
package-all.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
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
#!/bin/bash
msg () {
echo -ne $1
echo $2
echo -ne "\E[0m"
}
TAG=$1
TYPE=`echo $TAG | grep -o "^[a-z]\\+"`
VERSION=`echo $TAG | grep -o "[0-9]\\+-\\?[0-9]\\?"`
FTPSERVER=openra.res0l.net
export FTPSERVER
case "$TYPE" in
"release")
FTPPATH="openra.res0l.net/releases"
;;
"playtest")
FTPPATH="openra.res0l.net/playtests"
;;
*)
msg "\E[31m" "Unrecognized tag prefix $TYPE"
exit 1
;;
esac
####### Windows #######
(
msg "\E[34m" "Building Windows package."
pushd windows/ &> /dev/null
makensis -DSRCDIR=/home/openra/openra-package/OpenRA-build OpenRA.nsi &> package.log
if [ $? -eq 0 ]; then
mv OpenRA.exe OpenRA-$VERSION.exe
../uploader.sh windows "$VERSION" OpenRA-$VERSION.exe "$FTPPATH" "$2" "$3"
else
msg "\E[31m" "Windows package build failed, refer to $PWD/package.log."
fi
popd &> /dev/null
) &
####### OSX #######
(
msg "\E[34m" "Building OSX package."
pushd osx/ &>/dev/null
sh buildpackage.sh /home/openra/openra-package/OpenRA-build "$VERSION" &> package.log
if [ $? -eq 0 ]; then
../uploader.sh mac "$VERSION" OpenRA-$VERSION.zip "$FTPPATH" "$2" "$3"
else
msg "\E[31m" "OSX package build failed, refer to $PWD/package.log."
fi
popd &> /dev/null
) &
####### *nix Builds #######
(
pushd linux &> /dev/null
#Desktop Icons
BUILTDIR=../../../built
mkdir -p $BUILTDIR/usr/share/applications/
sed -i "3,3 d" openra-ra.desktop
sed -i "3,3 i\Version=$VERSION" openra-ra.desktop
sed -i "3,3 d" openra-cnc.desktop
sed -i "3,3 i\Version=$VERSION" openra-cnc.desktop
cp openra-ra.desktop $BUILTDIR/usr/share/applications/
cp openra-cnc.desktop $BUILTDIR/usr/share/applications/
#Menu entries
mkdir -p $BUILTDIR/usr/share/menu/
cp openra-ra $BUILTDIR/usr/share/menu/
cp openra-cnc $BUILTDIR/usr/share/menu/
#Icon images
mkdir -p $BUILTDIR/usr/share/pixmaps/
cp openra.32.xpm $BUILTDIR/usr/share/pixmaps/
mkdir -p $BUILTDIR/usr/share/icons/
cp -r hicolor $BUILTDIR/usr/share/icons/
popd &> /dev/null
(
#Arch-Linux
msg "\E[34m" "Building Arch-Linux package."
pushd linux/pkgbuild/ &> /dev/null
sh buildpackage.sh "$FTPSERVER" "$FTPPATH/linux" "$2" "$3" "$VERSION" &> package.log
if [ $? -ne 0 ]; then
msg "\E[31m" "Arch-Linux package build failed, refer to $PWD/package.log."
fi
popd &> /dev/null
) &
(
#RPM
msg "\E[34m" "Building RPM package."
pushd linux/rpm/ &> /dev/null
sh buildpackage.sh "$FTPSERVER" "$FTPPATH/linux" "$2" "$3" "$VERSION" ~/rpmbuild &> package.log
if [ $? -ne 0 ]; then
msg "\E[31m" "RPM package build failed, refer to $PWD/package.log."
fi
popd &> /dev/null
) &
(
#deb
msg "\E[34m" "Building deb package."
pushd linux/deb/ &> /dev/null
./buildpackage.sh "$FTPSERVER" "$FTPPATH/linux" "$2" "$3" "$VERSION" ~/openra-package/built ~/debpackage &> package.log
if [ $? -ne 0 ]; then
msg "\E[31m" "deb package build failed, refer to $PWD/package.log."
fi
popd &> /dev/null
) &
wait
) &
wait
if [ "$TYPE" = "release" ]; then
wput --basename=../ -u ../VERSION ftp://$2:$3@$FTPSERVER/$FTPPATH/master/
fi