1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
qTox/osx/createdmg

53 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

2017-01-30 05:03:26 +08:00
#!/bin/bash
2017-01-30 06:50:26 +08:00
#
# Copyright © 2017-2019 The qTox Project Contributors
2017-01-30 06:50:26 +08:00
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set -eu -o pipefail
2017-01-30 05:03:26 +08:00
QTOX_DIR="$1"
cd "$2"
2017-01-30 05:03:26 +08:00
BUNDLE_PATH="$(pwd)"
cd -
2017-01-30 05:03:26 +08:00
cd "$BUNDLE_PATH/../"
2017-01-30 05:03:26 +08:00
BUILD_DIR="$(pwd)"
cd -
2017-01-30 05:03:26 +08:00
DMG_DIR="$BUILD_DIR/dmg.tmp"
APP_VER=$(defaults read "$BUNDLE_PATH/Contents/Info.plist" CFBundleVersion)
if [ ! -d "$BUNDLE_PATH" ]; then
echo "Please pass path to qTox.app as an argument!"
exit 1
fi
rm -rf "$DMG_DIR"
rm -f "$BUILD_DIR/qTox.dmg"
mkdir "$DMG_DIR"
cp -r "$BUNDLE_PATH" "$DMG_DIR/"
cd "$DMG_DIR"
2017-01-30 05:03:26 +08:00
ln -s /Applications "./Install to Applications"
mkdir .background
cp -f $QTOX_DIR/osx/background-DMG/qTox-DMG-bak.tiff .background/backgroundImage.tiff
cp -f $QTOX_DIR/osx/DS_Store-DMG ./.DS_Store
cp -f $QTOX_DIR/LICENSE ./LICENSE
cp -f $QTOX_DIR/README.md ./README.md
cd -
2017-01-30 05:03:26 +08:00
hdiutil create -volname "qTox $APP_VER" -srcfolder "$DMG_DIR/" -format UDZO "$BUILD_DIR/qTox.dmg"