-
Notifications
You must be signed in to change notification settings - Fork 20
/
create-macx-dmg.sh
executable file
·54 lines (48 loc) · 1.94 KB
/
create-macx-dmg.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
#-----------------------------------------------------------------------------
# create-macx-dmg.sh
#
# Create a disk image file for Mac OS X.
#
# Copyright 2006-2012 Boshvark Software, LLC.
#
# This file is part of Zyzzyva.
#
# Zyzzyva is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Zyzzyva is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#-----------------------------------------------------------------------------
set -e
. $(pwd)/installer/create-macx-bundle.sh
ZVER=$(cat $(pwd)/VERSION)
APPDIR=$OUTDIR/Zyzzyva-$ZVER.app
DMGFILE=Zyzzyva-$ZVER.dmg
README=$OUTDIR/README.txt
rm -f $README
echo "Drag both Zyzzyva-$ZVER and assistant to the same directory" >>$README
echo "on your hard drive. They need to be next to each other for" >>$README
echo "the Zyzzyva help system to work." >>$README
# Create disk image
echo "Creating disk image..."
rm -rf $DMGFILE
hdiutil create -srcfolder $APPDIR -srcfolder $OUTDIR/assistant.app -srcfolder $README -volname Zyzzyva-$ZVER $DMGFILE > /dev/null
hdiutil attach $DMGFILE > /dev/null
DEVS=$(hdiutil attach $DMGFILE | cut -f 1)
DEV=$(echo $DEVS | cut -f 1 -d ' ')
hdiutil detach $DEV > /dev/null
hdiutil internet-enable -yes $DMGFILE > /dev/null
hdiutil convert $DMGFILE -format UDZO -o Zyzzyva-output.dmg > /dev/null
# 10.3.9 uses -format ADC
mv Zyzzyva-output.dmg $DMGFILE
mv $DMGFILE $OUTDIR
echo "Done. Disk image is called $OUTDIR/$DMGFILE."