2 # Copyright (c) 2014-2015 The Bitcoin Core developers
3 # Distributed under the MIT software license, see the accompanying
4 # file COPYING or http://www.opensource.org/licenses/mit-license.php.
9 BUNDLE
="${ROOTDIR}/Bitcoin-Qt.app"
12 TEMPLIST
=${TEMPDIR}/signatures.txt
13 OUT
=signature-osx.
tar.gz
16 if [ ! -n "$1" ]; then
17 echo "usage: $0 <codesign args>"
18 echo "example: $0 -s MyIdentity"
22 rm -rf ${TEMPDIR} ${TEMPLIST}
25 ${CODESIGN} -f --file-list ${TEMPLIST} "$@" "${BUNDLE}"
27 grep -v CodeResources < "${TEMPLIST}" | while read i; do
28 TARGETFILE="${BUNDLE}/`echo "${i}" | sed "s|.*${BUNDLE}/||
"`"
29 SIZE
=`pagestuff "$i" -p | tail -2 | grep size | sed 's/[^0-9]*//g'`
30 OFFSET
=`pagestuff "$i" -p | tail -2 | grep offset | sed 's/[^0-9]*//g'`
31 SIGNFILE
="${TEMPDIR}/${OUTROOT}/${TARGETFILE}.sign"
32 DIRNAME
="`dirname "${SIGNFILE}"`"
34 echo "Adding detached signature for: ${TARGETFILE}. Size: ${SIZE}. Offset: ${OFFSET}"
35 dd if="$i" of
="${SIGNFILE}" bs=1 skip=${OFFSET} count=${SIZE} 2>/dev/null
38 grep CodeResources < "${TEMPLIST}" | while read i; do
39 TARGETFILE="${BUNDLE}/`echo "${i}" | sed "s|.*${BUNDLE}/||
"`"
40 RESOURCE
="${TEMPDIR}/${OUTROOT}/${TARGETFILE}"
41 DIRNAME
="`dirname "${RESOURCE}"`"
43 echo "Adding resource for: "${TARGETFILE}""
44 cp "${i}" "${RESOURCE}"
49 tar -C "${TEMPDIR}" -czf "${OUT}" .