Commit 71b41517 authored by Alexandre Lision's avatar Alexandre Lision

packaging: update scripts to run on OSX

Some command line options differ between the GNU and UNIX version of
base64, date and stat

Change-Id: I5d7ec0a3e797a1044e9acae3153caf9cb9eef00e
Tuleap: #634
parent fd0d6c84
......@@ -13,7 +13,7 @@ ENDIF("${RING_VERSION}" STREQUAL "")
SET(RING_VERSION_NAME "Louis-Joseph Papineau")
MESSAGE("Building Ring version - " ${RING_VERSION_NAME})
MESSAGE("Building Ring version - " ${RING_VERSION_NAME} " " ${RING_VERSION})
SET(PROJ_COPYRIGHT " © 2015-2016 Savoir-faire Linux \n GPLv3 https://www.gnu.org/copyleft/gpl.html")
ADD_DEFINITIONS("-std=c++11 -stdlib=libc++ -fobjc-arc")
......
......@@ -5,6 +5,11 @@ if [ "$#" -ne 2 ]; then
echo "Usage: $0 update_archive private_key"
exit 1
fi
if [[ `uname` == 'Linux' ]]; then
BASE64_OPTS='--wrap=0'
fi
openssl=/usr/bin/openssl
$openssl dgst -sha1 -binary < "$1" | $openssl dgst -dss1 -sign "$2" | base64 --wrap=0
$openssl dgst -sha1 -binary < "$1" | $openssl dgst -dss1 -sign "$2" | base64 $BASE64_OPTS
......@@ -2,11 +2,11 @@
# Take the package to add as argument ./sparkle-xml-updater.sh ring.dmg
REPO_FOLDER=<dir>
SPARKLE_FILE=<xml_filename>
REPO_URL=<url>
PACKAGE=$1
DSA_KEY=<path_to_key_file>
REPO_FOLDER=$1
SPARKLE_FILE=$2
REPO_URL=$3
PACKAGE=$4
DSA_KEY=$5
if [ ! -f ${PACKAGE} -o ! -f ${DSA_KEY} ]; then
echo "Can't find package or dsa key, aborting..."
......@@ -14,7 +14,15 @@ if [ ! -f ${PACKAGE} -o ! -f ${DSA_KEY} ]; then
fi
if [ -f ${REPO_FOLDER}/${SPARKLE_FILE} ]; then
ITEMS=$(sed -n "/<item>/,/<\/item>/p" ${REPO_FOLDER}/${SPARKLE_FILE})
ITEMS=$(sed -n "/<item>/,/<\/item>/p" ${REPO_FOLDER}/${SPARKLE_FILE})
fi
if [[ `uname` == 'Darwin' ]]; then
PACKAGE_SIZE=`stat -f%z ${PACKAGE}`
DATE_RFC2822=`date "+%a, %d %b %Y %T %z"`
else
PACKAGE_SIZE=`stat -c %s ${PACKAGE}`
DATE_RFC2822=`date -R`
fi
cat << EOFILE > ${REPO_FOLDER}/${SPARKLE_FILE}
......@@ -27,8 +35,8 @@ cat << EOFILE > ${REPO_FOLDER}/${SPARKLE_FILE}
<language>en</language>
<item>
<title>Ring nightly $(date "+%Y/%m/%d %H:%M")</title>
<pubDate>$(date -R)</pubDate>
<enclosure url="${REPO_URL}/$(basename ${PACKAGE})" sparkle:version="$(date +%Y%m%d%H%M)" sparkle:shortVersionString="nightly-$(date "+%Y%m%d")" length="$(stat -c %s ${PACKAGE})" type="application/octet-stream" sparkle:dsaSignature="$(/opt/joulupukki/mac_keys/sign_update.sh ${PACKAGE} ${DSA_KEY})" />
<pubDate>$DATE_RFC2822</pubDate>
<enclosure url="${REPO_URL}/$(basename ${PACKAGE})" sparkle:version="$(date +%Y%m%d%H%M)" sparkle:shortVersionString="nightly-$(date "+%Y%m%d")" length="$PACKAGE_SIZE" type="application/octet-stream" sparkle:dsaSignature="$(./sign_update.sh ${PACKAGE} ${DSA_KEY})" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
</item>
$(echo -e "${ITEMS}")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment