~ubuntu-branches/ubuntu/precise/openarena/precise

« back to all changes in this revision

Viewing changes to make-macosx-ub.sh

  • Committer: Bazaar Package Importer
  • Author(s): Bruno "Fuddl" Kleinert
  • Date: 2007-01-20 12:28:09 UTC
  • Revision ID: james.westby@ubuntu.com-20070120122809-2yza5ojt7nqiyiam
Tags: upstream-0.6.0
ImportĀ upstreamĀ versionĀ 0.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
APPBUNDLE=ioquake3.app
 
3
BINARY=ioquake3.ub
 
4
PKGINFO=APPIOQ3
 
5
ICNS=code/unix/MacSupport/ioquake3.icns
 
6
DESTDIR=build/release-darwin-ub
 
7
BASEDIR=baseq3
 
8
MPACKDIR=missionpack
 
9
Q3_VERSION=`grep "\#define Q3_VERSION" code/qcommon/q_shared.h | \
 
10
        sed -e 's/.*".* \([^ ]*\)"/\1/'`;
 
11
 
 
12
BIN_OBJ="
 
13
        build/release-darwin-ppc/ioquake3.ppc
 
14
        build/release-darwin-i386/ioquake3.i386
 
15
"
 
16
BASE_OBJ="
 
17
        build/release-darwin-ppc/$BASEDIR/cgameppc.dylib
 
18
        build/release-darwin-i386/$BASEDIR/cgamei386.dylib
 
19
        build/release-darwin-ppc/$BASEDIR/uippc.dylib
 
20
        build/release-darwin-i386/$BASEDIR/uii386.dylib
 
21
        build/release-darwin-ppc/$BASEDIR/qagameppc.dylib
 
22
        build/release-darwin-i386/$BASEDIR/qagamei386.dylib
 
23
"
 
24
MPACK_OBJ="
 
25
        build/release-darwin-ppc/$MPACKDIR/cgameppc.dylib
 
26
        build/release-darwin-i386/$MPACKDIR/cgamei386.dylib
 
27
        build/release-darwin-ppc/$MPACKDIR/uippc.dylib
 
28
        build/release-darwin-i386/$MPACKDIR/uii386.dylib
 
29
        build/release-darwin-ppc/$MPACKDIR/qagameppc.dylib
 
30
        build/release-darwin-i386/$MPACKDIR/qagamei386.dylib
 
31
"
 
32
if [ ! -f Makefile ]; then
 
33
        echo "This script must be run from the ioquake3 build directory";
 
34
fi
 
35
 
 
36
if [ ! -d /Developer/SDKs/MacOSX10.2.8.sdk ]; then
 
37
        echo "
 
38
/Developer/SDKs/MacOSX10.2.8.sdk/ is missing.
 
39
The installer for this SDK is included with XCode 2.2 or newer"
 
40
        exit 1;
 
41
fi
 
42
 
 
43
if [ ! -d /Developer/SDKs/MacOSX10.4u.sdk ]; then
 
44
        echo "
 
45
/Developer/SDKs/MacOSX10.4u.sdk/ is missing.   
 
46
The installer for this SDK is included with XCode 2.2 or newer"
 
47
        exit 1;
 
48
fi
 
49
 
 
50
(BUILD_MACOSX_UB=ppc make && BUILD_MACOSX_UB=i386 make) || exit 1;
 
51
 
 
52
echo "Creating .app bundle $DESTDIR/$APPBUNDLE"
 
53
if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then
 
54
        mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1;
 
55
fi
 
56
if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR ]; then
 
57
        mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR || exit 1;
 
58
fi
 
59
if [ ! -d $DESTDIR/$APPBUNDLE/Contents/Resources ]; then
 
60
        mkdir -p $DESTDIR/$APPBUNDLE/Contents/Resources
 
61
fi
 
62
cp $ICNS $DESTDIR/$APPBUNDLE/Contents/Resources/ioquake3.icns || exit 1;
 
63
echo $PKGINFO > $DESTDIR/$APPBUNDLE/Contents/PkgInfo
 
64
echo "
 
65
        <?xml version=\"1.0\" encoding="UTF-8"?>
 
66
        <!DOCTYPE plist
 
67
                PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
 
68
                \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
 
69
        <plist version=\"1.0\">
 
70
        <dict>
 
71
                <key>CFBundleDevelopmentRegion</key>
 
72
                <string>English</string>
 
73
                <key>CFBundleExecutable</key>
 
74
                <string>$BINARY</string>
 
75
                <key>CFBundleGetInfoString</key>
 
76
                <string>ioquake3 $Q3_VERSION</string>
 
77
                <key>CFBundleIconFile</key>
 
78
                <string>ioquake3.icns</string>
 
79
                <key>CFBundleIdentifier</key>
 
80
                <string>org.icculus.quake3</string>
 
81
                <key>CFBundleInfoDictionaryVersion</key>
 
82
                <string>6.0</string>
 
83
                <key>CFBundleName</key>
 
84
                <string>ioquake3</string>
 
85
                <key>CFBundlePackageType</key>
 
86
                <string>APPL</string>
 
87
                <key>CFBundleShortVersionString</key>
 
88
                <string>$Q3_VERSION</string>
 
89
                <key>CFBundleSignature</key>
 
90
                <string>$PKGINFO</string>
 
91
                <key>CFBundleVersion</key>
 
92
                <string>$Q3_VERSION</string>
 
93
                <key>NSExtensions</key>
 
94
                <dict/>
 
95
                <key>NSPrincipalClass</key>
 
96
                <string>NSApplication</string>
 
97
        </dict>
 
98
        </plist>
 
99
        " > $DESTDIR/$APPBUNDLE/Contents/Info.plist
 
100
 
 
101
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ
 
102
cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
 
103
cp $MPACK_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR/
 
104
cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/
 
105