Skip to content

Commit

Permalink
sparkle update framework integrated
Browse files Browse the repository at this point in the history
  • Loading branch information
rsms committed Sep 19, 2009
1 parent 278407d commit 1fe4c90
Show file tree
Hide file tree
Showing 107 changed files with 3,434 additions and 515 deletions.
11 changes: 11 additions & 0 deletions admin/appcast.xml
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>DroPub updates</title>
<link>http://github.com/rsms/dropub</link>
<description>Appcast for DroPub updates</description>
<language>en-us</language>
<pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>
<lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
</channel>
</rss>
125 changes: 125 additions & 0 deletions admin/distribution.sh
@@ -0,0 +1,125 @@
#!/bin/bash
set -o errexit

[ $BUILD_STYLE = Release ] || { echo Distribution target requires "'Release'" build style; false; }

VERSION=$(defaults read "$BUILT_PRODUCTS_DIR/$PROJECT_NAME.app/Contents/Info" CFBundleVersion)
DOWNLOAD_BASE_URL="http://hunch.se/dropub/dist"
RELEASENOTES_URL="http://hunch.se/dropub/release-notes.html#version-$VERSION"

ARCHIVE_FILENAME="$PROJECT_NAME-$VERSION.zip"
DOWNLOAD_URL="$DOWNLOAD_BASE_URL/$ARCHIVE_FILENAME"
KEYCHAIN_PRIVKEY_NAME="DroPub release signing key (private)"

WD=$PWD
cd "$BUILT_PRODUCTS_DIR"
rm -f "$PROJECT_NAME"*.zip
ditto -ck --keepParent "$PROJECT_NAME.app" "$ARCHIVE_FILENAME"

SIZE=$(stat -f %z "$ARCHIVE_FILENAME")
PUBDATE=$(LC_TIME=c date +"%a, %d %b %G %T %z")
SIGNATURE=$(
openssl dgst -sha1 -binary < "$ARCHIVE_FILENAME" \
| openssl dgst -dss1 -sign <(security find-generic-password -g -s "$KEYCHAIN_PRIVKEY_NAME" 2>&1 1>/dev/null | perl -pe '($_) = /"(.+)"/; s/\\012/\n/g') \
| openssl enc -base64
)

# For OS X >=10.6:
#SIGNATURE=$(
# openssl dgst -sha1 -binary < "$ARCHIVE_FILENAME" \
# | openssl dgst -dss1 -sign <(security find-generic-password -g -s "$KEYCHAIN_PRIVKEY_NAME" 2>&1 1>/dev/null | perl -pe '($_) = /"(.+)"/; s/\\012/\n/g' | perl -MXML::LibXML -e 'print XML::LibXML->new()->parse_file("-")->findvalue(q(//string[preceding-sibling::key[1] = "NOTE"]))') \
# | openssl enc -base64
#)

[ $SIGNATURE ] || { echo Unable to load signing private key with name "'$KEYCHAIN_PRIVKEY_NAME'" from keychain; false; }


python - <<EOF
# encoding: utf-8
import sys, re
ITEM = '''
<item>
<title>Version $VERSION</title>
<sparkle:releaseNotesLink>$RELEASENOTES_URL</sparkle:releaseNotesLink>
<pubDate>$PUBDATE</pubDate>
<enclosure
url="$DOWNLOAD_URL"
sparkle:version="$VERSION"
type="application/octet-stream"
length="$SIZE"
sparkle:dsaSignature="$SIGNATURE"
/>
</item>
'''
newver = re.findall(r'sparkle:version="([^"]+)"', ITEM)[0]
newsig = re.findall(r'sparkle:dsaSignature="([^"]+)"', ITEM)[0]
f = open('$WD/admin/appcast.xml','r')
APPCAST = f.read()
f.close()
if newver in re.findall(r'sparkle:version="([^"]+)"', APPCAST):
print >> sys.stderr, ('Version %s is already in the appcast.xml -- you need to manually '\
'remove it from the appcast.xml if this is not an error.') % newver
sys.exit(1)
elif newsig in re.findall(r'sparkle:dsaSignature="([^"]+)"', APPCAST):
print >> sys.stderr, ('Signature %s is already in the appcast.xml -- you need to manually '\
'remove it from the appcast.xml if this is not an error.') % newsig
sys.exit(1)
APPCAST = re.compile(r'(\n[ \r\n\t]*</channel>)', re.M).sub(ITEM.rstrip()+r'\1', APPCAST)
APPCAST = re.compile(r'^\t\t<pubDate>([^<]*)</pubDate>', re.M).sub('\t\t<pubDate>$PUBDATE</pubDate>', APPCAST)
APPCAST = re.compile(r'^\t\t<lastBuildDate>([^<]*)</lastBuildDate>', re.M).sub('\t\t<lastBuildDate>$PUBDATE</lastBuildDate>', APPCAST)
open('$WD/admin/appcast.xml','w').write(APPCAST)
EOF

