dmg.sh 522 B

12345678910111213141516171819
  1. #!/bin/sh
  2. TARGET=$1
  3. BASEDIR=build/dist/darwin
  4. DMGNAME=${BASEDIR}/${TARGET}.dmg
  5. VOLNAME=MegaZeux
  6. mkdir -p ${BASEDIR}
  7. hdiutil create $DMGNAME -size 10m -fs HFS+ \
  8. -volname "$VOLNAME" -layout SPUD &&
  9. DEV_HANDLE=`hdid $DMGNAME | grep Apple_HFS | \
  10. perl -e '\$_=<>; /^\\/dev\\/(disk.)/; print \$1'`
  11. ditto -rsrcFork build/darwin-dist /Volumes/$VOLNAME &&
  12. hdiutil detach $DEV_HANDLE &&
  13. hdiutil convert $DMGNAME -format UDZO -o $DMGNAME.compressed &&
  14. mv -f $DMGNAME.compressed.dmg $DMGNAME