Revision: 5237
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5237&view=rev
Author:   hofman
Date:     2009-03-02 23:03:07 +0000 (Mon, 02 Mar 2009)

Log Message:
-----------
improve disk image script

Modified Paths:
--------------
    trunk/Skim.xcodeproj/project.pbxproj

Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj        2009-03-02 22:20:42 UTC (rev 
5236)
+++ trunk/Skim.xcodeproj/project.pbxproj        2009-03-02 23:03:07 UTC (rev 
5237)
@@ -1992,7 +1992,7 @@
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "# app name, also image 
name\nNAME=Skim\n\n# app bundle to 
copy\nSRC_BUNDLE=\"${BUILT_PRODUCTS_DIR}/${NAME}.app\"\n\n# template image in 
source folder\nSRC_IMAGE=\"${SOURCE_ROOT}/${NAME}.dmg\"\n\n# temporary 
image\nDST_IMAGE=/tmp/${NAME}.dmg\n\n# temporary 
volume\nDST_VOLUME=/Volumes/${NAME}\n\n# version\nVERSION=`/usr/bin/defaults 
read \"${SRC_BUNDLE}/Contents/Info\" CFBundleShortVersionString`\n\n# final 
distribution image\nFINAL_IMAGE=\"${HOME}/Desktop/${NAME}-${VERSION}.dmg\"\n\n# 
see if this file already exists and bail\nif [ -f \"${FINAL_IMAGE}\" ]; 
then\n\techo \"error: ${FINAL_IMAGE} exists\"\n\texit 1\nfi\n\n# see if a 
volume is already mounted or a\n# previous cp operation was botched\nif [ -e 
\"${DST_VOLUME}\" ]; then\n\techo \"error: ${DST_VOLUME} exists\"\n\techo 
\"warning: opening ${DST_VOLUME} in Finder\"\n\t/usr/bin/open 
${DST_VOLUME}\n\texit 1\nfi\n\n# remove temp image from a previous run\nif [ -f 
\"${DST_IMAGE}\" ]; then\n\techo \"warning: removing ${DST_IMAGE}\"\n\t/bin/rm 
\"${DST_IMAGE}\"\n\tif [ $? != 0 ]; then\n\t\techo \"error: failed to remove 
${DST_IMAGE}\"\n\t\texit 1\n\tfi\nfi\n\n# stored zipped in svn, so unzip if 
needed\n# pass o to overwrite, or unzip waits for stdin\n# when trying to 
unpack the resource fork/EA\n\nif [ ! -f \"${SRC_IMAGE}\" ]; 
then\n\t/usr/bin/unzip -uo \"${SRC_IMAGE}.zip\"\n\tif [ $? != 0 ]; 
then\n\t\techo \"error: failed to unzip ${SRC_IMAGE}.zip\"\n\t\texit 
1\n\tfi\nfi\n\n# copy empty image to /tmp\n/bin/cp ${SRC_IMAGE} /tmp\nif [ $? 
!= 0 ]; then\n\techo \"error: failed to copy ${SRC_IMAGE} to /tmp\"\n\texit 
1\nfi\n\n# mount image\n/usr/bin/hdiutil attach ${DST_IMAGE}\nif [ $? != 0 ]; 
then\n\techo \"error: failed to mount ${DST_IMAGE}\"\n\texit 1\nfi\n\n# use 
CpMac to copy all files\n${SYSTEM_DEVELOPER_TOOLS}/CpMac -r \"${SRC_BUNDLE}\" 
\"${DST_VOLUME}\"\nif [ $? != 0 ]; then\n\techo \"error: failed to copy 
${SRC_BUNDLE}\"\n\texit 1\nfi\n\n# tell finder to set the icon 
position\n/usr/bin/osascript -e \"tell application \\\"Finder\\\" to set the 
position of application file \\\"${NAME}.app\\\" of disk named \\\"${NAME}\\\" 
to {90, 206}\"\nif [ $? != 0 ]; then\n\techo \"error: Finder failed to set 
position\"\n\texit 1\nfi\n\n# data is copied, so unmount the 
volume\n/usr/sbin/diskutil eject \"${DST_VOLUME}\"\nif [ $? != 0 ]; 
then\n\techo \"error: failed to eject ${DST_VOLUME}\"\n\texit 1\nfi\n\n# resize 
image to fit\n/usr/bin/hdiutil resize -size `/usr/bin/hdiutil resize 
\"${DST_IMAGE}\" | cut -f -1 -`b \"${DST_IMAGE}\"\nif [ $? != 0 ]; then\n\techo 
\"error: failed to resize ${DST_IMAGE}\"\n\texit 1\nfi\n\n# convert image to 
read only and compress\n/usr/bin/hdiutil convert \"${DST_IMAGE}\" -format UDZO 
-imagekey zlib-level=9 -o \"${FINAL_IMAGE}\"\nif [ $? != 0 ]; then\n\techo 
\"error: failed to convert ${DST_IMAGE}\"\n\texit 1\nfi\n\n# set 
internet-enable bit for Safari, even\n# though I dislike internet-enabled 
images...\n/usr/bin/hdiutil internet-enable -YES \"${FINAL_IMAGE}\"\nif [ $? != 
0 ]; then\n\techo \"error: failed to internet-enable ${DST_IMAGE}\"\n\texit 
1\nfi\n\n# remove temp image and source image\n/bin/rm -f \"${DST_IMAGE}\" 
\"${SRC_IMAGE}\"\nif [ $? != 0 ]; then\n\techo \"error: failed to remove 
${DST_IMAGE}\" or  \"${SRC_IMAGE}\"\n\texit 1\nfi\n\n# create the Sparkle 
appcast\n# see 
http://www.entropy.ch/blog/Developer/2008/09/22/Sparkle-Appcast-Automation-in-Xcode.html\n\nDATE=`/bin/date
 +\"%a, %d %b %Y %T %z\"`\nSIZE=`/usr/bin/stat -f %z 
