3 # Creates a Bitcoin.dmg OSX file from the contrib/BitcoinTemplate.dmg file
5 # Recipe from: http://digital-sushi.org/entry/how-to-create-a-disk-image-installer-for-apple-mac-os-x/
7 # To make a prettier BitcoinTemplate.dmg:
8 # + open (mount) BitcoinTemplate.dmg
9 # + change the file properties, icon positions, background image, etc
10 # + eject, then commit the changed BitcoinTemplate.dmg
16 if [ $(basename $CWD) == "contrib" ]
20 echo "Usage: $0 /path/to/bitcoin/tree"
28 BUILD_DIR=/tmp/bitcoin_osx_build
30 # First, compile bitcoin and bitcoind
32 if [ ! -e bitcoin ]; then make -f makefile.osx bitcoin; fi
33 if [ ! -e bitcoind ]; then make -f makefile.osx bitcoind; fi
34 strip bitcoin bitcoind
39 rm -f Bitcoin.sparseimage
40 hdiutil convert "$CONTRIB/BitcoinTemplate.dmg" -format UDSP -o Bitcoin
41 hdiutil mount Bitcoin.sparseimage
43 # Copy over placeholders in /Volumes/Bitcoin
44 cp "$TOP/src/bitcoind" /Volumes/Bitcoin/
45 cp "$TOP/src/bitcoin" /Volumes/Bitcoin/Bitcoin.app/Contents/MacOS/
47 # Create source code .zip
49 git archive -o /Volumes/Bitcoin/bitcoin.zip $(git branch 2>/dev/null|grep -e ^* | cut -d ' ' -f 2)
52 chmod -Rf go-w /Volumes/Bitcoin
55 hdiutil eject /Volumes/Bitcoin
56 rm -f "$CWD/Bitcoin.dmg"
57 hdiutil convert Bitcoin.sparseimage -format UDBZ -o "$CWD/Bitcoin.dmg"