Skip to content
This repository
Browse code

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...
commit 5cafc138fcb7eb2d271430949699622280ddcc36 1 parent b77c33e
martinh martinh authored

Showing 2 changed files with 29 additions and 5 deletions. Show diff stats Hide diff stats

  1. +18 5 Makefile
  2. +11 0 appcast.xml.in
23 Makefile
@@ -479,6 +479,7 @@ XORKEY_LDLIBS =
479 479 ifneq ($(CONFIGURATION),RELEASE)
480 480 CFLAGS += -DUSE_SPARKLE
481 481 APP_FRAMEWORKS += Sparkle
  482 +RESOURCES += sparkle_pub.pem
482 483 endif
483 484
484 485 # Crash Reporter requires AddressBook framework for getting the users email address
@@ -689,12 +690,16 @@ $(APPDIR)/Contents/PkgInfo: app/Vico-Info.plist
689 690
690 691 TMPDMG = $(BUILDDIR)/vico-tmp.dmg
691 692 VOLNAME = vico-$(SHORT_VERSION)
692   -DMG = $(BUILDDIR)/$(VOLNAME).dmg
  693 +DMGFILE = $(VOLNAME).dmg
  694 +DMG = $(BUILDDIR)/$(DMGFILE)
693 695 DMGDIR = "$(BUILDDIR)/Vico $(SHORT_VERSION)"
694   -APPCAST_BASE = "http://www.vicoapp.com/relnotes"
695   -DOWNLOAD_BASE = "http://www.vicoapp.com/download"
  696 +APPCAST_BASE = http://www.vicoapp.com/relnotes
  697 +DOWNLOAD_BASE = http://www.vicoapp.com/download
696 698 KSIZE = $(shell du -ks $(APPDIR) | cut -f1)
697   -SIZE = $(shell $$(($(KSIZE) * 1024)) )
  699 +SIZE = $(shell echo $$(($(KSIZE) * 1024)) )
  700 +SPARKLE_PKEY = sparkle_priv.pem
  701 +SIGNATURE = $(shell /usr/bin/openssl dgst -sha1 -binary < $(DMG) | /usr/bin/openssl dgst -dss1 -sign $(SPARKLE_PKEY) | /usr/bin/openssl enc -base64)
  702 +APPCAST_XML = $(DMG).xml
698 703
699 704 dmg: $(DMG)
700 705
@@ -708,9 +713,17 @@ $(DMG): app
708 713 hdiutil convert -format UDBZ $(TMPDMG) -o $(DMG)
709 714 /bin/rm -rf $(TMPDMG) $(DMGDIR)
710 715 ls -lh $(DMG)
  716 + #### Create and sign a zip file for automatic updates.
  717 + @sed -e 's,@SHORT_VERSION@,$(SHORT_VERSION),g' \
  718 + -e 's,@REPO_VERSION@,$(REPO_VERSION),g' \
  719 + -e 's,@RELNOTES_LINK@,$(APPCAST_BASE)/$(SHORT_VERSION),g' \
  720 + -e 's/@DATE@/$(shell LC_TIME=en_US date +"%a, %d %b %G %T %z")/g' \
  721 + -e 's,@DOWNLOAD_FILE@,$(DOWNLOAD_BASE)/$(DMGFILE),g' \
  722 + -e 's,@SIGNATURE@,$(SIGNATURE),g' \
  723 + -e 's,@SIZE@,$(SIZE),g' < appcast.xml.in > $(APPCAST_XML)
  724 + @cat $(APPCAST_XML)
711 725 @echo "scp $(DMG) vicoapp.com:/var/www/vicoapp.com/download"
712 726
713   -
714 727 # include automatic dependencies...
715 728 -include $(OBJS:.o=.d)
716 729
11 appcast.xml.in
... ... @@ -0,0 +1,11 @@
  1 +<item>
  2 + <title>Version @SHORT_VERSION@</title>
  3 + <sparkle:releaseNotesLink>@RELNOTES_LINK@.html</sparkle:releaseNotesLink>
  4 + <pubDate>@DATE@</pubDate>
  5 + <enclosure url="@DOWNLOAD_FILE@"
  6 + sparkle:version="@REPO_VERSION@"
  7 + sparkle:shortVersionString="@SHORT_VERSION@"
  8 + sparkle:dsaSignature="@SIGNATURE@"
  9 + length="@SIZE@"
  10 + type="application/octet-stream" />
  11 +</item>

0 comments on commit 5cafc13

Please sign in to comment.
Something went wrong with that request. Please try again.