Preparation for dmg delta updates.

cusax-fix
Damian Minkov 15 years ago
parent 722ca25eb5
commit 9e60293bde

@ -15,3 +15,11 @@ link.download.debian=http\://download.jitsi.org/jitsi/debian/${package.name}_${s
link.download.generic=http\://download.jitsi.org/jitsi/generic/${package.name}-${sip-communicator.version}.jar
link.download.linux=http\://download.jitsi.org/jitsi/linux/${package.name}-${sip-communicator.version}-linux.bin
link.updates.macosx=http\://download.jitsi.org/jitsi/macosx/sparkle/updates.xml
#link.download.macosx=http\://download.jitsi.org/jitsi/macosx/${package.name}-${sip-communicator.version}.dmg
#link.sparkle.updates.index=http://download.jitsi.org/jitsi/macosx/sparkle/index.html
#link.update.changelog.prefix=http://bluejimp.com/sip-communicator/changelogs
# The private_key file (sparkle_dsa_priv.pem)
#sparkle.signiture.location=/Users/damencho/dev/sparkle-files/dsa_sign/sparkle_dsa_priv.pem
#sparkle.delta.history.location=/Users/damencho/dev/build-history
#sparkle.delta.history.size=10
#sparkle.delta.download.location=http\://download.jitsi.org/jitsi/macosx/

