| 1 |
#!/bin/bash |
| 2 |
# |
| 3 |
# Copyright 2005-2020 The Mumble Developers. All rights reserved. |
| 4 |
# Use of this source code is governed by a BSD-style license |
| 5 |
# that can be found in the LICENSE file at the root of the |
| 6 |
# Mumble source tree or at <https://www.mumble.info/LICENSE>. |
| 7 |
|
| 8 |
cp libmumbleoverlay.dylib MumbleOverlay.osax/Contents/MacOS/ |
| 9 |
|
| 10 |
productbuild \ |
| 11 |
--component MumbleOverlay.osax /Library/ScriptingAdditions \ |
| 12 |
synth.pkg |
| 13 |
|
| 14 |
root=$(mktemp -d -t mumble-overlay-installer) |
| 15 |
/usr/bin/xar -f synth.pkg -x -C ${root} |
| 16 |
mkdir -p ${root}/Resources |
| 17 |
mv bg.png ${root}/Resources/ |
| 18 |
VERSION=`/usr/libexec/PlistBuddy -c "print MumbleOverlayVersion" MumbleOverlay.osax/Contents/Info.plist` |
| 19 |
MINCLIENT=`/usr/libexec/PlistBuddy -c "print MumbleOverlayMinMumbleVersion" MumbleOverlay.osax/Contents/Info.plist` |
| 20 |
echo "<upgrade version=\"${VERSION}\" minclient=\"${MINCLIENT}\" />" > ${root}/upgrade.xml |
| 21 |
|
| 22 |
sed -i '' -e 's,<installer-gui-script minSpecVersion="1">,<installer-gui-script minSpecVersion="1"><title>Mumble Overlay</title><background mime-type="image/png" file="bg.png" />,' ${root}/Distribution |
| 23 |
|
| 24 |
pushd ${root} |
| 25 |
/usr/bin/xar -f MumbleOverlay.pkg --no-compress "^.*$" -c ./* |
| 26 |
popd |
| 27 |
|
| 28 |
cp ${root}/MumbleOverlay.pkg MumbleOverlay.pkg |