public
Description: sole's demoscene projects
Homepage: http://soledadpenades.com/tag/demoscene/
Clone URL: git://github.com/sole/demoscene.git
demoscene / releases / ppg / ppg_05_cc / src / bundle.sh
100644 53 lines (43 sloc) 1.48 kb
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
#!/bin/sh
 
# Creates application bundles for use on Mac OS X.
 
# Amazing simple little script by the guys from the glfw project
# http://glfw.sourceforge.net/
 
# I added the icon part (CFBundleIconFile) so that the app has a nice icon
 
if [ -z "$1" ]; then
echo "usage: `basename $0` BUNDLE-NAME"
  exit 1
fi
 
bundle_name="$1"
 
if [ ! -d "${bundle_name}.app/Contents/MacOS" ]; then
mkdir -p "${bundle_name}.app/Contents/MacOS"
fi
 
if [ ! -d "${bundle_name}.app/Contents/Resources" ]; then
mkdir -p "${bundle_name}.app/Contents/Resources"
fi
 
if [ ! -f "${bundle_name}.app/Contents/PkgInfo" ]; then
echo -n "APPL????" > "${bundle_name}.app/Contents/PkgInfo"
fi
 
if [ ! -f "${bundle_name}.app/Contents/Info.plist" ]; then
cat > "${bundle_name}.app/Contents/Info.plist" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${bundle_name}</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.1</string>
</dict>
</plist>
EOF
fi