Fix dmg script
This commit is contained in:
37
dist/macos/create-dmg.sh
vendored
37
dist/macos/create-dmg.sh
vendored
@@ -1,52 +1,27 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# author: max@last.fm, muesli@tomahawk-player.org
|
|
||||||
# brief: Produces a compressed DMG from a bundle directory
|
|
||||||
# usage: Pass the bundle directory as the only parameter
|
|
||||||
# note: This script depends on the Tomahawk build system, and must be run from
|
|
||||||
# the build directory
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
#if [ -z $VERSION ]
|
echo "Usage: $0 <bundle.app>"
|
||||||
#then
|
exit 1
|
||||||
# echo VERSION must be set
|
|
||||||
# exit 2
|
|
||||||
#fi
|
|
||||||
|
|
||||||
if [ -z "$1" ]
|
|
||||||
then
|
|
||||||
echo "Please pass the bundle.app directory as the first parameter."
|
|
||||||
exit 3
|
|
||||||
fi
|
fi
|
||||||
################################################################################
|
|
||||||
|
|
||||||
|
|
||||||
NAME=$(basename "$1" | perl -pe 's/(.*).app/\1/')
|
NAME=$(basename "$1" | perl -pe 's/(.*).app/\1/')
|
||||||
IN="$1"
|
IN="$1"
|
||||||
TMP="dmg/$NAME"
|
TMP="dmg/$NAME"
|
||||||
OUT="$NAME.dmg"
|
OUT="$NAME.dmg"
|
||||||
mkdir -p "$TMP"
|
mkdir -p "$TMP"
|
||||||
################################################################################
|
|
||||||
|
|
||||||
# clean up
|
|
||||||
rm -rf "$TMP"
|
rm -rf "$TMP"
|
||||||
rm -f "$OUT"
|
rm -f "$OUT"
|
||||||
|
|
||||||
# create DMG contents and copy files
|
#mkdir -p "$TMP/.background"
|
||||||
mkdir -p "$TMP/.background"
|
|
||||||
#cp ../dist/macos/dmg_background.png "$TMP/.background/background.png"
|
#cp ../dist/macos/dmg_background.png "$TMP/.background/background.png"
|
||||||
#cp ../dist/macos/DS_Store.in "$TMP/.DS_Store"
|
#cp ../dist/macos/DS_Store.in "$TMP/.DS_Store"
|
||||||
#chmod go-rwx "$TMP/.DS_Store"
|
#chmod go-rwx "$TMP/.DS_Store"
|
||||||
ln -s /Applications "$TMP/Applications"
|
ln -s /Applications "$TMP/Applications"
|
||||||
# copies the prepared bundle into the dir that will become the DMG
|
# Copies the prepared bundle into the dir that will become the DMG
|
||||||
cp -R "$IN" "$TMP"
|
cp -R "$IN" "$TMP"
|
||||||
|
|
||||||
# create
|
# Create dmg
|
||||||
hdiutil makehybrid -hfs -hfs-volume-name "$NAME" -hfs-openfolder "$TMP" "$TMP" -o tmp.dmg
|
hdiutil makehybrid -hfs -hfs-volume-name "$NAME" -hfs-openfolder "$TMP" "$TMP" -o tmp.dmg
|
||||||
hdiutil convert -format UDZO -imagekey zlib-level=9 tmp.dmg -o "$OUT"
|
hdiutil convert -format UDZO -imagekey zlib-level=9 tmp.dmg -o "$OUT"
|
||||||
|
|
||||||
#genisoimage -D -V "Strawberry" -no-pad -r -apple -o $NAME.iso $TMP
|
|
||||||
#dmg dmg $NAME.iso $OUT
|
|
||||||
|
|
||||||
# cleanup
|
|
||||||
#rm tmp.dmg
|
|
||||||
|
|||||||
Reference in New Issue
Block a user