\"${FINAL_IMAGE}\"`\nVERSION_NUMBER=`/usr/bin/defaults read 
\"${SRC_BUNDLE}/Contents/Info\" 
CFBundleVersion`\nURL=http://downloads.sourceforge.net/skim-app/${NAME}-${VERSION}.dmg\nSIGNATURE=\"\"\nAPPCAST=\"${HOME}/Desktop/${NAME}-${VERSION}.xml\"\nKEY_NAME=\"${NAME}
 Sparkle Key\"\nSIGNATURE=`openssl dgst -sha1 -binary < \"${FINAL_IMAGE}\" | 
openssl dgst -dss1 -sign <(security find-generic-password -g -s \"${KEY_NAME}\" 
2>&1 1>/dev/null | perl -pe '($_) = /\"(.+)\"/; s/\\\\012/\\n/g') | openssl enc 
-base64`\n\n/bin/cat > ${APPCAST} << EOF\n<?xml version=\"1.0\" 
encoding=\"utf-8\"?> \n<rss version=\"2.0\" 
xmlns:sparkle=\"http://www.andymatuschak.org/xml-namespaces/sparkle\";  
xmlns:dc=\"http://purl.org/dc/elements/1.1/\";>\n    <channel> \n        
<title>Skim Changelog</title>\n        
<link>http://skim-app.sourceforge.net</link>\n        <description>PDF reader 
and note-taker</description>\n        <item>\n            <title>Version 
1.2.1</title>\n            <description><![CDATA[\n<h1>Version 
${VERSION}</h1>\n\n<h2>New Features</h2>\n<ul>\n<li></li>\n</ul>\n\n<h2>Bugs 
Fixed</h2>\n<ul>\n<li></li>\n</ul>\n\t\t\t]]></description>\n            
<pubDate>${DATE}</pubDate>\n            <enclosure 
sparkle:version=\"${VERSION_NUMBER}\" sparkle:shortVersionString=\"${VERSION}\" 
url=\"${URL}\" sparkle:dsaSignature=\"${SIGNATURE}\" length=\"${SIZE}\" 
type=\"application/x-apple-diskimage\"/>\n        </item>\n\n    
</channel>\n</rss>\nEOF\n\nexit 0\n";
+                       shellScript = "# app name, also image 
name\nNAME=Skim\n\n# app bundle to 
copy\nSRC_BUNDLE=\"${BUILT_PRODUCTS_DIR}/${NAME}.app\"\n\n# template image in 
source folder\nSRC_IMAGE=\"${SOURCE_ROOT}/${NAME}.dmg\"\n\n# temporary 
image\nDST_IMAGE=\"/tmp/${NAME}.dmg\"\n\n# temporary 
volume\nDST_VOLUME=\"/Volumes/${NAME}\"\n\n# 
version\nVERSION=$(/usr/bin/defaults read \"${SRC_BUNDLE}/Contents/Info\" 
CFBundleShortVersionString)\n\n# final distribution 
image\nFINAL_IMAGE=\"${HOME}/Desktop/${NAME}-${VERSION}.dmg\"\n\n# see if this 
file already exists and bail\nif [ -f \"${FINAL_IMAGE}\" ]; then\n\techo 
\"error: ${FINAL_IMAGE} exists\"\n\texit 1\nfi\n\n# see if a volume is already 
mounted or a\n# previous cp operation was botched\nif [ -e \"${DST_VOLUME}\" ]; 
then\n\techo \"error: ${DST_VOLUME} exists\"\n\techo \"warning: opening 
${DST_VOLUME} in Finder\"\n\t/usr/bin/open ${DST_VOLUME}\n\texit 1\nfi\n\n# 
remove temp image from a previous run\nif [ -f \"${DST_IMAGE}\" ]; then\n\techo 
\"warning: removing ${DST_IMAGE}\"\n\t/bin/rm \"${DST_IMAGE}\"\n\tif [ $? != 0 
]; then\n\t\techo \"error: failed to remove ${DST_IMAGE}\"\n\t\texit 
1\n\tfi\nfi\n\n# stored zipped in svn, so unzip if needed\n# pass o to 
overwrite, or unzip waits for stdin\n# when trying to unpack the resource 
fork/EA\n\nif [ ! -f \"${SRC_IMAGE}\" ]; then\n\t/usr/bin/unzip -uo 
\"${SRC_IMAGE}.zip\"\n\tif [ $? != 0 ]; then\n\t\techo \"error: failed to unzip 
${SRC_IMAGE}.zip\"\n\t\texit 1\n\tfi\nfi\n\n# copy empty image to /tmp\n/bin/cp 
\"${SRC_IMAGE}\" \"${DST_IMAGE}\"\nif [ $? != 0 ]; then\n\techo \"error: failed 
to copy ${SRC_IMAGE} to ${DST_IMAGE}\"\n\texit 1\nfi\n\n# mount 
image\n/usr/bin/hdiutil attach \"${DST_IMAGE}\"\nif [ $? != 0 ]; then\n\techo 
\"error: failed to mount ${DST_IMAGE}\"\n\texit 1\nfi\n\n# use CpMac to copy 
all files\n${SYSTEM_DEVELOPER_TOOLS}/CpMac -r \"${SRC_BUNDLE}\" 
\"${DST_VOLUME}\"\nif [ $? != 0 ]; then\n\techo \"error: failed to copy 
${SRC_BUNDLE}\"\n\texit 1\nfi\n\n# tell finder to set the icon 
position\n/usr/bin/osascript -e \"tell application \\\"Finder\\\" to set the 
position of application file \\\"${NAME}.app\\\" of disk named \\\"${NAME}\\\" 
to {90, 206}\"\nif [ $? != 0 ]; then\n\techo \"error: Finder failed to set 
position\"\n\texit 1\nfi\n\n# data is copied, so unmount the 
volume\n/usr/sbin/diskutil eject \"${DST_VOLUME}\"\nif [ $? != 0 ]; 
then\n\techo \"error: failed to eject ${DST_VOLUME}\"\n\texit 1\nfi\n\n# resize 
image to fit\n/usr/bin/hdiutil resize -size $(/usr/bin/hdiutil resize 
\"${DST_IMAGE}\" | cut -f -1 -)b \"${DST_IMAGE}\"\nif [ $? != 0 ]; then\n\techo 
\"error: failed to resize ${DST_IMAGE}\"\n\texit 1\nfi\n\n# convert image to 
read only and compress\n/usr/bin/hdiutil convert \"${DST_IMAGE}\" -format UDZO 
-imagekey zlib-level=9 -o \"${FINAL_IMAGE}\"\nif [ $? != 0 ]; then\n\techo 
\"error: failed to convert ${DST_IMAGE}\"\n\texit 1\nfi\n\n# set 
internet-enable bit for Safari, even\n# though I dislike internet-enabled 
images...\n/usr/bin/hdiutil internet-enable -YES \"${FINAL_IMAGE}\"\nif [ $? != 
0 ]; then\n\techo \"error: failed to internet-enable ${DST_IMAGE}\"\n\texit 
1\nfi\n\n# remove temp image and source image\n/bin/rm -f \"${DST_IMAGE}\" 
\"${SRC_IMAGE}\"\nif [ $? != 0 ]; then\n\techo \"error: failed to remove 
${DST_IMAGE}\" or  \"${SRC_IMAGE}\"\n\texit 1\nfi\n\n# create the Sparkle 
appcast\n# see 
http://www.entropy.ch/blog/Developer/2008/09/22/Sparkle-Appcast-Automation-in-Xcode.html\n\nDATE=$(/bin/date
 +\"%a, %d %b %Y %T %z\")\nSIZE=$(/usr/bin/stat -f %z 
\"${FINAL_IMAGE}\")\nVERSION_NUMBER=$(/usr/bin/defaults read 
\"${SRC_BUNDLE}/Contents/Info\" 
CFBundleVersion)\nURL=h\"ttp://downloads.sourceforge.net/skim-app/${NAME}-${VERSION}.dmg\"\nAPPCAST=\"${HOME}/Desktop/${NAME}-${VERSION}.xml\"\nKEY_NAME=\"${NAME}
 Sparkle Key\"\nSIGNATURE=$(openssl dgst -sha1 -binary < \"${FINAL_IMAGE}\" | 
openssl dgst -dss1 -sign <(security find-generic-password -g -s \"${KEY_NAME}\" 
2>&1 1>/dev/null | perl -pe '($_) = /\"(.+)\"/; s/\\\\012/\\n/g') | openssl enc 
-base64)\n\n/bin/cat > ${APPCAST} << EOF\n<?xml version=\"1.0\" 
encoding=\"utf-8\"?> \n<rss version=\"2.0\" 
xmlns:sparkle=\"http://www.andymatuschak.org/xml-namespaces/sparkle\";  
xmlns:dc=\"http://purl.org/dc/elements/1.1/\";>\n    <channel> \n        
<title>${NAME} Changelog</title>\n        
<link>http://skim-app.sourceforge.net</link>\n        <description>PDF reader 
and note-taker</description>\n        <item>\n            <title>Version 
${VERSION}</title>\n            <description><![CDATA[\n<h1>Version 
${VERSION}</h1>\n\n<h2>New Features</h2>\n<ul>\n<li></li>\n</ul>\n\n<h2>Bugs 
Fixed</h2>\n<ul>\n<li></li>\n</ul>\n\t\t\t]]></description>\n            
<pubDate>${DATE}</pubDate>\n            <enclosure 
sparkle:version=\"${VERSION_NUMBER}\" sparkle:shortVersionString=\"${VERSION}\" 
url=\"${URL}\" sparkle:dsaSignature=\"${SIGNATURE}\" length=\"${SIZE}\" 
type=\"application/x-apple-diskimage\"/>\n        </item>\n\n    
</channel>\n</rss>\nEOF\n\nexit 0\n";
                };
                CEE1383C0BCEA63F00BF2D3E /* Run Script: Genstrings */ = {
                        isa = PBXShellScriptBuildPhase;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to