Revision: 12220
          http://sourceforge.net/p/skim-app/code/12220
Author:   hofman
Date:     2021-03-22 17:15:16 +0000 (Mon, 22 Mar 2021)
Log Message:
-----------
Add scripts to codesign and to create a distribution archive and appcast

Added Paths:
-----------
    trunk/codesign_skim.sh
    trunk/skim_archive.sh

Added: trunk/codesign_skim.sh
===================================================================
--- trunk/codesign_skim.sh                              (rev 0)
+++ trunk/codesign_skim.sh      2021-03-22 17:15:16 UTC (rev 12220)
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+IDENTITY="Skim Signing Certificate"
+
+if [ "$#" -gt 2 ]; then 
+  IDENTITY="Developer ID Application: $1 ($2)"
+elif [ "$#" -gt 1 ]; then
+  IDENTITY="$1"
+fi
+
+SKIM_BUNDLE_PATH="${!#}"
+
+# see 
https://mjtsai.com/blog/2021/02/18/code-signing-when-building-on-apple-silicon/
+CODESIGN_FLAGS="--verbose --options runtime --timestamp --force 
--digest-algorithm=sha1,sha256"
+
+CONTENTS_DIR="${SKIM_BUNDLE_PATH}/Contents"
+
+# have to sign frameworks first
+LOCATION="${CONTENTS_DIR}/Frameworks"
+codesign ${CODESIGN_FLAGS} --sign "${IDENTITY}" 
"${LOCATION}/SkimNotes.framework/Versions/A"
+codesign ${CODESIGN_FLAGS} --sign "${IDENTITY}" 
"${LOCATION}/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/fileop"
+codesign ${CODESIGN_FLAGS} --sign "${IDENTITY}" 
"${LOCATION}/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/Autoupdate"
+codesign ${CODESIGN_FLAGS} --sign "${IDENTITY}" 
"${LOCATION}/Sparkle.framework/Versions/A"
+
+LOCATION="${CONTENTS_DIR}/Library"
+codesign ${CODESIGN_FLAGS} --sign "${IDENTITY}" 
"${LOCATION}/Spotlight/SkimImporter.mdimporter/Contents/Frameworks/SkimNotesBase.framework/Versions/A"
+codesign ${CODESIGN_FLAGS} --sign "${IDENTITY}" 
"${LOCATION}/Spotlight/SkimImporter.mdimporter/Contents/MacOS/SkimImporter"
+codesign ${CODESIGN_FLAGS} --sign "${IDENTITY}" 
"${LOCATION}/QuickLook/Skim.qlgenerator/Contents/MacOS/Skim"
+
+LOCATION="${CONTENTS_DIR}/SharedSupport"
+codesign ${CODESIGN_FLAGS} --sign "${IDENTITY}" "${LOCATION}/skimnotes"
+codesign ${CODESIGN_FLAGS} --sign "${IDENTITY}" "${LOCATION}/skimpdf"
+
+LOCATION="${CONTENTS_DIR}/MacOS"
+codesign ${CODESIGN_FLAGS} --sign "${IDENTITY}" "${LOCATION}/relaunch"
+
+codesign ${CODESIGN_FLAGS} --sign "${IDENTITY}" "${BIBDESK_BUNDLE_PATH}"


Property changes on: trunk/codesign_skim.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/skim_archive.sh
===================================================================
--- trunk/skim_archive.sh                               (rev 0)
+++ trunk/skim_archive.sh       2021-03-22 17:15:16 UTC (rev 12220)
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+# app name
+NAME=Skim
+
+# app bundle to copy, filename should be "${NAME}.app"
+SRC_BUNDLE="$1"
+SRC_BUNDLE=$(cd $(dirname "$SRC_BUNDLE"); pwd)/$(basename "$SRC_BUNDLE")
+
+# version
+VERSION=$(/usr/bin/defaults read "${SRC_BUNDLE}/Contents/Info" 
CFBundleShortVersionString)
+
+# target name
+DIST_NAME="${NAME}-${VERSION}"
+
+# target zip archive
+DIST_ARCHIVE="${HOME}/Desktop/${DIST_NAME}.zip"
+
+# create archive
+/usr/bin/ditto -c -k --keepParent "$SRC_BUNDLE" "$DIST_ARCHIVE"
+
+# create the Sparkle appcast
+# see 
http://www.entropy.ch/blog/Developer/2008/09/22/Sparkle-Appcast-Automation-in-Xcode.html
+
+echo "Creating appcast for Sparkle..."
+
+DATE=$(/bin/date +"%a, %d %b %Y %T %z")
+SIZE=$(/usr/bin/stat -f %z "${DIST_ARCHIVE}")
+VERSION_NUMBER=$(/usr/bin/defaults read "${SRC_BUNDLE}/Contents/Info" 
CFBundleVersion)
+URL="https://sourceforge.net/projects/skim-app/files/${NAME}/${DIST_NAME}/${DIST_NAME}.zip/download";
+APPCAST="${HOME}/Desktop/${DIST_NAME}.xml"
+KEY_NAME="${NAME} Sparkle Key"
+SIGNATURE=$(/usr/bin/openssl dgst -sha1 -binary < "${DIST_ARCHIVE}" | 
/usr/bin/openssl dgst -dss1 -sign <(security find-generic-password -g -s 
"${KEY_NAME}" 2>&1 1>/dev/null | perl -pe '($_) = /"(.+)"/; s/\\012/\n/g') | 
/usr/bin/openssl enc -base64)
+if [ $? != 0 ]; then
+    echo "warning: failed to generate signature.  You need the private key in 
a secure note named \"${KEY_NAME}\"" >&2
+fi
+
+/bin/cat > "${APPCAST}" << EOF
+<?xml version="1.0" encoding="utf-8"?> 
+<rss version="2.0" 
xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle";  
xmlns:dc="http://purl.org/dc/elements/1.1/";>
+    <channel> 
+        <title>${NAME} Changelog</title>
+        <link>https://skim-app.sourceforge.io</link>
+        <description>PDF reader and note-taker</description>
+        <item>
+            <title>Version ${VERSION}</title>
+            <description><![CDATA[
+<h1>Version ${VERSION}</h1>
+
+<h2>New Features</h2>
+<ul>
+<li></li>
+</ul>
+
+<h2>Bugs Fixed</h2>
+<ul>
+<li></li>
+</ul>
+            ]]></description>
+            <pubDate>${DATE}</pubDate>
+            
<sparkle:minimumSystemVersion>10.10.0</sparkle:minimumSystemVersion>
+            <enclosure sparkle:version="${VERSION_NUMBER}" 
sparkle:shortVersionString="${VERSION}" url="${URL}" 
sparkle:dsaSignature="${SIGNATURE}" length="${SIZE}" type="application/zip"/>
+        </item>
+
+    </channel>
+</rss>
+EOF


Property changes on: trunk/skim_archive.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to