-
Notifications
You must be signed in to change notification settings - Fork 0
/
mac-deploy-and-installer.sh
93 lines (81 loc) · 3.59 KB
/
mac-deploy-and-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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/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:
# -- qtbuild
# -- deploy ('Weathergrib.app' as copied from Qt release build folder)
# -- mac_online_installer (structure as copied from the repository clone)
# -- config
# -- packages
# -- org.opengribs.weathergrib.core.mac
# -- data (should be empty)
# -- 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
# -- mac (should be empty)
#
# Also assumes that 'Weathergrib.app' has been copied from the Qt release build folders to the 'deploy' folder
# That Weathergrib 'data' structure and hires map 'data' structure are copied to respective 'data' folders ('data' appears in two levels in each case)
#
# After running the script the installer.app should be in the mac_online_installer folder and the repository should be ready for upload
#
# UPDATE VERSION AND RELEASE DATES in xml files
XVER="v2.3.0"
## run the Qt mac deployment tool to create the executable package
cd deploy
if which macdeployqt >/dev/null; then
DEPLOY='macdeployqt'
elif [ -f /usr/local/opt/qt5/bin/macdeployqt ]; then
DEPLOY='/usr/local/opt/qt5/bin/macdeployqt'
else
DEPLOY="$(find ~/Qt -name macdeployqt|head -n1)"
fi
if [ -z "$DEPLOY" ]; then
echo "Tool macdeployqt not found, can't continue"
exit 1
fi
$DEPLOY Weathergrib.app -verbose=2
## copy the result to the appropriate package for preparing the repository and installer
cp -R Weathergrib.app ../mac_online_installer/packages/org.opengribs.weathergrib.core.mac/data
## go to the installer build folder
cd ../mac_online_installer
## copy the .icns file to the Resource folder
cp icns/Weathergrib.icns packages/org.opengribs.weathergrib.core.mac/data/Weathergrib.app/Contents/Resources
if [ -z "packages/org.opengribs.weathergrib.core.mac/data/Weathergrib.app/Contents/Resources/Weathergrib.icns" ]; then
echo "icns file not copied. Fix it please and rerun"
exit 1
fi
## 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/mac
## 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_Mac_Online_Installer_$XVER/Weathergrib_Mac_Online_Installer_$XVER
$BINARYCREATOR -v -c config/config.xml -p packages -e org.opengribs.weathergrib.maps Weathergrib_Mac_Offline_Installer_$XVER/Weathergrib_Mac_Offline_Installer_$XVER
$BINARYCREATOR -v --offline-only -c config/config.xml -p packages Weathergrib_Mac_Testing_Installer_$XVER/Weathergrib_Mac_Testing_Installer_$XVER
echo "++++ All Done ++++"