Code

* packaging/osx-app.sh, packaging/macosx/inkscape.ds_store
[inkscape.git] / packaging / macosx / osx-dmg.sh
1 #!/bin/sh
2 #
3 # Inkscape packaging script for Mac OS X
4 #
5 # The script creates a read-write disk image, 
6 # copies Inkscape in it, customizes its appearance through
7 # an applescript and compresses the disk image for distribution
8 #
9 # Authors:
10 #       Jean-Olivier Irisson <jo.irisson@gmail.com>
11 #       Michael Wybrow <mjwybrow@users.sourceforge.net>
12 #
13 # Copyright 2006
14 # Licensed under GNU General Public License
15 #
17 RWNAME="RWinkscape.dmg"
18 VOLNAME="Inkscape"
19 FIRSTTIME="false"
20 TMPDIR="/tmp/dmg-$$"
22 # Create temp directory with desired contents of the release volume.
23 rm -rf "$TMPDIR"
24 mkdir "$TMPDIR"
26 # Copy Inkscape.app folder.
27 cp -rf ../Inkscape.app "$TMPDIR"/
29 # link to Applications in order to drag and drop inkscape onto it.
30 ln -sf /Applications "$TMPDIR"/
31         
32 # Copy a background image inside a hidden directory so the image
33 # file itself won't be shown.
34 mkdir "$TMPDIR/.background"
35 cp dmg_background.png "$TMPDIR/.background/background.png"
37 # Copy the .DS_Store file which contains information about window size,
38 # appearance, etc.  Most of this can be set with Apple script but involves
39 # user intervention so we just keep a copy of the correct settings and
40 # use that instead.
41 cp inkscape.ds_store "$TMPDIR/.DS_Store"
43 # Create a new RW image from the temp directory.
44 rm -f "$RWNAME"
45 /usr/bin/hdiutil create -srcfolder "tmp-dmg" -volname "$VOLNAME" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW "$RWNAME"
47 # We're finished with the temp directory, remove it.
48 rm -rf "$TMPDIR"
50 # Mount the created image.
51 MOUNT_DIR="/Volumes/$VOLNAME"
52 DEV_NAME=`/usr/bin/hdiutil attach -readwrite -noverify -noautoopen "$RWNAME" | egrep '^/dev/' | sed 1q | awk '{print $1}'`
54 # /usr/bin/osascript dmg_set_style.scpt
56 # Have the disk image window open automatically when mounted.
57 bless -openfolder /Volumes/$VOLNAME
59 # Unmount the disk image.
60 hdiutil detach "$DEV_NAME"
62 # Create the offical release image by compressing the RW one.
63 DATE=`date "+%Y%m%d"`
64 /usr/bin/hdiutil convert "$RWNAME" -format UDZO -imagekey zlib-level=9 -o "../Inkscape_$DATE.dmg"
65 rm -f "$RWNAME"