-
Notifications
You must be signed in to change notification settings - Fork 5
/
deploy5
executable file
·112 lines (99 loc) · 3.13 KB
/
deploy5
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
#!/bin/bash
# This script can be called from anywhere.
MYBASENAME=`perl -MCwd -e 'print Cwd::abs_path shift' "$0"`
MYPATH=`dirname "$MYBASENAME"`
. helper/common
BUNDLE=0
usage() {
echo "$0 - creates a GeoGebra Discovery Classic 5 package for the current native platform"
echo "Usage: $0 [options]"
echo " where [options] can be:"
echo " -h this help"
echo " -j add Java Runtime Environment from \"$JAVA_HOME\" to the bundle"
exit 0
}
while getopts "jh" OPT; do
case $OPT in
j)
BUNDLE=1
;;
h)
usage
;;
\?)
echo "Invalid option: $OPTARG" 1>&2
exit 1
;;
esac
done
# Put name of the filters into $@ (unused)
shift $((OPTIND-1))
test -x fork/geogebra/desktop/build/install/desktop/bin/desktop
rm -fr dist/$PACKAGE_NAME
mkdir -p dist/$PACKAGE_NAME/geogebra
rsync -ur fork/geogebra/desktop/build/install/desktop dist/$PACKAGE_NAME/geogebra
# Platform dependent parts
if [ "$OS_VARIANT" = "Windows" ]; then
for i in linux mac; do
rm -f dist/$PACKAGE_NAME/geogebra/desktop/lib/*$i*.jar
done
rm -f dist/$PACKAGE_NAME/geogebra/desktop/bin/desktop
if [ $BUNDLE = 1 -a "$JAVA_HOME" != "" ]; then
echo "@set JAVA_HOME=%cd%\jre" > dist/$PACKAGE_NAME/GeoGebra-Discovery.bat
fi
echo "@echo Welcome to $SOFTWARE_NAME
@call geogebra\\desktop\\bin\\desktop.bat %*" >> dist/$PACKAGE_NAME/GeoGebra-Discovery.bat
# Use the MSYS2/CLANG* build:
if [[ "$OS_VERSION" == *"MINGW32"* ]]; then
WINARCH=32
rm -f dist/$PACKAGE_NAME/geogebra/desktop/lib/*amd64*.jar
else
WINARCH=64
rm -f dist/$PACKAGE_NAME/geogebra/desktop/lib/*i586*.jar || true
fi
ZIPNAME=$PACKAGE_NAME-Windows$WINARCH
else
# Non-cross-platform deployment
mkdir -p dist/$PACKAGE_NAME/helper
cp helper/detect dist/$PACKAGE_NAME/helper
rm -f dist/$PACKAGE_NAME/geogebra/desktop/bin/desktop.bat
if [ "$OS_VARIANT" = Raspbian ]; then
for i in windows mac i586 amd64 libpxcc zspace; do
rm -f dist/$PACKAGE_NAME/geogebra/desktop/lib/*$i*.jar || true
done
ZIPNAME=$PACKAGE_NAME-RaspberryPi
else
if [ "$OS_VARIANT" = Mac ]; then
for i in windows linux i586 amd64 libpxcc zspace; do
rm -f dist/$PACKAGE_NAME/geogebra/desktop/lib/*$i*.jar || true
done
ZIPNAME=$PACKAGE_NAME-Mac
else
for i in windows mac i586 arm libpxcc zspace; do
rm -f dist/$PACKAGE_NAME/geogebra/desktop/lib/*$i*.jar || true
done
ZIPNAME=$PACKAGE_NAME-Linux64
fi
fi
# Linux startup shell
echo "#!/bin/bash
# This script can be called from anywhere.
MYBASENAME=\`perl -MCwd -e 'print Cwd::abs_path shift' \"\$0\"\`
MYPATH=\`dirname \"\$MYBASENAME\"\`
echo \"Welcome to $SOFTWARE_NAME\"
. \"\$MYPATH\"/helper/detect
test -x \"\$MYPATH\"/jre && export JAVA_HOME=\"\`perl -MCwd -e 'print Cwd::abs_path shift' \"\$MYPATH\"/jre\`\"
echo
\"\$MYPATH\"/geogebra/desktop/bin/desktop \"\$@\"" > dist/$PACKAGE_NAME/GeoGebra-Discovery
chmod 755 dist/$PACKAGE_NAME/GeoGebra-Discovery
fi # End of non-cross-platform deployment
# Common parts in all types of deployments
if [ $BUNDLE = 1 -a "$JAVA_HOME" != "" ]; then
mkdir dist/$PACKAGE_NAME/jre
rsync -ur "$JAVA_HOME"/* dist/$PACKAGE_NAME/jre
ZIPNAME=$ZIPNAME-withJava
fi
ZIPNAME=$ZIPNAME.zip
cd dist
rm -f $ZIPNAME
zip -9r $ZIPNAME $PACKAGE_NAME