Skip to content

Commit

Permalink
Update the dmg script.
Browse files Browse the repository at this point in the history
  • Loading branch information
dak180 committed Mar 21, 2011
1 parent e237762 commit 8b253a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion macosx/Warzone.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3879,7 +3879,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "# Config\nsimgfl=\"http://downloads.sourceforge.net/project/warzone2100/build-tools/mac/wztemplate.sparseimage\"\nsimgflnme=\"wztemplate.sparseimage\"\nsimgflmd5=\"da10e06f2b9b2b565e70dd8e98deaaad\"\nsequence=\"http://downloads.sourceforge.net/project/warzone2100/warzone2100/Videos/2.2/standard-quality-en/sequences.wz\"\nsequencenme=\"sequences.wz\"\nsequencelo=\"http://downloads.sourceforge.net/project/warzone2100/warzone2100/Videos/2.2/low-quality-en/sequences.wz\"\nsequencelonme=\"sequences-lo.wz\"\nrelbuild=\"build/Release/\"\ndmgout=\"build/dmgout\"\ncoident=\"${SRCROOT}/configs/codeident\"\n\n# Fail if not release\nif [ ! -d \"${relbuild}Warzone.app\" ]; then\n echo \"error: This should only be run as Release\" >&2\n exit 1\nfi\n\n# codesign setup\nsignd () {\n if [ -f \"${coident}\" ]; then\n # Local Config\n local idetd=`cat ${coident}`\n local resrul=\"${SRCROOT}/configs/codesignrules.plist\"\n local appth=\"/Volumes/Warzone 2100/Warzone.app\"\n \n # Sign app\n codesign -vfs \"${idetd}\" --keychain \"CodeSign\" --verify --resource-rules=\"${resrul}\" \"${appth}\"\n \n # Sign the frameworks\n local framelst=`\\ls -1 \"${appth}/Contents/Frameworks\" | sed -n 's:.framework$:&:p'`\n for fsignd in ${framelst}; do\n if [ -d \"${appth}/Contents/Frameworks/${fsignd}/Versions/A\" ]; then\n codesign -vfs \"${idetd}\" --keychain \"CodeSign\" --verify \"${appth}/Contents/Frameworks/${fsignd}/Versions/A\"\n fi\n done\n else\n echo \"warning: No codeident file found; code will not be signed.\"\n fi\n}\n\n# Make a dir and get the sparseimage\nmkdir -p \"$dmgout\"\ncd \"$dmgout\"\nif [ ! -f \"$simgflnme\" ]; then\n echo \"Fetching $simgfl\"\n if ! curl -L -O --connect-timeout \"30\" \"$simgfl\"; then\n echo \"error: Unable to fetch $simgfl\" >&2\n exit 1\n fi\nelse\n echo \"$simgflnme already exists, skipping\"\nfi\n\n# Get the sequences\n\n# Comment out the following to skip the high qual seq\n# if [ ! -f \"$sequencenme\" ]; then\n# echo \"Fetching $sequencenme\"\n# if [ -f \"${HOME}/Library/Application Support/Warzone 2100 master/sequences.wz\" ]; then\n# cp \"${HOME}/Library/Application Support/Warzone 2100 master/sequences.wz\" \"$sequencenme\"\n# elif ! curl -L --connect-timeout \"30\" -o \"$sequencenme\" \"$sequence\"; then\n# echo \"error: Unable to fetch $sequence\" >&2\n# exit 1\n# fi\n# else\n# echo \"$sequencenme already exists, skipping\"\n# fi\n#\n\n# Comment out the following to skip the low qual seq\n# if [ ! -f \"$sequencelonme\" ]; then\n# echo \"Fetching $sequencelonme\"\n# if [ -f \"${HOME}/Applications/Build/wz2100/dmgmaker/sequences-lo.wz\" ]; then\n# cp \"${HOME}/Applications/Build/wz2100/dmgmaker/sequences-lo.wz\" \"$sequencelonme\"\n# elif [ -f \"${HOME}/Library/Application Support/Warzone 2100 master/sequences-lq.wz\" ]; then\n# cp \"${HOME}/Library/Application Support/Warzone 2100 master/sequences-lq.wz\" \"$sequencelonme\"\n# elif ! curl -L --connect-timeout \"30\" -o \"$sequencelonme\" \"$sequencelo\"; then\n# echo \"error: Unable to fetch $sequencelo\" >&2\n# exit 1\n# fi\n# else\n# echo \"$sequencelonme already exists, skipping\"\n# fi\n# \n\n# Copy over the app\ncd ../../\necho \"Copying the app cleanly.\"\nrm -r -f $dmgout/Warzone.app\nif ! tar -c --exclude '.svn' --exclude 'Makefile*' --exclude 'makefile*' --exclude '.DS_Store' -C build/Release Warzone.app | tar -xC $dmgout; then\n echo \"error: Unable to copy the app\" >&2\n exit 1\nfi\n\n# Make the dSYM Bundle\nmkdir -p \"${dmgout}/warzone2100-dSYM\"\ncp -pPR ${relbuild}*.dSYM \"${dmgout}/warzone2100-dSYM\"\ncd \"$dmgout\"\ntar -czf warzone2100-dSYM.tar.gz --exclude '.DS_Store' warzone2100-dSYM\n\n# mkredist.bash\n\ncd Warzone.app/Contents/Resources/data/\n\necho \"== Compressing base.wz ==\"\nif [ -d base/ ]; then\n cd base/\n zip -r ../base.wz *\n cd ..\n rm -rf base/\nfi\n\necho \"== Compressing mp.wz ==\"\nif [ -d mp/ ]; then\n cd mp/\n zip -r ../mp.wz *\n cd ..\n rm -rf mp/\nfi\n\ncd mods/\n\nmodlst=`\\ls -1`\nfor moddr in ${modlst}; do\n if [ -d ${moddr} ]; then\n cd ${moddr}\n if [ \"${moddr}\" = \"campaign\" ]; then\n sbtyp=\".cam\"\n elif [ \"${moddr}\" = \"global\" ]; then\n sbtyp=\".gmod\"\n elif [ \"${moddr}\" = \"multiplay\" ]; then\n sbtyp=\".mod\"\n elif [ \"${moddr}\" = \"music\" ]; then\n sbtyp=\".music\"\n else\n sbtyp=\"\"\n fi\n modlstd=`ls -1`\n for modwz in ${modlstd}; do\n if [ -d ${modwz} ]; then\n echo \"== Compressing ${modwz}${sbtyp}.wz ==\"\n cd ${modwz}\n zip -r ../${modwz}${sbtyp}.wz *\n cd ..\n rm -rf \"${modwz}/\"\n fi\n done\n cd ..\n fi\ndone\n\ncd ../../../../../\n\nrm -rf ./out ./temp\nmkdir temp/\nmkdir out/\nmv warzone2100-dSYM temp/warzone2100-dSYM\nmv warzone2100-dSYM.tar.gz out/warzone2100-dSYM.tar.gz\n\necho \"== Creating DMG ==\"\ncp wztemplate.sparseimage temp/wztemplatecopy.sparseimage\nhdiutil resize -size 220m temp/wztemplatecopy.sparseimage\nmountpt=`hdiutil mount temp/wztemplatecopy.sparseimage | tr -d \"\\t\" | sed -E 's:(/dev/disk[0-9])( +)(/Volumes/Warzone 2100):\\1:'`\ncp -r Warzone.app/* /Volumes/Warzone\\ 2100/Warzone.app\nsignd\n# hdiutil detach `expr match \"$mountpt\" '\\(^[^ ]*\\)'`\nhdiutil detach \"$mountpt\"\nhdiutil convert temp/wztemplatecopy.sparseimage -format UDZO -o out/warzone2100-novideo.dmg\n\nif [ -f \"$sequencelonme\" ]; then\n echo \"== Creating LQ DMG ==\"\n hdiutil resize -size 420m temp/wztemplatecopy.sparseimage\n mountpt=`hdiutil mount temp/wztemplatecopy.sparseimage | tr -d \"\\t\" | sed -E 's:(/dev/disk[0-9])( +)(/Volumes/Warzone 2100):\\1:'`\n cp sequences-lo.wz /Volumes/Warzone\\ 2100/Warzone.app/Contents/Resources/data/sequences.wz\n signd\n # hdiutil detach `expr match \"$mountpt\" '\\(^[^ ]*\\)'`\n hdiutil detach \"$mountpt\"\n hdiutil convert temp/wztemplatecopy.sparseimage -format UDZO -o out/warzone2100-lqvideo.dmg\nelse\n echo \"$sequencelonme does not exist, skipping\"\nfi\n\n\nif [ -f \"$sequencenme\" ]; then\n echo \"== Creating HQ DMG ==\"\n hdiutil resize -size 770m temp/wztemplatecopy.sparseimage\n mountpt=`hdiutil mount temp/wztemplatecopy.sparseimage | tr -d \"\\t\" | sed -E 's:(/dev/disk[0-9])( +)(/Volumes/Warzone 2100):\\1:'`\n rm /Volumes/Warzone\\ 2100/Warzone.app/Contents/Resources/data/sequences.wz\n cp sequences.wz /Volumes/Warzone\\ 2100/Warzone.app/Contents/Resources/data/sequences.wz\n signd\n hdiutil detach \"$mountpt\"\n hdiutil convert temp/wztemplatecopy.sparseimage -format UDZO -o out/warzone2100-hqvideo.dmg\nelse\n echo \"$sequencenme does not exist, skipping\"\nfi\n\necho \"== Cleaning up ==\"\nrm -f temp/wztemplatecopy.sparseimage\n\n# Open the dir\nopen \"out\"\n\nexit 0";
shellScript = "# Config\nsimgfl=\"http://downloads.sourceforge.net/project/warzone2100/build-tools/mac/wztemplate.sparseimage\"\nsimgflnme=\"wztemplate.sparseimage\"\nsimgflmd5=\"da10e06f2b9b2b565e70dd8e98deaaad\"\nsequence=\"http://downloads.sourceforge.net/project/warzone2100/warzone2100/Videos/2.2/standard-quality-en/sequences.wz\"\nsequencenme=\"sequences.wz\"\nsequencelo=\"http://downloads.sourceforge.net/project/warzone2100/warzone2100/Videos/2.2/low-quality-en/sequences.wz\"\nsequencelonme=\"sequences-lo.wz\"\nrelbuild=\"build/${CONFIGURATION}/\"\ndmgout=\"build/dmgout\"\ncoident=\"${SRCROOT}/configs/codeident\"\n\n# Fail if not release\nif [ \"${CONFIGURATION}\" = \"Debug\" ]; then\n\techo \"error: This should only be run as Release\" >&2\n\texit 1\nfi\n\n# codesign setup\nsignd () {\n\tif [ -f \"${coident}\" ]; then\n\t\t# Local Config\n\t\tlocal idetd=`cat ${coident}`\n\t\tlocal resrul=\"${SRCROOT}/configs/codesignrules.plist\"\n\t\tlocal appth=\"/Volumes/Warzone 2100/Warzone.app\"\n\t\t\n\t\t# Sign app\n\t\tcodesign -vfs \"${idetd}\" --keychain \"CodeSign\" --verify --resource-rules=\"${resrul}\" \"${appth}\"\n\t\t\n\t\t# Sign the frameworks\n\t\tlocal framelst=`\\ls -1 \"${appth}/Contents/Frameworks\" | sed -n 's:.framework$:&:p'`\n\t\tfor fsignd in ${framelst}; do\n\t\t\t if [ -d \"${appth}/Contents/Frameworks/${fsignd}/Versions/A\" ]; then\n\t\t\t\tcodesign -vfs \"${idetd}\" --keychain \"CodeSign\" --verify \"${appth}/Contents/Frameworks/${fsignd}/Versions/A\"\n\t\t\tfi\n\t\tdone\n\telse\n\t\techo \"warning: No codeident file found; code will not be signed.\"\n\tfi\n}\n\n# Make a dir and get the sparseimage\nmkdir -p \"$dmgout\"\ncd \"$dmgout\"\nif [ ! -f \"$simgflnme\" ]; then\n\techo \"Fetching $simgfl\"\n\tif ! curl -L -O --connect-timeout \"30\" \"$simgfl\"; then\n\t\techo \"error: Unable to fetch $simgfl\" >&2\n\t\texit 1\n\tfi\nelse\n\techo \"$simgflnme already exists, skipping\"\nfi\n\n# Get the sequences\n\n# Comment out the following to skip the high qual seq\n# if [ ! -f \"$sequencenme\" ]; then\n#\t echo \"Fetching $sequencenme\"\n#\t if [ -f \"${HOME}/Library/Application Support/Warzone 2100 master/sequences.wz\" ]; then\n#\t\t cp \"${HOME}/Library/Application Support/Warzone 2100 master/sequences.wz\" \"$sequencenme\"\n#\t elif ! curl -L --connect-timeout \"30\" -o \"$sequencenme\" \"$sequence\"; then\n#\t\t echo \"error: Unable to fetch $sequence\" >&2\n#\t\t exit 1\n#\t fi\n# else\n#\t echo \"$sequencenme already exists, skipping\"\n# fi\n#\n\n# Comment out the following to skip the low qual seq\n# if [ ! -f \"$sequencelonme\" ]; then\n#\t echo \"Fetching $sequencelonme\"\n#\t if [ -f \"${HOME}/Applications/Build/wz2100/dmgmaker/sequences-lo.wz\" ]; then\n#\t\t cp \"${HOME}/Applications/Build/wz2100/dmgmaker/sequences-lo.wz\" \"$sequencelonme\"\n#\t elif [ -f \"${HOME}/Library/Application Support/Warzone 2100 master/sequences-lq.wz\" ]; then\n#\t\t cp \"${HOME}/Library/Application Support/Warzone 2100 master/sequences-lq.wz\" \"$sequencelonme\"\n#\t elif ! curl -L --connect-timeout \"30\" -o \"$sequencelonme\" \"$sequencelo\"; then\n#\t\t echo \"error: Unable to fetch $sequencelo\" >&2\n#\t\t exit 1\n#\t fi\n# else\n#\t echo \"$sequencelonme already exists, skipping\"\n# fi\n# \n\n# Copy over the app\ncd ../../\necho \"Copying the app cleanly.\"\nrm -r -f $dmgout/Warzone.app\nif ! tar -c --exclude '.svn' --exclude 'Makefile*' --exclude 'makefile*' --exclude '.DS_Store' -C build/Release Warzone.app | tar -xC $dmgout; then\n\techo \"error: Unable to copy the app\" >&2\n\texit 1\nfi\n\n# Make the dSYM Bundle\nmkdir -p \"${dmgout}/warzone2100-dSYM\"\ncp -pPR ${relbuild}*.dSYM \"${dmgout}/warzone2100-dSYM\"\ncd \"$dmgout\"\ntar -czf warzone2100-dSYM.tar.gz --exclude '.DS_Store' warzone2100-dSYM\n\n# mkredist.bash\n\ncd Warzone.app/Contents/Resources/data/\n\necho \"== Compressing base.wz ==\"\nif [ -d base/ ]; then\n cd base/\n zip -r ../base.wz *\n cd ..\n rm -rf base/\nfi\n\necho \"== Compressing mp.wz ==\"\nif [ -d mp/ ]; then\n cd mp/\n zip -r ../mp.wz *\n cd ..\n rm -rf mp/\nfi\n\ncd mods/\n\nmodlst=`\\ls -1`\nfor moddr in ${modlst}; do\n\tif [ -d ${moddr} ]; then\n\t\tcd ${moddr}\n\t\tif [ \"${moddr}\" = \"campaign\" ]; then\n\t\t\tsbtyp=\".cam\"\n\t\telif [ \"${moddr}\" = \"global\" ]; then\n\t\t\tsbtyp=\".gmod\"\n\t\telif [ \"${moddr}\" = \"multiplay\" ]; then\n\t\t\tsbtyp=\".mod\"\n\t\telif [ \"${moddr}\" = \"music\" ]; then\n\t\t\tsbtyp=\".music\"\n\t\telse\n\t\t\tsbtyp=\"\"\n\t\tfi\n\t\tmodlstd=`ls -1`\n\t\tfor modwz in ${modlstd}; do\n\t\t\tif [ -d ${modwz} ]; then\n\t\t\t\techo \"== Compressing ${modwz}${sbtyp}.wz ==\"\n\t\t\t\tcd ${modwz}\n\t\t\t\tzip -r ../${modwz}${sbtyp}.wz *\n\t\t\t\tcd ..\n\t\t\t\trm -rf \"${modwz}/\"\n\t\t\tfi\n\t\tdone\n\t\tcd ..\n\tfi\ndone\n\ncd ../../../../../\n\nrm -rf ./out ./temp\nmkdir temp/\nmkdir out/\nmv warzone2100-dSYM temp/warzone2100-dSYM\nmv warzone2100-dSYM.tar.gz out/warzone2100-dSYM.tar.gz\n\necho \"== Creating DMG ==\"\ncp wztemplate.sparseimage temp/wztemplatecopy.sparseimage\nhdiutil resize -size 220m temp/wztemplatecopy.sparseimage\nmountpt=`hdiutil mount temp/wztemplatecopy.sparseimage | tr -d \"\\t\" | sed -E 's:(/dev/disk[0-9])( +)(/Volumes/Warzone 2100):\\1:'`\ncp -pPR Warzone.app/* /Volumes/Warzone\\ 2100/Warzone.app\nsignd\n# hdiutil detach `expr match \"$mountpt\" '\\(^[^ ]*\\)'`\nhdiutil detach \"$mountpt\"\nhdiutil convert temp/wztemplatecopy.sparseimage -format UDZO -o out/warzone2100-novideo.dmg\n\nif [ -f \"$sequencelonme\" ]; then\n\techo \"== Creating LQ DMG ==\"\n\thdiutil resize -size 420m temp/wztemplatecopy.sparseimage\n\tmountpt=`hdiutil mount temp/wztemplatecopy.sparseimage | tr -d \"\\t\" | sed -E 's:(/dev/disk[0-9])( +)(/Volumes/Warzone 2100):\\1:'`\n\tcp sequences-lo.wz /Volumes/Warzone\\ 2100/Warzone.app/Contents/Resources/data/sequences.wz\n\tsignd\n\t# hdiutil detach `expr match \"$mountpt\" '\\(^[^ ]*\\)'`\n\thdiutil detach \"$mountpt\"\n\thdiutil convert temp/wztemplatecopy.sparseimage -format UDZO -o out/warzone2100-lqvideo.dmg\nelse\n\techo \"$sequencelonme does not exist, skipping\"\nfi\n\n\nif [ -f \"$sequencenme\" ]; then\n\techo \"== Creating HQ DMG ==\"\n\thdiutil resize -size 770m temp/wztemplatecopy.sparseimage\n\tmountpt=`hdiutil mount temp/wztemplatecopy.sparseimage | tr -d \"\\t\" | sed -E 's:(/dev/disk[0-9])( +)(/Volumes/Warzone 2100):\\1:'`\n\trm /Volumes/Warzone\\ 2100/Warzone.app/Contents/Resources/data/sequences.wz\n\tcp sequences.wz /Volumes/Warzone\\ 2100/Warzone.app/Contents/Resources/data/sequences.wz\n\tsignd\n\thdiutil detach \"$mountpt\"\n\thdiutil convert temp/wztemplatecopy.sparseimage -format UDZO -o out/warzone2100-hqvideo.dmg\nelse\n\techo \"$sequencenme does not exist, skipping\"\nfi\n\necho \"== Cleaning up ==\"\nrm -f temp/wztemplatecopy.sparseimage\n\n# Open the dir\nopen \"out\"\n\nexit 0";
};
43FA570B10FF8E9B0074E914 /* SDL */ = {
isa = PBXShellScriptBuildPhase;
Expand Down

0 comments on commit 8b253a4

Please sign in to comment.