-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
qgis_package.bash
executable file
·67 lines (54 loc) · 1.51 KB
/
qgis_package.bash
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
#!/usr/bin/env bash
set -euo pipefail
# load configuration
if (( $# < 5 )); then
echo "qgis_package: $0 <path/to>/config/<my>.conf major minor patch package_file ..."
exit 1
fi
CONFIG_FILE=$1
if [ ! -f "$CONFIG_FILE" ]; then
echo "invalid config file (1st argument) $CONFIG_FILE"
exit 1
fi
shift
export QGIS_MAJOR_VERSION=$1
shift
export QGIS_MINOR_VERSION=$1
shift
export QGIS_PATCH_VERSION=$1
shift
source $CONFIG_FILE
PACKAGE=$1
QGIS_APP="$BUNDLE_DIR/$QGIS_APP_NAME"
if [ ! -d "$QGIS_APP" ]; then
error "missing bundled app $QGIS_APP"
fi
if [ -f "$PACKAGE" ]; then
info "$PACKAGE exists, removing"
rm -f "$PACKAGE"
fi
IDENTITY=$(cat "$SIGN_FILE")
if [ ${#IDENTITY} -ne 40 ]; then
error "SIGN FILE $SIGN_FILE invalid. key must have 40 chars" ;
fi
if [ ! -f "$KEYCHAIN_FILE" ]; then
error "keychain file $KEYCHAIN_FILE missing"
fi
info "Print identities"
security find-identity -v -p codesigning
info "Signing the $QGIS_APP_NAME"
codesign -s "$IDENTITY" -v --force -–timestamp=none --keychain "$KEYCHAIN_FILE" "$QGIS_APP" --deep
codesign --deep-verify --verbose "$QGIS_APP"
info "Create dmg image"
dmgbuild \
-Dapp="$QGIS_APP" \
-s `dirname $0`/../resources/dmgsettings.py \
"$QGIS_APP_NAME" \
"$PACKAGE"
info "Signing the dmg"
codesign -s "$IDENTITY" -v --force -–timestamp=none --keychain "$KEYCHAIN_FILE" "$PACKAGE"
codesign --deep-verify --verbose "$PACKAGE"
info "Create checksum"
sha256sum "$PACKAGE" > "$PACKAGE.sha256sum"
F_SIZE=$(du -h "$PACKAGE")
info "Dmg created with size $F_SIZE"