-
Notifications
You must be signed in to change notification settings - Fork 0
/
package_macos.sh
executable file
·51 lines (39 loc) · 1.38 KB
/
package_macos.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
#!/bin/sh
set -e
VERSION="0.22.1"
INPUT_ARCHIVE="$1"
OUTPUT_PKG="$2"
TMP_ROOT="/tmp/package.$$"
TMP_COMPONENT="/tmp/Vdagent.pkg"
command -v realpath >/dev/null 2>&1 || realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
BASEDIR="$(dirname "$(realpath $0)")"
cp -a "$INPUT_ARCHIVE/Products" "$TMP_ROOT"
xattr -c "$TMP_ROOT/usr/local/bin/spice-vdagentd"
codesign --sign "Developer ID Application" \
--force \
--identifier com.redhat.spice.vdagentd \
--preserve-metadata=entitlements,requirements,flags,runtime \
--timestamp \
"$TMP_ROOT/usr/local/bin/spice-vdagentd"
xattr -c "$TMP_ROOT/usr/local/bin/spice-vdagent"
codesign --sign "Developer ID Application" \
--force \
--identifier com.redhat.spice.vdagent \
--preserve-metadata=entitlements,requirements,flags,runtime \
--timestamp \
"$TMP_ROOT/usr/local/bin/spice-vdagent"
pkgbuild --root "$TMP_ROOT" \
--identifier com.redhat.spice.vdagent \
--version "$VERSION" \
--install-location / \
--scripts "$BASEDIR/data/install_scripts" \
"$TMP_COMPONENT"
productbuild --package "$TMP_COMPONENT" \
--identifier com.redhat.spice.vdagent \
--version "$VERSION" \
--sign "Developer ID Installer" \
"$OUTPUT_PKG"
rm "$TMP_COMPONENT"
rm -r "$TMP_ROOT"