set -x # Setup VERSION=`awk '/^#define+ AUDACITY_VERSION / {print $3}' build/Info.plist.h` RELEASE=`awk '/^#define+ AUDACITY_RELEASE / {print $3}' build/Info.plist.h` REVISION=`awk '/^#define+ AUDACITY_REVISION / {print $3}' build/Info.plist.h` VERSION=$VERSION.$RELEASE.$REVISION cd "${DSTROOT}" chmod -RH "${INSTALL_MODE_FLAG}" "${TARGET_BUILD_DIR}" chown -RH "${INSTALL_OWNER}:${INSTALL_GROUP}" "${TARGET_BUILD_DIR}" echo "Audacity has been installed to: ${DSTROOT}" cd .. VOL="Audacity $VERSION" DMG="audacity-macosx-$VERSION" # Preclean rm -rf "$DMG" "$DMG.dmg" TMP.dmg # Create structure mkdir "$DMG" cp -pR "${DSTROOT}/" "${DMG}" #Add a custom icon for the DMG #cp -p mac/Resources/Audacity.icns "${DMG}"/.VolumeIcon.icns # Make sure it's not already attached ATTACHED=$(hdiutil info | awk "/\/Volumes\/${VOL}/{print \$1}") if [ -n "${ATTACHED}" ] then hdiutil detach "${ATTACHED}" fi # Create and mount the image hdiutil create -ov -format UDRW -srcdir "$DMG" -fs HFS+ -volname "$VOL" TMP.dmg if [ $? -ne 0 ] then echo "Create failed" exit 1 fi #Mount the DMG and store the name it was mounted with TITLE=$(hdiutil attach TMP.dmg | grep \/Volumes | sed "s/^.*\/Volumes\///") if [ $? -ne 0 ] then echo "Attach failed" exit 1 fi # And wait for it to show up in Finder osascript <