@ -58,6 +58,13 @@
classname="net.charabia.jsmoothgen.ant.JSmoothGen"
classpath="${inst.resrc}/windows/jsmoothgen-ant.jar"/>
</target>
<!-- include ant-contrib tasks-->
<target name="define-ant-contrib-task">
<taskdef resource="net/sf/antcontrib/antlib.xml"
classpath="${inst.resrc}/lib/ant-contrib-1.0b3.jar"/>
</target>
<!--target name="windows-generate-exe" depends="define-jsmooth-task"
if="application.home.dirname">
@ -1232,6 +1239,230 @@
<!-- Delete the temporary image -->
<delete file="${macosx.app.dir}/${macosx.dmg.tmpname}"
quiet="yes" failonerror="false"/>
<!-- creates the sparkle xmls -->
<antcall target="macosx-sparkle-files"/>
<antcall target="macosx-sparkle-delta-updates"/>
<!-- To be able to insert deltas in the updates xml
we use the token @SPARKLE_DELTAS@. And when finished
puting deltas (no matter if there were any at all if option
is not enabled) we must remove the SPARKLE_DELTAS token if left.
-->
<filter token="SPARKLE_DELTAS" value="" />
<move file="${macosx.app.dir}/sparkle/updates-tmp.xml"
tofile="${macosx.app.dir}/sparkle/updates.xml"
overwrite="true" filtering="yes"/>
</target>
<target name="macosx-sparkle-files" if="sparkle.signiture.location">
<exec executable="bash" os="Mac OS X" failonerror="true"
outputproperty="signature.base64">
<arg value="-c"/>
<arg value="openssl dgst -sha1 -binary &lt; ${macosx.app.dir}/${macosx.dmg.name} | openssl dgst -dss1 -sign ${sparkle.signiture.location} | openssl enc -base64"/>
</exec>
<length file="${macosx.app.dir}/${macosx.dmg.name}"
property="dmg.file.length" />
<copy todir="${macosx.app.dir}/sparkle">
<fileset dir="${macosx.resrc.dir}/sparkle-files/sparkle"/>
</copy>
<tstamp>
<format property="current.tstamp" pattern="EEE d MMM yyyy HH:mm:ss"/>
</tstamp>
<filter token="BUILD" value="${sparkle.build}" />
<filter token="DATE" value="${current.tstamp}" />
<filter token="APP_NAME" value="${application.name}" />
<filter token="SPARKLE_UPDATES" value="${link.updates.macosx}" />
<filter token="SPARKLE_INDEX" value="${link.sparkle.updates.index}" />
<filter token="LEN" value="${dmg.file.length}" />
<filter token="SIGNATURE" value="${signature.base64}" />
<filter token="DOWNLOAD_DMG_LINK" value="${link.download.macosx}" />
<copy file="${macosx.resrc.dir}/sparkle-files/updates.xml"
tofile="${macosx.app.dir}/sparkle/updates-tmp.xml"
overwrite="true" filtering="yes"/>
<copy file="${macosx.resrc.dir}/sparkle-files/index-top.html"
todir="${macosx.app.dir}/sparkle"
overwrite="true" filtering="yes"/>
<get src="${link.update.changelog.prefix}/extended-changelog-${label}.html"
dest="changelog-${label}.html"
ignoreerrors="true"/>
<loadfile property="latest.changelog"
srcFile="changelog-${label}.html"
failonerror="false"/>
<!-- Load a default value if file with changelogs is missing -->
<condition property="latest.changelog" value="Nightly builds">
<not>
<isset property="latest.changelog"/>
</not>
</condition>
<concat destfile="${macosx.app.dir}/sparkle/index.html">
<fileset dir="${macosx.app.dir}/sparkle/">
<include name="index-top.html"/>
</fileset>
<propertyset>
<propertyref name="latest.changelog"/>
</propertyset>
<fileset dir="${macosx.resrc.dir}/sparkle-files">
<include name="index-bottom.html"/>
</fileset>
</concat>
<delete file="${macosx.app.dir}/sparkle/index-top.html"/>
</target>
<target name="macosx-sparkle-delta-updates"
if="sparkle.delta.history.location"
depends="define-ant-contrib-task">
<!-- create temp dir for making delta diffs -->
<mkdir dir="${macosx.app.dir}/tmp"/>
<!-- Attach the current image -->
<exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="true">
<arg value="attach"/>
<arg value="${macosx.app.dir}/${macosx.dmg.name}"/>
<arg value="-mountroot"/>
<arg value="${macosx.app.dir}/tmp/"/>
</exec>
<unzip src="${macosx.resrc.dir}/Sparkle.framework.zip"
dest="${macosx.app.dir}/tmp"/>
<copy file="${macosx.resrc.dir}/BinaryDelta"
todir="${macosx.app.dir}/tmp"/>
<chmod file="${macosx.app.dir}/tmp/BinaryDelta"
perm="ugo+rx"/>
<!-- Find all previous builds we have to build deltas for them -->
<foreach param="build-location" target="-make-sparkle-delta"
inheritall="true" inheritrefs="true">
<path>
<dirset dir="${sparkle.delta.history.location}">
<include name="*"/>
</dirset>
</path>
</foreach>
<!-- Detach the temporary image -->
<exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="true">
<arg value="detach"/>
<arg value="${macosx.app.dir}/tmp/${application.name}"/>
</exec>
<!-- delete the temp dir -->
<delete dir="${macosx.app.dir}/tmp"/>
<!-- copy data for next delta builds-->
<mkdir dir="${sparkle.delta.history.location}/${sparkle.build}"/>
<copy file="${macosx.app.dir}/${macosx.dmg.name}"
tofile="${sparkle.delta.history.location}/${sparkle.build}/${package.name}.dmg"/>
<!-- now delete old one -->
<antcall target="-make-sparkle-delta-delete-oldest-data"/>
</target>
<target name="-make-sparkle-delta">
<basename property="old.sparkle.build" file="${build-location}"/>
<echo message="Creating dmg delta for ${old.sparkle.build}-${sparkle.build}"/>
<!-- create temp dir for making delta diffs -->
<mkdir dir="${macosx.app.dir}/tmp/${old.sparkle.build}"/>
<!-- Attach the image -->
<exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="true">
<arg value="attach"/>
<arg value="${build-location}/${package.name}.dmg"/>
<arg value="-mountroot"/>
<arg value="${macosx.app.dir}/tmp/${old.sparkle.build}/"/>
</exec>
<!-- make the actual diff -->
<exec executable="${macosx.app.dir}/tmp/BinaryDelta"
os="Mac OS X" failonerror="true">
<arg value="create"/>
<arg value="${macosx.app.dir}/tmp/${old.sparkle.build}/${application.name}/${application.name}.app"/>
<arg value="${macosx.app.dir}/tmp/${application.name}/${application.name}.app"/>
<arg value="${macosx.app.dir}/${application.name}-${old.sparkle.build}-to-${sparkle.build}.delta"/>
</exec>
<!-- Detach the temporary image -->
<exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="true">
<arg value="detach"/>
<arg value="${macosx.app.dir}/tmp/${old.sparkle.build}/${application.name}"/>
</exec>
<!-- delete the temp dir -->
<delete dir="${macosx.app.dir}/tmp/${old.sparkle.build}"/>
<exec executable="bash" os="Mac OS X" failonerror="true"
outputproperty="delta.signature.base64">
<arg value="-c"/>
<arg value="openssl dgst -sha1 -binary &lt; ${macosx.app.dir}/${application.name}-${old.sparkle.build}-to-${sparkle.build}.delta | openssl dgst -dss1 -sign ${sparkle.signiture.location} | openssl enc -base64"/>
</exec>
<length file="${macosx.app.dir}/${application.name}-${old.sparkle.build}-to-${sparkle.build}.delta"
property="delta.file.length" />
<copy file="${macosx.app.dir}/sparkle/updates-tmp.xml"
tofile="${macosx.app.dir}/sparkle/updates-tmp1.xml"/>
<move file="${macosx.app.dir}/sparkle/updates-tmp1.xml"
tofile="${macosx.app.dir}/sparkle/updates-tmp.xml"
overwrite="true" filtering="yes">
<filterset recurse="false">
<filter token="SPARKLE_DELTAS" value="
&lt;enclosure type=&quot;application/octet-stream&quot;
sparkle:version=&quot;${sparkle.build}&quot; length=&quot;${delta.file.length}&quot;
sparkle:dsaSignature=&quot;${delta.signature.base64}&quot;
sparkle:deltaFrom=&quot;${old.sparkle.build}&quot;
url=&quot;${sparkle.delta.download.location}/${application.name}-${old.sparkle.build}-to-${sparkle.build}.delta&quot;/&gt;
@SPARKLE_DELTAS@
" />
</filterset>
</move>
</target>
<target name="-make-sparkle-delta-delete-oldest-data">
<resourcecount property="build.history.current.size">
<dirset dir="${sparkle.delta.history.location}">
<include name="*"/>
</dirset>
</resourcecount>
<math result="build.history.to.delete"
operand1="${build.history.current.size}"
operation="-"
operand2="${sparkle.delta.history.size}"
datatype="int"/>
<timestampselector outputsetid="oldest.builds"
count="${build.history.to.delete}"
age="eldest">
<path>
<dirset dir="${sparkle.delta.history.location}">
<include name="*" />
</dirset>
</path>
</timestampselector>
<foreach param="build.to.delete"
target="-make-wix-patch-delete-data-folder">
<path refid="oldest.builds"/>
</foreach>
</target>
<target name="-make-sparkle-delta-delete-data-folder">
<echo message="!!! Deleting old data dir ${build.to.delete} !!! " />
<delete dir="${build.to.delete}" failonerror="false"/>
</target>
<!-- Outputs a warning notifying the user that a dpkg tool is missing. -->
@ -1256,7 +1487,7 @@
token="_PACKAGE_NAME_"
value="${package.name}"/>
<get src="http://bluejimp.com/sip-communicator/changelogs/extended-changelog-${label}.txt"
<get src="${link.update.changelog.prefix}/extended-changelog-${label}.txt"
dest="changelog-${label}.txt" ignoreerrors="true"/>
<loadfile property="latest.changelog"
srcFile="changelog-${label}.txt" failonerror="false"/>

