[frogr] Added script to create a .dmg file with the bundle for the Mac



commit 7a9a52f76e1a07b41898305e684f60964a899d74
Author: Mario Sanchez Prada <msanchez gnome org>
Date:   Mon Dec 17 22:34:33 2012 +0100

    Added script to create a .dmg file with the bundle for the Mac
    
    It includes a template .dmg file of the minimum size possible (10M)

 macosx/makedmg.sh   |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 macosx/template.dmg |  Bin 0 -> 10518528 bytes
 2 files changed, 48 insertions(+), 0 deletions(-)
---
diff --git a/macosx/makedmg.sh b/macosx/makedmg.sh
new file mode 100755
index 0000000..60f1484
--- /dev/null
+++ b/macosx/makedmg.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+# Copied and modified from GEdit
+
+pushd $(dirname $0) &>/dev/null
+
+echo "Generating bundle..."
+./makebundle.sh
+
+export VOLUME_NAME=frogr
+
+if [ "$1x" = "x" ]; then
+    export DMG_FILE=$VOLUME_NAME.dmg
+else
+    export DMG_FILE=$1.dmg
+fi
+
+export DMG_APP=frogr.app
+export MOUNT_POINT=$VOLUME_NAME.mounted
+
+rm -f $DMG_FILE
+
+# Compute an approximated image size in MB, and bloat by 15 MB
+export image_size=$(du -ck $DMG_APP | tail -n1 | cut -f1)
+export image_size=$((($image_size + 15000) / 1000))
+
+echo "Creating disk image (${image_size}MB)..."
+cp template.dmg tmp.dmg
+hdiutil resize -size ${image_size}m tmp.dmg
+
+echo "Attaching to disk image..."
+hdiutil attach tmp.dmg -readwrite -noautoopen -mountpoint $MOUNT_POINT -quiet
+
+echo "Populating image..."
+cp -r $DMG_APP $MOUNT_POINT
+
+echo "Detaching from disk image..."
+hdiutil detach $MOUNT_POINT -quiet
+
+rm -rf $DMG_APP
+
+echo "Converting to final image..."
+hdiutil convert -quiet -format UDBZ -o $DMG_FILE tmp.dmg
+rm tmp.dmg
+
+echo "Done."
+
+popd &>/dev/null
diff --git a/macosx/template.dmg b/macosx/template.dmg
new file mode 100644
index 0000000..fc4385a
Binary files /dev/null and b/macosx/template.dmg differ



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]