1.2.1
by Francesco Paolo Lovergine
Import upstream version 1.4.0+12730 |
1 |
#!/bin/bash
|
2 |
||
3 |
#
|
|
4 |
# A bash script to create a dmg image file of the
|
|
5 |
# final application bundle
|
|
6 |
# (c) Tim Sutton 2007
|
|
7 |
||
8 |
DMGNAME=QGISAlaskaUncompressed.dmg |
|
9 |
COMPRESSEDDMGNAME=QGISAlaska.dmg |
|
10 |
set -x
|
|
11 |
||
12 |
echo "Removing old dmg if it exists" |
|
13 |
rm ~/Desktop/${DMGNAME} |
|
14 |
rm ~/Desktop/${COMPRESSEDDMGNAME} |
|
15 |
hdiutil create -size 300m -fs HFS+ -volname "QGISAlaska" ~/Desktop/${DMGNAME} |
|
16 |
||
17 |
# Mount the disk image
|
|
18 |
hdiutil attach ~/Desktop/${DMGNAME} |
|
19 |
||
20 |
# Obtain device information
|
|
21 |
DEVS=$(hdiutil attach ~/Desktop/${DMGNAME} | cut -f 1) |
|
22 |
DEV=$(echo $DEVS | cut -f 1 -d ' ') |
|
23 |
VOLUME=$(mount |grep ${DEV} | cut -f 3 -d ' ') |
|
24 |
||
25 |
# copy in the application bundle
|
|
26 |
cp -Rp /Applications/QGISAlaska.app ${VOLUME}/QGISAlaska.app |
|
27 |
||
28 |
# copy in background image and folder settings for icon sizes etc
|
|
29 |
tar xvfz alaska_extra_dmg_files.tar.gz -C ${VOLUME} |
|
30 |
cp ../LICENSE ${VOLUME}/LICENSE.txt |
|
31 |
||
32 |
# Unmount the disk image
|
|
33 |
hdiutil detach $DEV
|
|
34 |
||
35 |
# Convert the disk image to read-only
|
|
36 |
hdiutil convert ~/Desktop/${DMGNAME} \ |
|
37 |
-format UDZO -o ~/Desktop/${COMPRESSEDDMGNAME} |
|
38 |