@ -0,0 +1,6 @@
</td>
</tr>
</table>
<br>
</body>
</html>

@ -0,0 +1,21 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>@APP_NAME@ (Build @BUILD@) Changelog</title>
<meta name="robots" content="anchors">
<link href="index.css" type="text/css" rel="stylesheet" media="all">
</head>
<body>
<br />
<table class="dots" width="100%" border="0" cellspacing="0" cellpadding="0" summary="Two column table with heading">
<tr>
<td class="blue" colspan="2">
<h3>@APP_NAME@ build @BUILD@.</h3>
</td>
</tr>
<tr>
<td valign="top" width="50"><img src="sc.png" alt="@APP_NAME@" width="50" border="0"></td>
<td valign="top">
<p>Build @BUILD@ for MacOSX generated on @DATE@.<br></p>

@ -0,0 +1,215 @@
/* Tiger Mac Help task_style.css v2.0f*/
/* <html><head><meta name="robots" content="noindex"></head></html> */
body {
margin: 2px 12px 12px
}
h1 {
font-size: 11pt;
font-family: "Lucida Grande", Arial, sans-serif;
margin-bottom: 0
}
h2 {
font-size: 9pt;
font-family: "Lucida Grande", Arial, sans-serif;
margin-top: 0;
margin-bottom: -10px
}
h3 {
font-size: 9pt;
font-family: "Lucida Grande", Arial, sans-serif;
font-weight: bold;
margin-top: -4px;
margin-bottom: -4px
}
p {
font-size: 9pt;
font-family: "Lucida Grande", Arial, sans-serif;
line-height: 12pt;
text-decoration: none
}
ol {
font-size: 9pt;
font-family: "Lucida Grande", Arial, sans-serif;
line-height: 12pt;
list-style-position: outside;
margin-top: 12px;
margin-bottom: 12px;
margin-left: -18px;
padding-left: 40px
}
ol li {
margin-top: 6px;
margin-bottom: 6px
}
ol p {
margin-top: 6px;
margin-bottom: 6px
}
ul {
font-size: 9pt;
font-family: "Lucida Grande", Arial, sans-serif;
line-height: 12pt;
list-style-type: square;
list-style-position: outside;
margin-top: 12px;
margin-bottom: 12px;
margin-left: -24px;
padding-left: 40px
}
ul li {
margin-top: 6px;
margin-bottom: 6px
}
ul p {
margin-top: 6px;
margin-bottom: 6px
}
a {
color: #00f;
font-size: 9pt;
font-family: "Lucida Grande", Arial, sans-serif;
line-height: 12pt;
text-decoration: none
}
a:hover {
color: #00f;
font-family: "Lucida Grande", Arial, sans-serif;
text-decoration: underline
}
hr {
text-decoration: none;
border: solid 1px #bfbfbf
}
td {
padding: 6px
}
#banner { background-color: #f2f2f2; background-repeat: no-repeat; padding: -2px 6px 0; position: fixed; top: 0; left: 0; width: 100%; height: 1.2em; float: left; border: solid 1px #bfbfbf }
#caticon {
margin-top: 3px;
margin-bottom: -3px;
margin-right: 5px;
float: left;
}
#pagetitle {
margin-top: 12px;
margin-bottom: 0px;
margin-left: 40px;
width: 88%;
border: solid 1px #fff
}
#mainbox {
margin-top: 2349px;
padding-right: 6px
}
#taskbox {
background-color: #e6edff;
list-style-type: decimal;
list-style-position: outside;
margin: 12px 0;
padding: 2px 12px;
border: solid 1px #bfbfbf
}
#taskbox h2 {
margin-top: 8;
margin-bottom: -4px
}
#machelp { position: absolute; top: 2px; left: 10px }
#index { background-color: #f2f2f2; padding-right: 25px; top: 2px; right: 12px; width: auto; float: right }
#next {
position: absolute;
top: 49px;
left: 88%
}
#asindent {
margin-left: 22px;
font-size: 9pt;
font-family: Verdana, Courier, sans-serif;
}
.bread {
color: #00f;
font-size: 8pt;
margin: -9px 0 -6px
}
.leftborder {
color: #00f;
font-size: 8pt;
margin: -9px 0 -6px;
padding-top: 2px;
padding-bottom: 3px;
padding-left: 8px;
border-left: 1px solid #bfbfbf
}
.mult {
margin-top: -8px
}
.blue {
background-color: #e6edff;
margin-top: -3px;
margin-bottom: -3px;
padding-top: -3px;
padding-bottom: -3px
}
.rightfloater
{
float: right;
margin-left: 15px;
}
.rules {
border-bottom: 1px dotted #ccc
}
.dots {
border: dotted 1px #ccc
}
.seealso {
margin-top: 4px;
margin-bottom: 4px
}
code {
color: black;
font-size: 9pt;
font-family: Verdana, Courier, sans-serif;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
<channel>
<title>@APP_NAME@ (Build @BUILD@) Changelog</title>
<link>@SPARKLE_UPDATES@</link>
<description>Build @BUILD@ for MacOSX generated on @DATE@.</description>
<language>en</language>
<item>
<title>Build @BUILD@</title>
<description>@SPARKLE_INDEX@</description>
<pubDate>@DATE@</pubDate>
<enclosure sparkle:version="@BUILD@"
url="@DOWNLOAD_DMG_LINK@"
length="@LEN@"
type="application/octet-stream"
sparkle:dsaSignature="@SIGNATURE@"
/>
<sparkle:deltas>
@SPARKLE_DELTAS@
</sparkle:deltas>
</item>
</channel>
</rss>
Loading…
Cancel
Save