diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2011-09-10 19:07:43 -0400 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2011-09-22 17:16:13 -0400 |
commit | a4f2c8419f5a8b47c4b48e962b4ff02885164c9b (patch) | |
tree | 2eff8c61d2c09bd6a8d06112cd80043926e39693 /contrib | |
parent | c7eb151ad0ed441d6fd598551059a9bbfb09e99e (diff) |
Script to create OSX .dmg diskimage file.
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/BitcoinTemplate.dmg | bin | 0 -> 292309 bytes | |||
-rwxr-xr-x | contrib/create_osx_dmg.sh | 60 |
2 files changed, 60 insertions, 0 deletions
diff --git a/contrib/BitcoinTemplate.dmg b/contrib/BitcoinTemplate.dmg Binary files differnew file mode 100644 index 0000000000..ca86308e05 --- /dev/null +++ b/contrib/BitcoinTemplate.dmg diff --git a/contrib/create_osx_dmg.sh b/contrib/create_osx_dmg.sh new file mode 100755 index 0000000000..af164e56cf --- /dev/null +++ b/contrib/create_osx_dmg.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash +# +# Creates a Bitcoin.dmg OSX file from the contrib/BitcoinTemplate.dmg file +# +# Recipe from: http://digital-sushi.org/entry/how-to-create-a-disk-image-installer-for-apple-mac-os-x/ +# +# To make a prettier BitcoinTemplate.dmg: +# + open (mount) BitcoinTemplate.dmg +# + change the file properties, icon positions, background image, etc +# + eject, then commit the changed BitcoinTemplate.dmg +# + +CWD=$(pwd) + +if [ $# -lt 1 ]; then + if [ $(basename $CWD) == "contrib" ] + then + TOP=$(dirname $CWD) + else + echo "Usage: $0 /path/to/bitcoin/tree" + exit 1 + fi +else + TOP=$1 +fi + +CONTRIB=$TOP/contrib +BUILD_DIR=/tmp/bitcoin_osx_build + +# First, compile bitcoin and bitcoind +cd "$TOP/src" +if [ ! -e bitcoin ]; then make -f makefile.osx bitcoin; fi +if [ ! -e bitcoind ]; then make -f makefile.osx bitcoind; fi +strip bitcoin bitcoind + +mkdir -p "$BUILD_DIR" +cd "$BUILD_DIR" + +rm -f Bitcoin.sparseimage +hdiutil convert "$CONTRIB/BitcoinTemplate.dmg" -format UDSP -o Bitcoin +hdiutil mount Bitcoin.sparseimage + +# Copy over placeholders in /Volumes/Bitcoin +cp "$TOP/src/bitcoind" /Volumes/Bitcoin/ +cp "$TOP/src/bitcoin" /Volumes/Bitcoin/Bitcoin.app/Contents/MacOS/ + +# Create source code .zip +cd "$TOP" +git archive -o /Volumes/Bitcoin/bitcoin.zip $(git branch 2>/dev/null|grep -e ^* | cut -d ' ' -f 2) + +# Fix permissions +chmod -Rf go-w /Volumes/Bitcoin + +cd "$BUILD_DIR" +hdiutil eject /Volumes/Bitcoin +rm -f "$CWD/Bitcoin.dmg" +hdiutil convert Bitcoin.sparseimage -format UDBZ -o "$CWD/Bitcoin.dmg" + +cd "$CWD" +rm -rf "$BUILD_DIR" |