#!/bin/bash
+set -e
+
# script for pulling together a MacOSX app bundle.
GTKSTACK_ROOT=$HOME/gtk/inst
fi
cp typeArdour.icns $Resources/
+set +e # things below are not error-free (optional files etc) :(
+
# copy locale files
if test x$WITH_NLS != x ; then
echo "NLS support ..."
fi
VOLNAME=$APPNAME-$release_version
-# TODO use mktemp
-export TMPDIR=`pwd`
MNTPATH=`mktemp -d -t ardourimg`
TMPDMG=`mktemp -t ardour`
ICNSTMP=`mktemp -t ardouricon`
TMPDMG="${TMPDMG}.dmg"
+trap "rm -rf $MNTPATH $TMPDMG ${TMPDMG}.dmg $ICNSTMP" EXIT
+
hdiutil create -megabytes $DMGMEGABYTES "$TMPDMG"
DiskDevice=$(hdid -nomount "$TMPDMG" | grep Apple_HFS | cut -f 1 -d ' ')
newfs_hfs -v "${VOLNAME}" "${DiskDevice}"
chmod -Rf go-w "${MNTPATH}"
sync
+set -e
echo "compressing Image ..."
# Umount the image
hdiutil eject "${DiskDevice}"
# Create a read-only version, use zlib compression
hdiutil convert -format UDZO "${TMPDMG}" -imagekey zlib-level=9 -o "${UC_DMG}"
-# Delete the temporary files
-rm "$TMPDMG"
-rm -rf "$MNTPATH"
echo "setting file icon ..."