script for creating MacOSX DMG

git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@243 4df4b0f3-56ce-47cb-b001-ed939b7d65a6
This commit is contained in:
albertzeyer
2009-08-15 13:19:09 +00:00
committed by Albert Zeyer
parent 0a4a1db257
commit b9a21afe07
3 changed files with 60 additions and 6 deletions

View File

@@ -231,9 +231,6 @@
23D3E9B61013ABCA001643FA /* hq_sound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hq_sound.h; sourceTree = "<group>"; };
23D3E9B81013ABCA001643FA /* declarations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = declarations.h; sourceTree = "<group>"; };
23D3E9B91013ABCA001643FA /* enemyai.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = enemyai.h; sourceTree = "<group>"; };
23D3E9BA1013ABCA001643FA /* eseq_ep1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = eseq_ep1.h; sourceTree = "<group>"; };
23D3E9BB1013ABCA001643FA /* eseq_ep2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = eseq_ep2.h; sourceTree = "<group>"; };
23D3E9BC1013ABCA001643FA /* eseq_ep3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = eseq_ep3.h; sourceTree = "<group>"; };
23D3E9BE1013ABCA001643FA /* lzexe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lzexe.h; sourceTree = "<group>"; };
23D3E9BF1013ABCA001643FA /* rle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rle.h; sourceTree = "<group>"; };
23D3E9C01013ABCA001643FA /* story.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = story.h; sourceTree = "<group>"; };
@@ -598,9 +595,6 @@
children = (
23D3E9B81013ABCA001643FA /* declarations.h */,
23D3E9B91013ABCA001643FA /* enemyai.h */,
23D3E9BA1013ABCA001643FA /* eseq_ep1.h */,
23D3E9BB1013ABCA001643FA /* eseq_ep2.h */,
23D3E9BC1013ABCA001643FA /* eseq_ep3.h */,
23D3E9BD1013ABCA001643FA /* fileio */,
23D3E9C11013ABCA001643FA /* fileio.h */,
23D3E9C21013ABCA001643FA /* game.h */,

53
build/Xcode/createdmg.sh Executable file
View File

@@ -0,0 +1,53 @@
#!/bin/sh
# script taken from Pidgin-MacOSX project
# by Albert Zeyer - www.az2000.de
# builds a DMG for Commander Genius
# Creates a disk image (dmg) on Mac OS X from the command line.
# usage:
# mkdmg <volname> <vers> <srcdir>
#
# Where <volname> is the name to use for the mounted image, <vers> is the version
# number of the volume and <srcdir> is where the contents to put on the dmg are.
#
# The result will be a file called <volname>-<vers>.dmg
mkdmg() {
if [ $# != 3 ]; then
echo "usage: mkdmg.sh volname vers srcdir"
exit 0
fi
VOL="$1"
VER="$2"
FILES="$3"
DMG="tmp-$VOL.dmg"
# create temporary disk image and format, ejecting when done
SIZE=$(du -sk ${FILES} | cut -f 1)
SIZE=$((${SIZE}/1000+5))
hdiutil create "$DMG" -megabytes ${SIZE} -ov -type UDIF -fs HFS+ -volname "$VOL"
# mount and copy files onto volume
hdid "$DMG"
echo -n "copying files ... "
cp -R "${FILES}"/* "/Volumes/$VOL/"
echo "ready"
hdiutil eject "/Volumes/$VOL"
#osascript -e "tell application "Finder" to eject disk "$VOL"" &&
# convert to compressed image, delete temp image
rm -f "${VOL}-${VER}.dmg"
hdiutil convert "$DMG" -format UDZO -o "${VOL}-${VER}.dmg"
rm -f "$DMG"
}
cd "$(dirname "$0")"
rsync -a --delete build/Debug/Commander\ Genius.app dmg/
mkdmg CommanderGenius "$(egrep -E ".*#define.*CGVERSION.*" ../../version.h | cut -d "\"" -f 2)" dmg