Permalink
Browse files

Create appcast.xml files when building disk images.

Also distribute the public key for update validation.
Version 1.3.1 can thus not be updated automatically.
  • Loading branch information...
1 parent b77c33e commit 5cafc138fcb7eb2d271430949699622280ddcc36 @martinh martinh committed Mar 18, 2012
Showing with 29 additions and 5 deletions.
  1. +18 −5 Makefile
  2. +11 −0 appcast.xml.in
View
23 Makefile
@@ -479,6 +479,7 @@ XORKEY_LDLIBS =
ifneq ($(CONFIGURATION),RELEASE)
CFLAGS += -DUSE_SPARKLE
APP_FRAMEWORKS += Sparkle
+RESOURCES += sparkle_pub.pem
endif
# Crash Reporter requires AddressBook framework for getting the users email address
@@ -689,12 +690,16 @@ $(APPDIR)/Contents/PkgInfo: app/Vico-Info.plist
TMPDMG = $(BUILDDIR)/vico-tmp.dmg
VOLNAME = vico-$(SHORT_VERSION)
-DMG = $(BUILDDIR)/$(VOLNAME).dmg
+DMGFILE = $(VOLNAME).dmg
+DMG = $(BUILDDIR)/$(DMGFILE)
DMGDIR = "$(BUILDDIR)/Vico $(SHORT_VERSION)"
-APPCAST_BASE = "http://www.vicoapp.com/relnotes"
-DOWNLOAD_BASE = "http://www.vicoapp.com/download"
+APPCAST_BASE = http://www.vicoapp.com/relnotes
+DOWNLOAD_BASE = http://www.vicoapp.com/download
KSIZE = $(shell du -ks $(APPDIR) | cut -f1)
-SIZE = $(shell $$(($(KSIZE) * 1024)) )
+SIZE = $(shell echo $$(($(KSIZE) * 1024)) )
+SPARKLE_PKEY = sparkle_priv.pem
+SIGNATURE = $(shell /usr/bin/openssl dgst -sha1 -binary < $(DMG) | /usr/bin/openssl dgst -dss1 -sign $(SPARKLE_PKEY) | /usr/bin/openssl enc -base64)
+APPCAST_XML = $(DMG).xml
dmg: $(DMG)
@@ -708,9 +713,17 @@ $(DMG): app
hdiutil convert -format UDBZ $(TMPDMG) -o $(DMG)
/bin/rm -rf $(TMPDMG) $(DMGDIR)
ls -lh $(DMG)
+ #### Create and sign a zip file for automatic updates.
+ @sed -e 's,@SHORT_VERSION@,$(SHORT_VERSION),g' \
+ -e 's,@REPO_VERSION@,$(REPO_VERSION),g' \
+ -e 's,@RELNOTES_LINK@,$(APPCAST_BASE)/$(SHORT_VERSION),g' \
+ -e 's/@DATE@/$(shell LC_TIME=en_US date +"%a, %d %b %G %T %z")/g' \
+ -e 's,@DOWNLOAD_FILE@,$(DOWNLOAD_BASE)/$(DMGFILE),g' \
+ -e 's,@SIGNATURE@,$(SIGNATURE),g' \
+ -e 's,@SIZE@,$(SIZE),g' < appcast.xml.in > $(APPCAST_XML)
+ @cat $(APPCAST_XML)
@echo "scp $(DMG) vicoapp.com:/var/www/vicoapp.com/download"
-
# include automatic dependencies...
-include $(OBJS:.o=.d)
View
11 appcast.xml.in
@@ -0,0 +1,11 @@
+<item>
+ <title>Version @SHORT_VERSION@</title>
+ <sparkle:releaseNotesLink>@RELNOTES_LINK@.html</sparkle:releaseNotesLink>
+ <pubDate>@DATE@</pubDate>
+ <enclosure url="@DOWNLOAD_FILE@"
+ sparkle:version="@REPO_VERSION@"
+ sparkle:shortVersionString="@SHORT_VERSION@"
+ sparkle:dsaSignature="@SIGNATURE@"
+ length="@SIZE@"
+ type="application/octet-stream" />
+</item>

0 comments on commit 5cafc13

Please sign in to comment.