forked from jblomo/viewpoints
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake-OSX-application.csh
More file actions
executable file
·53 lines (53 loc) · 1.73 KB
/
make-OSX-application.csh
File metadata and controls
executable file
·53 lines (53 loc) · 1.73 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/csh -x
#
# This script creates a bare-bones MacOS X application package from a raw executable.
#
# To turn a raw executable a.out into a MacOS X application foo.app use:
# make-OSX-application.csh a.out foo
#
# foo.app can be invoked by opening it from the finder or by using the shell command:
# open foo.app
#
# To invoke the raw executable (say, with command line arguments) use:
# ./foo.app/Contents/MacOS/foo -arg1 ...
#
# or use the hard link to the executable that this script creates (it has to be a hard link)
#
# you can also create shell alias such as (for tcsh):
# alias a.out /Applications/foo.app/Contents/MacOS/foo
#
# todo: add icons, create CFBundleVersion from svn:keyword $Rev$
#
if -e $2.app rm -rf $2.app
mkdir $2.app
mkdir $2.app/Contents
mkdir $2.app/Contents/Resources
mkdir $2.app/Contents/MacOS
echo APPLnone > $2.app/Contents/PkgInfo
mv $1 $2.app/Contents/MacOS/$2
# make a hard so we can run the executable from the command line using its original name
# (note: this must be a hard link, or a shell alias)
ln $2.app/Contents/MacOS/$2 $1
chmod 755 $2.app/Contents/MacOS/$2
cat << EOF > $2.app/Contents/info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$2</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleVersion</key>
<string>1.4</string>
<key>CFBundleShortVersionString</key>
<string>1.4</string>
<key>LSPrefersCarbon</key>
<true/>
<key>CFBundleSignature</key>
<string>none</string>
</dict>
</plist>
EOF