~ubuntu-branches/ubuntu/wily/udj-desktop-client/wily

« back to all changes in this revision

Viewing changes to admin/mac/create-dmg.sh

  • Committer: Package Import Robot
  • Author(s): Nathan Handler
  • Date: 2012-11-14 15:29:07 UTC
  • mfrom: (1.2.1) (4.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20121114152907-8uj9bwcima77vu28
Tags: 0.6.3-1
* New upstream release
* debian/copyright: Add stanzas for new upstream files
* debian/rules:
  - Do not install ./usr/share/doc/udj/UDJ.1
  - Remove /usr/share/doc/udj directory if it is empty
* debian/control:
  - Bump Standards-Version to 3.9.4 (no changes)
  - Use my @debian.org address for the Maintainer field

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
 
4
#
 
5
# Copyright 2011, John Maguire <john.maguire@gmail.com>
 
6
#
 
7
# Tomahawk is free software: you can redistribute it and/or modify
 
8
# it under the terms of the GNU General Public License as published by
 
9
# the Free Software Foundation, either version 3 of the License, or
 
10
# (at your option) any later version.
 
11
#
 
12
# Tomahawk is distributed in the hope that it will be useful,
 
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
15
# GNU General Public License for more details.
 
16
#
 
17
# You should have received a copy of the GNU General Public License
 
18
# along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
 
19
 
 
20
# author: max@last.fm, muesli@tomahawk-player.org
 
21
# brief:  Produces a compressed DMG from a bundle directory
 
22
# usage:  Pass the bundle directory as the only parameter
 
23
# note:   This script depends on the UDJ build system, and must be run from
 
24
#         the build directory
 
25
#Shamelessly stolen from the tomahawk project. Super thanks to them.
 
26
################################################################################
 
27
 
 
28
 
 
29
 
 
30
#if [ -z $VERSION ]
 
31
#then
 
32
#    echo VERSION must be set
 
33
#    exit 2
 
34
#fi
 
35
 
 
36
if [ -z "$1" ]
 
37
then
 
38
    echo "Please pass the bundle.app directory as the first parameter."
 
39
    exit 3
 
40
fi
 
41
################################################################################
 
42
 
 
43
 
 
44
NAME=$(basename "$1" | perl -pe 's/(.*).app/\1/')
 
45
IN="$1"
 
46
TMP="dmg/$NAME"
 
47
OUT="$NAME.dmg"
 
48
mkdir -p "$TMP"
 
49
################################################################################
 
50
 
 
51
 
 
52
# clean up
 
53
rm -rf "$TMP"
 
54
rm -f "$OUT"
 
55
 
 
56
# create DMG contents and copy files
 
57
mkdir  "$TMP"
 
58
#mkdir -p "$TMP/.background"
 
59
#cp ../admin/mac/dmg_background.png "$TMP/.background/background.png"
 
60
#cp ../admin/mac/DS_Store.in "$TMP/.DS_Store"
 
61
#chmod go-rwx "$TMP/.DS_Store"
 
62
ln -s /Applications "$TMP/Applications"
 
63
# copies the prepared bundle into the dir that will become the DMG 
 
64
cp -R "$IN" "$TMP"
 
65
 
 
66
# create
 
67
hdiutil makehybrid -hfs -hfs-volume-name UDJ -hfs-openfolder "$TMP" "$TMP" -o tmp.dmg
 
68
hdiutil convert -format UDZO -imagekey zlib-level=9 tmp.dmg -o "$OUT"
 
69
 
 
70
# cleanup
 
71
rm tmp.dmg
 
72
 
 
73
#hdiutil create -srcfolder "$TMP" \
 
74
#               -format UDZO -imagekey zlib-level=9 \
 
75
#               -scrub \
 
76
#               "$OUT" \
 
77
#               || die "Error creating DMG :("
 
78
 
 
79
# done !
 
80
echo 'DMG size:' `du -hs "$OUT" | awk '{print $1}'`