python - <<EOF
# encoding: utf-8
import sys, re
ITEM = '''
<section id="version-$VERSION">
<h2>Version $VERSION</h2>
<ul>
<li>DESCRIPTION</li>
</ul>
</section>
'''
VERSIONRE = r'<section id="version-([^"]+)">'
newver = re.findall(VERSIONRE, ITEM)[0]
f = open('$WD/admin/release-notes.html','r')
HTML = f.read()
f.close()
if newver in re.findall(VERSIONRE, HTML):
print >> sys.stderr, ('Version %s is already in the release-notes.html -- you need to manually '\
'remove it from release-notes.html if this is not an error.') % newver
sys.exit(1)
HTML = re.compile(r'(\n[ \r\n\t]*</body>)', re.M).sub(ITEM.rstrip()+r'\1', HTML)
open('$WD/admin/release-notes.html','w').write(HTML)
EOF

PATH=~/bin:$PATH # if mate is in home/bin
mate -a "$WD/admin/appcast.xml" "$WD/admin/release-notes.html"
mate -a <<EOF
------------- INSTRUCTIONS -------------
1. Complete the new entry created in release-notes.html
mate '$WD/admin/release-notes.html'
2. Publish the archive, release notes and appcast -- in that order:
scp '$BUILT_PRODUCTS_DIR/$ARCHIVE_FILENAME' hunch.se:/var/www/hunch.se/www/public/dropub/dist/
scp '$WD/admin/release-notes.html' hunch.se:/var/www/hunch.se/www/public/dropub/release-notes.html
scp '$WD/admin/appcast.xml' hunch.se:/var/www/hunch.se/www/public/dropub/appcast.xml
3. Commit, tag and push the source
git ci 'Release $VERSION'
git tag -m 'Release $VERSION' 'v$VERSION'
git pu
EOF
15 changes: 15 additions & 0 deletions admin/release-notes.html
@@ -0,0 +1,15 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>DroPub release notes</title>
<meta name="robots" content="anchors">
<style type="text/css" media="screen">
body { margin: 2px 12px 12px 12px; font-size:13px; background:white; color:#222; }
p,li,a,a:hover,h1,h2,h3 { font-family:helvetica,arial,sans-serif; }
h2 { font-size:16px; }
</style>
</head>
<body>
</body>
</html>
114 changes: 113 additions & 1 deletion dropub.xcodeproj/project.pbxproj
Expand Up @@ -6,6 +6,21 @@
objectVersion = 45;
objects = {

/* Begin PBXAggregateTarget section */
3A919A2F10658585002D0F4B /* Distribution */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 3A919A46106585A1002D0F4B /* Build configuration list for PBXAggregateTarget "Distribution" */;
buildPhases = (
3A919A4410658592002D0F4B /* ShellScript */,
);
dependencies = (
3A919A52106586A9002D0F4B /* PBXTargetDependency */,
);
name = Distribution;
productName = Distribution;
};
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
3A1504AE10618DDF00263983 /* DPAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A1504AD10618DDF00263983 /* DPAppDelegate.m */; };
3A5DB2781062C89000B5F45F /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A5DB2771062C89000B5F45F /* MainMenu.xib */; };
Expand All @@ -17,6 +32,9 @@
3A91991E1065620D002D0F4B /* NSError+DPAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A91991D1065620D002D0F4B /* NSError+DPAdditions.m */; };
3A91998910657080002D0F4B /* NSTask+DpAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A91998810657080002D0F4B /* NSTask+DpAdditions.m */; };
3A919A0410657FF0002D0F4B /* NSString+DPAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A919A0310657FF0002D0F4B /* NSString+DPAdditions.m */; };
3A919A57106586E4002D0F4B /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A919A56106586E4002D0F4B /* Sparkle.framework */; };
3A919A621065874D002D0F4B /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 3A919A56106586E4002D0F4B /* Sparkle.framework */; };
3A919A8C106590CC002D0F4B /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 3A919A8B106590CC002D0F4B /* dsa_pub.pem */; };
3A9D29D1106194D3008923FD /* DPSupervisor.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A9D29D0106194D3008923FD /* DPSupervisor.m */; };
3A9D29E110619EC9008923FD /* DPSendFileOp.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A9D29E010619EC9008923FD /* DPSendFileOp.m */; };
3A9D2A5E1061B083008923FD /* status-item-standby.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A9D2A5B1061B083008923FD /* status-item-standby.png */; };
Expand All @@ -27,6 +45,30 @@
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
3A919A51106586A9002D0F4B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8D1107260486CEB800E47090 /* Dropub */;
remoteInfo = Dropub;
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
3A919A651065874F002D0F4B /* Copy Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
3A919A621065874D002D0F4B /* Sparkle.framework in Copy Frameworks */,
);
name = "Copy Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
Expand All @@ -52,6 +94,8 @@
3A91998810657080002D0F4B /* NSTask+DpAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSTask+DpAdditions.m"; path = "src/NSTask+DpAdditions.m"; sourceTree = "<group>"; };
3A919A0210657FF0002D0F4B /* NSString+DPAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSString+DPAdditions.h"; path = "src/NSString+DPAdditions.h"; sourceTree = "<group>"; };
3A919A0310657FF0002D0F4B /* NSString+DPAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSString+DPAdditions.m"; path = "src/NSString+DPAdditions.m"; sourceTree = "<group>"; };
3A919A56106586E4002D0F4B /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = frameworks/Sparkle.framework; sourceTree = "<group>"; };
3A919A8B106590CC002D0F4B /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = dsa_pub.pem; path = resources/dsa_pub.pem; sourceTree = "<group>"; };
3A9D29CF106194D3008923FD /* DPSupervisor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DPSupervisor.h; path = src/DPSupervisor.h; sourceTree = "<group>"; };
3A9D29D0106194D3008923FD /* DPSupervisor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DPSupervisor.m; path = src/DPSupervisor.m; sourceTree = "<group>"; };
3A9D29DF10619EC9008923FD /* DPSendFileOp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DPSendFileOp.h; path = src/DPSendFileOp.h; sourceTree = "<group>"; };
Expand All @@ -61,7 +105,7 @@
3A9D2A5D1061B083008923FD /* status-item-selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "status-item-selected.png"; path = "resources/status-item-selected.png"; sourceTree = "<group>"; };
3A9D2AB81061B799008923FD /* DSFileExistenceMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DSFileExistenceMonitor.h; path = src/DSFileExistenceMonitor.h; sourceTree = "<group>"; };
3A9D2AB91061B799008923FD /* DSFileExistenceMonitor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DSFileExistenceMonitor.m; path = src/DSFileExistenceMonitor.m; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = resources/Info.plist; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; explicitFileType = text.xml; fileEncoding = 4; name = Info.plist; path = resources/Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* DroPub.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DroPub.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

Expand All @@ -71,6 +115,7 @@
buildActionMask = 2147483647;
files = (
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
3A919A57106586E4002D0F4B /* Sparkle.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -80,6 +125,7 @@
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
3A919A56106586E4002D0F4B /* Sparkle.framework */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
Expand Down Expand Up @@ -148,6 +194,7 @@
29B97317FDCFA39411CA2CEA /* resources */ = {
isa = PBXGroup;
children = (
3A919A8B106590CC002D0F4B /* dsa_pub.pem */,
3A9196291063D08A002D0F4B /* icon.icns */,
3A9D2A5B1061B083008923FD /* status-item-standby.png */,
3A9D2A5C1061B083008923FD /* status-item-sending.png */,
Expand Down Expand Up @@ -177,6 +224,7 @@
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
3A919A651065874F002D0F4B /* Copy Frameworks */,
);
buildRules = (
);
Expand All @@ -201,6 +249,7 @@
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* Dropub */,
3A919A2F10658585002D0F4B /* Distribution */,
);
};
/* End PBXProject section */
Expand All @@ -215,11 +264,28 @@
3A9D2A601061B083008923FD /* status-item-selected.png in Resources */,
3A5DB2781062C89000B5F45F /* MainMenu.xib in Resources */,
3A91962A1063D08A002D0F4B /* icon.icns in Resources */,
3A919A8C106590CC002D0F4B /* dsa_pub.pem in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
3A919A4410658592002D0F4B /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "/bin/bash admin/distribution.sh\nexit $?";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
8D11072C0486CEB800E47090 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand All @@ -242,12 +308,45 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
3A919A52106586A9002D0F4B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8D1107260486CEB800E47090 /* Dropub */;
targetProxy = 3A919A51106586A9002D0F4B /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
3A919A3010658585002D0F4B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
PRODUCT_NAME = Distribution;
};
name = Debug;
};
3A919A3110658585002D0F4B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
PRODUCT_NAME = Distribution;
ZERO_LINK = NO;
};
name = Release;
};
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/frameworks\"",
);
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_ENABLE_OBJC_GC = required;
Expand All @@ -267,6 +366,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/frameworks\"",
);
GCC_ENABLE_OBJC_GC = required;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
Expand Down Expand Up @@ -307,6 +410,15 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
3A919A46106585A1002D0F4B /* Build configuration list for PBXAggregateTarget "Distribution" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3A919A3010658585002D0F4B /* Debug */,
3A919A3110658585002D0F4B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Dropub" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
1 change: 1 addition & 0 deletions frameworks/Sparkle.framework/Headers
1 change: 1 addition & 0 deletions frameworks/Sparkle.framework/Resources
1 change: 1 addition & 0 deletions frameworks/Sparkle.framework/Sparkle

0 comments on commit 1fe4c90

Please sign in to comment.