[21] | 1 | #!/bin/zsh
|
---|
| 2 |
|
---|
| 3 | # stuff to do:
|
---|
| 4 | # hdiutil create DiskImage.dmg -megabytes <size> -layout NONE
|
---|
| 5 | # hdid -nomount DiskImage.dmg
|
---|
| 6 | # sudo /sbin/newfs_hfs -w -v VolumeName -b 4096 /dev/disk2
|
---|
| 7 | # hdiutil eject /dev/disk2
|
---|
| 8 |
|
---|
| 9 | # also check out 'build' on mosxland.sf.net
|
---|
| 10 |
|
---|
[45] | 11 | # set -x -v
|
---|
[21] | 12 |
|
---|
| 13 | PACKAGEDIR="$PWD"
|
---|
| 14 | PRODUCT="Pester"
|
---|
| 15 |
|
---|
| 16 | cd "$PACKAGEDIR"/Source && \
|
---|
| 17 | find . -name \*~\* -exec rm -r '{}' \; && \
|
---|
| 18 | VERSION=`cat VERSION` && \
|
---|
| 19 | DMG="$PRODUCT-$VERSION.dmg" VOL="$PRODUCT $VERSION" MOUNTPOINT="/Volumes/$VOL" && \
|
---|
| 20 | DSTROOT="$PACKAGEDIR/$VOL" && \
|
---|
| 21 | sudo rm -fr "$DSTROOT" && \
|
---|
| 22 | rm -rf build/ && \
|
---|
| 23 | pbxbuild install "DSTROOT=$DSTROOT" && \
|
---|
[65] | 24 | rm -rf build/ && \
|
---|
[21] | 25 | ditto -rsrc "$PACKAGEDIR"/Source "$DSTROOT"/Source && \
|
---|
| 26 | ditto -rsrc "${PACKAGEDIR}/Read Me" "$DSTROOT" && \
|
---|
| 27 | rm -rf "$DSTROOT"/Source/build "${DSTROOT}/Source/Read Me.rtfd" && \
|
---|
| 28 | #breaks in 10.2 and later, sigh.
|
---|
| 29 | #mkdir "$DSTROOT/Read Me.rtfd" && \
|
---|
| 30 | #cd "$DSTROOT/Read Me.rtfd" && \
|
---|
| 31 | #for i in "../Pester.app/Contents/Resources/Read Me.rtfd"/*; do ln -s "$i"; done && \
|
---|
| 32 | find "$DSTROOT" -name ".svn" -exec sudo /bin/rm -rf "{}" \; ; \
|
---|
| 33 | cd "$PACKAGEDIR" && \
|
---|
| 34 | rm -f "$DMG" && \
|
---|
| 35 | hdiutil create "$DMG" -megabytes 5 -ov -type UDIF && \
|
---|
| 36 | DISK=`hdid -nomount "$DMG" | sed -ne ' /Apple_partition_scheme/ s|^/dev/\([^ ]*\).*$|\1|p'` && \
|
---|
| 37 | newfs_hfs -v "$VOL" "/dev/r${DISK}s2" && \
|
---|
| 38 | hdiutil eject "$DISK" && \
|
---|
| 39 | hdid "$DMG" && \
|
---|
| 40 | ditto -rsrc "$DSTROOT" "$MOUNTPOINT" && \
|
---|
| 41 | chmod -R a+rX,u+w "$MOUNTPOINT" && \
|
---|
| 42 | openUp "$MOUNTPOINT" && \
|
---|
| 43 | # sleep 2 && \
|
---|
| 44 | hdiutil eject $DISK && \
|
---|
| 45 | # osascript -e "tell application \"Finder\" to eject disk \"$VOL\"" && \
|
---|
| 46 | hdiutil convert "$DMG" -format UDZO -imagekey zlib-level=9 -o "z$DMG" && \
|
---|
| 47 | mv "z$DMG" "$DMG" && \
|
---|
[65] | 48 | hdiutil internet-enable "$DMG" && \
|
---|
[45] | 49 | scp "$DMG" ainaz:web/nriley/software/ && \
|
---|
[21] | 50 | :
|
---|