comparison mac/finishup.sh @ 2120:3784795a1e94

Mac: Add support for AdHoc code signing in finishup script.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 23 Jun 2020 23:33:54 +0000
parents 1a196ada0bc9
children b9d373d1ccf5
comparison
equal deleted inserted replaced
2119:34963d1e6f62 2120:3784795a1e94
11 cp -f dwtest dwtest.app/Contents/MacOS 11 cp -f dwtest dwtest.app/Contents/MacOS
12 # Check if there is a certificate to sign with... 12 # Check if there is a certificate to sign with...
13 if [ ! -f mac/key.crt ]; then 13 if [ ! -f mac/key.crt ]; then
14 if [ -f mac/key.rsa ]; then 14 if [ -f mac/key.rsa ]; then
15 # If not we generate a self-signed one for testing purposes 15 # If not we generate a self-signed one for testing purposes
16 echo "No certifiacte in mac/key.crt so generating self-signed certificate..." 16 echo "No certificate in mac/key.crt so generating self-signed certificate..."
17 openssl req -new -key mac/key.rsa -out mac/key.csr -config mac/openssl.cnf 17 openssl req -new -key mac/key.rsa -out mac/key.csr -config mac/openssl.cnf
18 openssl x509 -req -days 3650 -in mac/key.csr -signkey mac/key.rsa -out mac/key.crt -extfile mac/openssl.cnf -extensions codesign 18 openssl x509 -req -days 3650 -in mac/key.csr -signkey mac/key.rsa -out mac/key.crt -extfile mac/openssl.cnf -extensions codesign
19 certtool i mac/key.crt k="`pwd`/mac/key.keychain" r=mac/key.rsa c p=moof 19 certtool i mac/key.crt k="`pwd`/mac/key.keychain" r=mac/key.rsa c p=moof
20 else 20 else
21 echo "No key pair found, cannot generate certificate... code will be unsigned." 21 echo "No key pair found, cannot generate certificate... signing AdHoc."
22 codesign -s "-" dwtest.app/Contents/MacOS/dwtest
22 fi 23 fi
23 fi 24 fi
24 if [ -f mac/key.keychain ]; then 25 if [ -f mac/key.keychain ]; then
25 echo "Signing the apllication with certificate in mac/key.crt" 26 echo "Signing the apllication with certificate in mac/key.crt"
26 codesign -s my-signing-identity --keychain mac/key.keychain dwtest.app/Contents/MacOS/dwtest 27 codesign -s my-signing-identity --keychain mac/key.keychain dwtest.app/Contents/MacOS/dwtest