[vos-d] A Script for Mac OS X Installation of terangreal and wxterangreal

Andrew Robbins and_j_rob at yahoo.com
Sat Apr 29 02:21:54 EDT 2006


The following file, if used, would go:
 'vos-browser/apps/terangreal/macosx-ize.sh'
or something. And it requires an icon file in
the same directory, which should be called:
 'vos-browser/apps/terangreal/terappicon.icns'
or something. This should be run after terangreal and
wxterangreal are built, for it depends on them to move
them into the .app package structure. The last couple
lines could be changed around, or maybe not used at
all, just an example of how the script could be used.
Anyways, let me know how it goes, all.

Andrew Robbins

PS. Heres the script:

#!/bin/sh
# macosx-ize.sh - making .app wrappers for apps
# by Andrew Robbins

appize_directory() {
DIR=`basename $1`
echo "macosx-ize.sh: constructing '$1'"
mkdir -p $DIR
cd $DIR
}

appize_transfer() {
FIL=`basename $1`
echo "macosx-ize.sh: moving '$FIL' from '$1'"
rm -f $FIL
cp $1 $FIL
}

appize_make_infoplist() {
echo "macosx-ize.sh: constructing
'$1.app/Contents/Info.plist'"
rm -f Info.plist
m4 \
    -DMACRO_APP_NAME_TITLECASE=$1 \
    -DMACRO_APP_NAME_LOWERCASE=$2 \
    -DMACRO_APP_VERSION=$3 \
    > Info.plist <<__EOF__
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM
"file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
  <dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleName</key>
    <string>MACRO_APP_NAME_TITLECASE()</string>
    <key>CFBundleExecutable</key>
    <string>MACRO_APP_NAME_LOWERCASE()</string>
    <key>CFBundleIconFile</key>
    <string>terangreal_appicon.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</string>
    <key>CFBundleShortVersionString</key>
    <string>MACRO_APP_VERSION()</string>
    <key>NSPrincipalClass</key>
    <string>NSApplication</string>
  </dict>
</plist>    
__EOF__
}

appize_make_resources() {
appize_directory "$1.app/Contents/Resources"
appize_directory
"$1.app/Contents/Resources/English.lproj"
echo "macosx-ize.sh: constructing
'$1.app/Contents/Resources/English.lproj/InfoPlist.strings'"
rm -f InfoPlist.strings
m4 \
    -DMACRO_APP_NAME_TITLECASE=$1 \
    -DMACRO_APP_NAME_LOWERCASE=$2 \
    -DMACRO_APP_VERSION=$3 \
    > InfoPlist.strings <<__EOF__
CFBundleName = "MACRO_APP_NAME_TITLECASE()";
CFBundleShortVersionString = "MACRO_APP_VERSION()";
CFBundleGetInfoString = "MACRO_APP_NAME_TITLECASE(),
MACRO_APP_VERSION()";
__EOF__
cd ..
# move icons to Content/Resources/
appize_transfer ../../../$4     
cd ..
}

appize_make_binary() {
appize_directory "$1.app/Contents/MacOS"
# move binary to Content/MacOS/
appize_transfer ../../../$2     
cd ..
}

appize_make_pkginfo() {
echo "APPL????" > PkgInfo
}

appize() {
appize_directory "$1.app"
appize_directory "$1.app/Contents"
appize_make_binary      $1 $2 $3 $4
appize_make_infoplist   $1 $2 $3 $4
appize_make_pkginfo     $1 $2 $3 $4
appize_make_resources   $1 $2 $3 $4
cd ../..
}

# Requires a 'terappicon.icns' file in the directory: 
# 'vos-browser/apps/terangreal', where this should be
run.

# Arguments: "MacOSX-name" "unix-name" "version"
iconfile
appize "TerAngreal" "terangreal" "0.99"
terappicon.icns
appize "wxTerAngreal" "wxterangreal" "0.99"
terappicon.icns


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the vos-d mailing list