#!/bin/sh
#
#  make_dmg --
#
#     Packages the built Wings application into a .dmg file.
#
#  Copyright (c) 2002-2009 Bjorn Gustavsson
#
#  See the file "license.terms" for information on usage and redistribution
#  of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#     $Id$
#

temp_dmg="wings-macosx.$$.dmg"
dmg="../wings-$1-macosx.dmg"
mnt=`pwd`/mount

rm -f $temp_dmg $dmg
hdiutil create -quiet -megabytes 100 -volname "Wings3D" -fs HFS+ -layout NONE $temp_dmg
hdiutil attach -private -mountpoint $mnt $temp_dmg
ditto build/Default/Wings3d.app "$mnt/Wings3D $1.app"
hdiutil detach $mnt
hdiutil convert "$temp_dmg" -format UDZO -o $dmg -imagekey zlib-level=9
hdiutil internet-enable -yes "$dmg"
rm $temp_dmg
