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 |
|
---|
11 | set -x -v
|
---|
12 |
|
---|
13 | PACKAGEDIR="$PWD"
|
---|
14 | PRODUCT="F-Script Anywhere"
|
---|
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" && \
|
---|
24 | ditto -rsrc "$PACKAGEDIR"/Source "$DSTROOT"/Source && \
|
---|
25 | rm -rf "$DSTROOT"/Source/build && \
|
---|
26 | find "$DSTROOT" -name ".svn" -exec sudo /bin/rm -rf "{}" \; ; \
|
---|
27 | cd "$PACKAGEDIR" && \
|
---|
28 | rm -f "$DMG" && \
|
---|
29 | hdiutil create "$DMG" -megabytes 5 -ov -type UDIF && \
|
---|
30 | DISK=`hdid -nomount "$DMG" | sed -ne ' /Apple_partition_scheme/ s|^/dev/\([^ ]*\).*$|\1|p'` && \
|
---|
31 | newfs_hfs -v "$VOL" "/dev/r${DISK}s2" && \
|
---|
32 | hdiutil eject "$DISK" && \
|
---|
33 | hdid "$DMG" && \
|
---|
34 | ditto -rsrc "$DSTROOT" "$MOUNTPOINT" && \
|
---|
35 | chmod -R a+rX,u+w "$MOUNTPOINT" && \
|
---|
36 | openUp "$MOUNTPOINT" && \
|
---|
37 | # sleep 2 && \
|
---|
38 | hdiutil eject $DISK && \
|
---|
39 | # osascript -e "tell application \"Finder\" to eject disk \"$VOL\"" && \
|
---|
40 | hdiutil convert "$DMG" -format UDZO -imagekey zlib-level=9 -o "z$DMG" && \
|
---|
41 | mv "z$DMG" "$DMG" && \
|
---|
42 | scp "$DMG" ainaz:web/nriley/software/
|
---|