-
Notifications
You must be signed in to change notification settings - Fork 0
/
linux-create-installer.sh
78 lines (68 loc) · 2.98 KB
/
linux-create-installer.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
#!/usr/bin/env bash
# Creates installer from an already built application and data
# Assumes this script being copied to the root of 'qtbuild' in the following folder structure:
# UPDATE VERSION and RELEASE DATES in all component xml files
# -- qtbuild
# -- linux_online_installer (structure as copied from the repository clone)
# -- config
# -- packages
# -- org.opengribs.weathergrib.core.linux
# -- data (copy the Weathergrib.AppImage, LICENSE & README.md to here)
# --icons
# Weathergrib.ico
# Weathergrib.png
# -- meta
# -- org.opengribs.weathergrib.data
# -- data (latest Weathergrib 'data' structure should be copied here under 'data' 2x data !)
# -- meta
# -- org.opengribs.weathergrib.maps
# -- data (hires map 'data' structure should be copied here under 'data' 2x data !)
# -- meta
# -- repository
# -- linux (should be empty)
#
#
# After running the script the compiled installers should be in the linux_online_installer folder and the repository should be ready for upload
#
XVER="2.3.0"
## go to the installer build folder
cd linux_online_installer
## check that the AppImage exits and executable bit is set
if [ ! -f "packages/org.opengribs.weathergrib.core.linux/data/Weathergrib.AppImage" ]; then
echo "Weathergrib.AppImage is not in the core data folder, can't continue"
exit 1
fi
chmod a+x packages/org.opengribs.weathergrib.core.linux/data/Weathergrib.AppImage
## build the repository which should be empty (new one each time)
if which repogen >/dev/null; then
REPOGEN='repogen'
elif [ -f /usr/local/opt/qt5/bin/repogen ]; then
REPOGEN='/usr/local/opt/qt5/bin/repogen'
else
REPOGEN="$(find ~/Qt -name repogen|head -n1)"
fi
if [ -z "$REPOGEN" ]; then
echo "Tool repogen not found, can't continue"
exit 1
fi
$REPOGEN --update-new-components -v -p packages repository/linux
## create the installer apps
## build the repository which should be empty (new one each time)
if which binarycreator >/dev/null; then
BINARYCREATOR='binarycreator'
elif [ -f /usr/local/opt/qt5/bin/binarycreator ]; then
BINARYCREATOR='/usr/local/opt/qt5/bin/binarycreator'
else
BINARYCREATOR="$(find ~/Qt -name binarycreator|head -n1)"
fi
if [ -z "$BINARYCREATOR" ]; then
echo "Tool binarycreator not found, can't continue"
exit 1
fi
$BINARYCREATOR --online-only -v -c config/config.xml -p packages Weathergrib_Linux_Online_Installer_v$XVER
$BINARYCREATOR -v -c config/config.xml -p packages -e org.opengribs.weathergrib.maps Weathergrib_Linux_Offline_Installer_v$XVER
$BINARYCREATOR -v --offline-only -c config/config.xml -p packages Weathergrib_Linux_Testing_Installer_v$XVER
tar -cvzf Weathergrib_Linux_Online_Installer_v$XVER.tgz Weathergrib_Linux_Online_Installer_v$XVER
tar -cvzf Weathergrib_Linux_Offline_Installer_v$XVER.tgz Weathergrib_Linux_Offline_Installer_v$XVER
tar -cvzf Weathergrib_Linux_Testing_Installer_v$XVER.tgz Weathergrib_Linux_Testing_Installer_v$XVER
echo "++++ All Done ++++"