5 # script for pulling together a MacOSX app bundle.
7 GTKSTACK_ROOT=$HOME/gtk/inst
8 ARDOURSTACK_ROOT=$HOME/a3/inst
11 # where harvid and xjadeo binaries are cached
12 if test -z "$CACHEDIR" -o ! -d "$CACHEDIR"; then
26 while [ $# -gt 0 ] ; do
31 # top level build targets
38 PRODUCT_PKG_DIR=ArdourSAE ;
46 PRODUCT_PKG_DIR=MixBus;
52 PRODUCT_PKG_DIR=Ardour;
59 PRODUCT_PKG_DIR=Ardour ;
61 --test) SAE= ; WITH_LADSPA=; STRIP= ; shift ;;
64 # specific build flags
67 --noharvid) WITH_HARVID= ; shift ;;
68 --noladspa) WITH_LADSPA= ; shift ;;
69 --nostrip) STRIP= ; shift ;;
70 --sysdeps) PRINT_SYSDEPS=1; shift ;;
71 --nls) WITH_NLS=1 ; shift ;;
75 if test -z "$PRODUCT_PKG_DIR" -o -z "$APPNAME"; then
76 echo "application or product-name was not specified"
80 . ../define_versions.sh
81 echo "Version is $release_version"
82 if [ "x$commit" != "x" ] ; then
83 info_string="$release_version ($commit) built on `hostname` by `whoami` on `date`"
85 info_string="$release_version built on `hostname` by `whoami` on `date`"
87 echo "Info string is $info_string"
89 if [ x$DEBUG = xT ]; then
91 echo "Debug build, strip disabled"
93 if test x$STRIP != x ; then
94 echo "No debug build, strip enabled"
96 echo "No debug build, but strip disabled."
100 # setup directory structure
102 APPDIR=${APPNAME}${major_version}.app
103 APPROOT=$APPDIR/Contents
104 Frameworks=$APPROOT/lib
105 Resources=$APPROOT/Resources
107 # Since this is OS X, don't try to distinguish between etc and shared
108 # (machine dependent and independent data) - just put everything
113 Locale=$Resources/locale
115 # Bundled Plugins live in a top level folder
117 Plugins=$APPROOT/Plugins
118 Surfaces=$Frameworks/surfaces
119 Panners=$Frameworks/panners
120 Backends=$Frameworks/backends
121 MidiMaps=$Shared/midi_maps
122 ExportFormats=$Shared/export
123 Templates=$Shared/templates
124 PatchFiles=$Shared/patchfiles
125 MackieControl=$Shared/mcp
127 if [ x$PRINT_SYSDEPS != x ] ; then
129 # print system dependencies
132 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Plugins/*.so ; do
133 if ! file $file | grep -qs Mach-O ; then
136 otool -L $file | awk '{print $1}' | egrep -v "(^@executable_path|^Ardour[0-9][.0-9]*.app)"
141 echo "Removing old $APPDIR tree ..."
145 echo "Building new app directory structure ..."
147 # only bother to make the longest paths
149 mkdir -p $APPROOT/MacOS
150 mkdir -p $APPROOT/Resources
156 mkdir -p $ExportFormats
158 mkdir -p $Frameworks/modules
160 mkdir -p $MackieControl
163 # maybe set variables
165 if test x$SAE != x ; then
166 appname="Ardour${major_version}-SAE"
167 EXECUTABLE=${appname}
168 env="$env<key>ARDOUR_SAE</key><string>true</string>"
170 # current default for SAE version is German keyboard layout without a keypad
172 env="$env<key>ARDOUR_KEYBOARD_LAYOUT</key><string>de-nokeypad</string>"
173 env="$env<key>ARDOUR_UI_CONF</key><string>ardour3_ui_sae.conf</string>"
174 elif test x$MIXBUS != x ; then
176 EXECUTABLE=${appname}${major_version}
177 env="$env<key>ARDOUR_MIXBUS</key><string>true</string>"
179 # current default for MIXBUS version is US keyboard layout without a keypad
181 env="$env<key>ARDOUR_KEYBOARD_LAYOUT</key><string>us-nokeypad</string>"
182 env="$env<key>ARDOUR_UI_CONF</key><string>ardour3_ui.conf</string>"
184 appname="Ardour${major_version}"
185 EXECUTABLE=${appname}
189 # if we're not going to bundle JACK, make sure we can find
190 # jack in the places where it might be
193 env="$env<key>PATH</key><string>/usr/local/bin:/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>"
194 env="$env<key>DYLIB_FALLBACK_LIBRARY_PATH</key><string>/usr/local/lib:/opt/lib</string>"
196 env="<key>LSEnvironment</key><dict>$env<key>ARDOUR_BUNDLED</key><string>true</string></dict>"
200 sed -e "s?@ENV@?$env?g" \
201 -e "s?@VERSION@?$release_version?g" \
202 -e "s?@INFOSTRING@?$info_string?g" \
203 -e "s?@IDSUFFIX@?$EXECUTABLE?g" \
204 -e "s?@EXECUTABLE@?$EXECUTABLE?g" < Info.plist.in > Info.plist
206 sed -e "s?@APPNAME@?$appname?" \
207 -e "s?@ENV@?$env?g" \
208 -e "s?@VERSION@?$release_version?g" \
209 -e "s?@INFOSTRING@?$info_string?g" < InfoPlist.strings.in > Resources/InfoPlist.strings || exit 1
213 cp Info.plist $APPROOT
214 cp -R Resources $APPROOT
218 rm -f Resources/InfoPlist.strings
221 # if we build a bundle without jack, then
222 # make the Ardour executable a helper
223 # script that checks to see if JACK is
227 cp startup_script $APPROOT/MacOS/$EXECUTABLE
228 chmod 775 $APPROOT/MacOS/$EXECUTABLE
229 MAIN_EXECUTABLE=Ardour.bin ## used in startup_script
231 echo "Copying ardour executable ...."
232 cp $BUILD_ROOT/gtk2_ardour/ardour-$release_version $APPROOT/MacOS/$MAIN_EXECUTABLE
233 if test x$SAE != x ; then
234 # cp $BUILD_ROOT/gtk2_ardour/evtest $APPROOT/MacOS/gtkevents
235 cp Ardour3-SAE.icns $Resources/appIcon.icns
236 elif test x$MIXBUS != x ; then
237 cp Mixbus.icns $Resources/appIcon.icns
239 cp Ardour.icns $Resources/appIcon.icns
241 cp typeArdour.icns $Resources/
243 set +e # things below are not error-free (optional files etc) :(
246 if test x$WITH_NLS != x ; then
247 echo "NLS support ..."
248 echo "I hope you remembered to run waf i18n"
251 for pkg in gtk2_ardour libs/ardour libs/gtkmm2ext ; do
252 files=`find ../../$pkg -name "*.mo"`
255 # the package name is appended with a number so that
256 # it can be parallel installed during a regular install
257 # with older (and newer) versions. it is just the major
258 # number of the release (i.e. leading digits)
261 vsuffix=`echo $release_version | sed 's/^\([0-9][0-9]*\).*/\1/'`
263 if [ -z "$files" ]; then
265 echo "!!!! WARNING !!!! - Did not find any .mo files in ../../$pkg"
272 lang=`basename $file | sed 's/\.mo//'`
273 mkdir -p $Locale/$lang/LC_MESSAGES
274 cp $file $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
275 echo copy $file to $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
276 if echo $LINGUAS | grep $lang >/dev/null 2>&1 ; then
279 LINGUAS="$LINGUAS $lang"
286 if [ -d $GTKSTACK_ROOT/share/locale/$l ] ; then
287 echo "Copying GTK i18n files for $l..."
288 cp -r $GTKSTACK_ROOT/share/locale/$l $Locale
290 # try with just the language spec
291 just_lang=`echo $l | sed 's/_[A-Z][A-Z]$//'`
292 if [ -d $GTKSTACK_ROOT/share/locale/$just_lang ] ; then
293 echo "Copying GTK i18n files for $l..."
294 cp -r $GTKSTACK_ROOT/share/locale/$just_lang $Locale
299 echo "Skipping NLS support"
303 # Copy stuff that may be dynamically loaded
306 cp -R $GTKSTACK_ROOT/etc/* $Etc
307 cp -R $GTKSTACK_ROOT/lib/charset.alias $Resources
309 # We rely on clearlooks, so include a version from our own build tree
310 # this one is special - we will set GTK_PATH to $Frameworks/gtkengines
312 GTK_ENGINE_DIR=$Frameworks/gtkengines/engines
313 mkdir -p $GTK_ENGINE_DIR
315 echo "Copying GTK engines ..."
316 cp $BUILD_ROOT/libs/clearlooks-newer/libclearlooks.dylib $Frameworks
317 (cd $GTK_ENGINE_DIR && ln -s ../../libclearlooks.dylib . && ln -s ../../libclearlooks.dylib libclearlooks.so)
319 cp $GTKSTACK_ROOT/lib/gtk-2.0/2.10.0/engines/libpixmap.so $Frameworks
320 (cd $GTK_ENGINE_DIR && ln -s ../../libpixmap.so)
323 if test x$WITH_LADSPA != x ; then
324 if test x$SAE != x ; then
326 elif test x$MIXBUS != x ; then
327 plugdir=mixbus_ladspa
331 if [ -d $plugdir -a "x$(ls $plugdir)" != x ] ; then
332 echo "Copying `ls $plugdir | wc -l` plugins ..."
333 cp -r $plugdir/* $Plugins
337 # Control Surface shared libraries
338 cp $BUILD_ROOT/libs/surfaces/*/libardour_*.dylib $Surfaces
339 cp $BUILD_ROOT/libs/surfaces/control_protocol/libardourcp*.dylib $Frameworks
342 cp $BUILD_ROOT/libs/panners/*/lib*.dylib $Panners
345 for backend in jack wavesaudio dummy coreaudio; do
346 cp $BUILD_ROOT/libs/backends/$backend/lib*.dylib $Backends
349 # Export Formats/Presets
350 for f in $BUILD_ROOT/../export/*.preset $BUILD_ROOT/../export/*.format ; do
351 cp "$f" $ExportFormats ;
354 # Session and Route templates
355 #for f in $BUILD_ROOT/../templates/* ; do
356 # if [ -d "$f" ] ; then
357 # cp -r "$f" $Templates ;
362 # got to be careful with names here
363 for x in $BUILD_ROOT/../midi_maps/*.map ; do
368 # got to be careful with names here
369 for x in $BUILD_ROOT/../patchfiles/*.midnam ; do
374 # got to be careful with names here
375 for x in $BUILD_ROOT/../mcp/*.device $BUILD_ROOT/../mcp/*.profile ; do
376 cp "$x" $MackieControl
379 # VAMP plugins that we use
380 cp $BUILD_ROOT/libs/vamp-plugins/libardourvampplugins.dylib $Frameworks
382 # Suil modules (new dir 'build-stack')
383 if test -d $GTKSTACK_ROOT/lib/suil-0/ ; then
384 cp $GTKSTACK_ROOT/lib/suil-0/lib* $Frameworks
387 # Suil modules (old dir 'build-ardour-stack')
388 if test -d $ARDOURSTACK_ROOT/lib/suil-0/ ; then
389 cp $ARDOURSTACK_ROOT/lib/suil-0/lib* $Frameworks
392 # VST scanner app and wrapper script, if they exist
393 if test -d $BUILD_ROOT/libs/fst ; then
394 cp $BUILD_ROOT/libs/fst/ardour-vst-scanner* $Frameworks/
398 if test -f $BUILD_ROOT/libs/vfork/ardour-exec-wrapper ; then
399 mkdir -p $Frameworks/vfork
400 cp $BUILD_ROOT/libs/vfork/ardour-exec-wrapper $Frameworks/
406 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Panners/*.dylib $Backends/*.dylib $Surfaces/*.dylib $Plugins/*.so ; do
407 if ! file $file | grep -qs Mach-O ; then
411 if test x$STRIP != x ; then
412 strip -u -r -arch all $file &>/dev/null
415 deps=`otool -L $file | awk '{print $1}' | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/)" | grep -v 'libjack\.' | grep -v "$(basename $file)"`
417 for dep in $deps ; do
419 if ! test -f $Frameworks/$base; then
420 if echo $dep | grep -sq '^libs' ; then
421 cp $BUILD_ROOT/$dep $Frameworks
429 if test x$missing = xfalse ; then
430 # everything has been found
436 echo "Copying other stuff to $APPDIR ..."
438 #cp $BUILD_ROOT/gtk2_ardour/ergonomic-us.bindings $Resources
440 cp $BUILD_ROOT/gtk2_ardour/mnemonic-us.bindings $Resources
441 cp $BUILD_ROOT/gtk2_ardour/ardour.menus $Resources
442 cp $BUILD_ROOT/gtk2_ardour/default_ui_config $Resources
443 cp $BUILD_ROOT/gtk2_ardour/clearlooks.rc $Resources
445 # Copied directly from source tree
447 cp ../../system_config $Resources/system_config
448 cp ../../instant.xml $Resources/instant.xml
449 cp ../../gtk2_ardour/step_editing.bindings $Resources
450 cp ../../gtk2_ardour/mixer.bindings $Resources
451 cp -r ../../gtk2_ardour/icons $Resources
452 cp -r ../../gtk2_ardour/pixmaps $Resources
453 cp ../../gtk2_ardour/dark.colors $Resources
454 cp -R ../../gtk2_ardour/splash.png $Shared
455 cp -R ../../gtk2_ardour/small-splash.png $Shared
456 cp -R ../../gtk2_ardour/ArdourMono.ttf $Shared
458 # go through and recursively remove any .svn dirs in the bundle
459 for svndir in `find $APPDIR -name .svn -type dir`; do
463 # install bundled LV2s to <app>/Contents/lib/LV2/
464 cp -R $BUILD_ROOT/libs/LV2 $Frameworks/
466 # lv2 core, classifications etc - TODO check if we need the complete LV2 ontology
467 if test -d $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
468 cp -R $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
469 elif test -d $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
470 cp -R $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
474 # now fix up the executables
475 echo "Fixing up executable dependency names ..."
476 executables=$MAIN_EXECUTABLE
477 if test x$SAE != x ; then
478 executables="$executables"
481 for exe in $executables; do
482 EXE=$APPROOT/MacOS/$exe
484 for lib in `otool -L $EXE | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
486 changes="$changes -change $lib @executable_path/../lib/$base"
488 if test "x$changes" != "x" ; then
489 install_name_tool $changes $EXE
493 echo "Fixing up library names ..."
494 # now do the same for all the libraries we include
495 for libdir in $Frameworks $Frameworks/modules $Surfaces $Panners $Backends ; do
497 libbase=`basename $libdir`
499 for dylib in $libdir/*.dylib $libdir/*.so ; do
503 if test -L $dylib ; then
507 # change all the dependencies
510 for lib in `otool -L $dylib | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
512 if echo $lib | grep -s libbase; then
513 changes="$changes -change $lib @executable_path/../$libbase/$base"
515 changes="$changes -change $lib @executable_path/../lib/$base"
519 if test "x$changes" != x ; then
520 if install_name_tool $changes $dylib ; then
527 # now the change what the library thinks its own name is
529 base=`basename $dylib`
530 install_name_tool -id @executable_path/../$libbase/$base $dylib
535 # and now ... the DMG
538 rm -rf $PRODUCT_PKG_DIR
539 mkdir $PRODUCT_PKG_DIR
544 if [ x$SAE != x ] ; then
548 echo "Creating SAE packaging directory"
549 mv $APPDIR $PRODUCT_PKG_DIR/Ardour3-SAE.app
550 cp HowToInstallArdourSAE.pdf "$PRODUCT_PKG_DIR/How To Install Ardour SAE.pdf"
551 cp SAE-de-keypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts (keypad).pdf"
552 cp SAE-de-nokeypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts.pdf"
554 elif [ x$MIXBUS != x ] ; then
558 echo "Creating Mixbus packaging directory"
559 mv $APPDIR $PRODUCT_PKG_DIR/
560 DMGBACKGROUND=dmgbgMB
563 echo "Creating $APPNAME packaging directory"
564 mv $APPDIR $PRODUCT_PKG_DIR/
568 if test x$WITH_HARRISON_LV2 != x ; then
569 if file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q x86_64; then
574 curl -s http://www.harrisonconsoles.com/mixbus/mb3/${OSX_ARCH}/harrison_lv2s.zip \
575 | bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf -
578 if test x$WITH_HARVID != x ; then
579 echo "installing video tools.."
580 HARVID_VERSION=$(curl -s -S http://ardour.org/files/video-tools/harvid_version.txt)
581 XJADEO_VERSION=$(curl -s -S http://ardour.org/files/video-tools/xjadeo_version.txt)
583 echo "copying harvid and xjadeo ..."
586 rsync://ardour.org/video-tools/harvid-osx-${HARVID_VERSION}.tgz \
587 "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz"
590 rsync://ardour.org/video-tools/jadeo-${XJADEO_VERSION:1}.dmg \
591 "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg"
594 -C $PRODUCT_PKG_DIR/$APPROOT \
595 -f "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz" || exit 1
597 JADEO=$(hdiutil attach "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg" | grep Apple_HFS | grep dev/ | cut -f 3)
598 cp -r "${JADEO}/Jadeo.app" "$PRODUCT_PKG_DIR/"
599 hdiutil detach "${JADEO}"
602 YPOS=$[ $DMGWINBOTTOM - 300 ]
603 XJADEOPOS="set position of item \"Jadeo.app\" of container window to {310, ${YPOS}}"
605 DMGBACKGROUND=${DMGBACKGROUND}xj
608 ###################################################################
609 ### Mixbus plugins, etc
610 if test -n "$MIXBUS"; then
611 echo "bundling x42 plugins"
612 if file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q x86_64; then
618 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
620 METERS_VERSION=$(curl -s -S http://gareus.org/x42/osx/x42-meters.latest.txt)
621 rsync -a -q --partial \
622 rsync://gareus.org/x42/osx/x42-meters-lv2-osx-${METERS_VERSION}.zip \
623 "$CACHEDIR/x42-meters-lv2-osx-${METERS_VERSION}.zip"
624 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
625 "$CACHEDIR/x42-meters-lv2-osx-${METERS_VERSION}.zip"
627 SETBFREE_VERSION=$(curl -s -S http://gareus.org/x42/osx/setBfree.latest.txt)
628 rsync -a -q --partial \
629 rsync://gareus.org/x42/osx/setBfree-lv2-osx-${SETBFREE_VERSION}.zip \
630 "$CACHEDIR/setBfree-lv2-osx-${SETBFREE_VERSION}.zip"
631 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
632 "$CACHEDIR/setBfree-lv2-osx-${SETBFREE_VERSION}.zip"
634 MIDIFILTER_VERSION=$(curl -s -S http://gareus.org/x42/osx/x42-midifilter.latest.txt)
635 rsync -a -q --partial \
636 rsync://gareus.org/x42/osx/x42-midifilter-lv2-osx-${MIDIFILTER_VERSION}.zip \
637 "$CACHEDIR/x42-midifilter-lv2-osx-${MIDIFILTER_VERSION}.zip"
638 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
639 "$CACHEDIR/x42-midifilter-lv2-osx-${MIDIFILTER_VERSION}.zip"
641 for file in ${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/*/*.dylib ; do
642 lipo -thin ${OSX_ARCH} ${file} -output ${file}.thin
643 mv ${file}.thin ${file}
647 ################################################################################
649 ( cd $PRODUCT_PKG_DIR ; find . ) > file_list.txt
651 echo "Building DMG ..."
653 # UC_DMG=$APPNAME-${release_version}-UC.dmg
654 # FINAL_DMG=$APPNAME-${release_version}.dmg
656 if [ x$DEBUG = xT ]; then
657 UC_DMG=$APPNAME-$release_version-dbg.dmg
659 UC_DMG=$APPNAME-$release_version.dmg
661 VOLNAME=$APPNAME-$release_version
663 MNTPATH=`mktemp -d -t ardourimg`
664 TMPDMG=`mktemp -t ardour`
665 ICNSTMP=`mktemp -t ardouricon`
667 DMGMEGABYTES=$[ `du -sk "$PRODUCT_PKG_DIR" | cut -f 1` * 1024 / 1048576 + $EXTRA_SPACE_MB ]
669 echo "DMG MB = " $DMGMEGABYTES
671 rm -f $UC_DMG "$TMPDMG" "${TMPDMG}.dmg" "$ICNSTMP"
675 TMPDMG="${TMPDMG}.dmg"
677 trap "rm -rf $MNTPATH $TMPDMG ${TMPDMG}.dmg $ICNSTMP" EXIT
679 hdiutil create -megabytes $DMGMEGABYTES "$TMPDMG"
680 DiskDevice=$(hdid -nomount "$TMPDMG" | grep Apple_HFS | cut -f 1 -d ' ')
681 newfs_hfs -v "${VOLNAME}" "${DiskDevice}"
682 mount -t hfs -o nobrowse "${DiskDevice}" "${MNTPATH}"
684 cp -r ${PRODUCT_PKG_DIR}/* "${MNTPATH}" || exit
685 mkdir "${MNTPATH}/.background"
686 cp -vi ${DMGBACKGROUND}.png "${MNTPATH}/.background/dmgbg.png"
688 echo "setting DMG background ..."
690 if test $(sw_vers -productVersion | cut -d '.' -f 2) -lt 9; then
694 # OSX 10.9.X and later
695 DISKNAME=`basename "${MNTPATH}"`
699 tell application "Finder"
701 tell disk "${DISKNAME}"
703 set current view of container window to icon view
704 set toolbar visible of container window to false
705 set statusbar visible of container window to false
706 set the bounds of container window to {400, 200, 800, ${DMGWINBOTTOM}}
707 set theViewOptions to the icon view options of container window
708 set arrangement of theViewOptions to not arranged
709 set icon size of theViewOptions to 64
710 set background picture of theViewOptions to file ".background:dmgbg.png"
711 make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
712 set position of item "${APPDIR}" of container window to {90, 100}
713 set position of item "Applications" of container window to {310, 100}
719 update without registering applications
726 chmod -Rf go-w "${MNTPATH}"
730 echo "compressing Image ..."
732 # Umount the image ('eject' above may already have done that)
733 umount "${DiskDevice}" || true
734 hdiutil eject "${DiskDevice}" || true
735 # Create a read-only version, use zlib compression
736 hdiutil convert -format UDZO "${TMPDMG}" -imagekey zlib-level=9 -o "${UC_DMG}"
738 echo "setting file icon ..."
740 cp ${PRODUCT_PKG_DIR}/$Resources/appIcon.icns ${ICNSTMP}.icns
741 sips -i ${ICNSTMP}.icns
742 DeRez -only icns ${ICNSTMP}.icns > ${ICNSTMP}.rsrc
743 Rez -append ${ICNSTMP}.rsrc -o "$UC_DMG"
744 SetFile -a C "$UC_DMG"
746 rm ${ICNSTMP}.icns ${ICNSTMP}.rsrc
747 rm -rf ${PRODUCT_PKG_DIR}
750 echo "packaging suceeded."