You've already forked lazarus-ccr
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2335 8e941d3f-bd1b-0410-a28a-d453659cc2b4
102 lines
2.7 KiB
Bash
Executable File
102 lines
2.7 KiB
Bash
Executable File
#!/bin/sh
|
|
# Force Bourne shell in case tcsh is default.
|
|
#
|
|
|
|
#
|
|
# Reads the bundle type
|
|
#
|
|
|
|
echo "========================================================"
|
|
echo " Bundle creation script"
|
|
echo "========================================================"
|
|
echo ""
|
|
echo " Please select which kind of bundle you would like to build:"
|
|
echo ""
|
|
echo " 1 > Debug bundle"
|
|
echo " 2 > Release bundle"
|
|
echo " 0 > Exit"
|
|
|
|
read command
|
|
|
|
case $command in
|
|
|
|
1) ;;
|
|
|
|
2) ;;
|
|
|
|
0) exit 0;;
|
|
|
|
*) echo "Invalid command"
|
|
exit 0;;
|
|
|
|
esac
|
|
|
|
#
|
|
# Creates the bundle
|
|
#
|
|
|
|
appname=LazClock
|
|
appfolder=$appname.app
|
|
macosfolder=$appfolder/Contents/MacOS
|
|
plistfile=$appfolder/Contents/Info.plist
|
|
appfile=lazclock
|
|
|
|
PkgInfoContents="APPLCLO#"
|
|
|
|
#
|
|
if ! [ -e $appfile ]
|
|
then
|
|
echo "$appfile does not exist"
|
|
elif [ -e $appfolder ]
|
|
then
|
|
echo "$appfolder already exists"
|
|
else
|
|
echo "Creating $appfolder..."
|
|
mkdir $appfolder
|
|
mkdir $appfolder/Contents
|
|
mkdir $appfolder/Contents/MacOS
|
|
mkdir $appfolder/Contents/Resources
|
|
mkdir $appfolder/Contents/Resources/skins
|
|
|
|
#
|
|
# For a debug bundle,
|
|
# Instead of copying executable into .app folder after each compile,
|
|
# simply create a symbolic link to executable.
|
|
#
|
|
if [ $command = 1 ]; then
|
|
ln -s ../../../$appfile $macosfolder/$appfile
|
|
else
|
|
cp $appfile $macosfolder/$appfile
|
|
fi
|
|
|
|
# Copy the resource files to the correct place
|
|
cp skins/*.PNG $appfolder/Contents/Resources/skins
|
|
#
|
|
# Create PkgInfo file.
|
|
echo $PkgInfoContents >$appfolder/Contents/PkgInfo
|
|
#
|
|
# Create information property list file (Info.plist).
|
|
echo '<?xml version="1.0" encoding="UTF-8"?>' >$plistfile
|
|
echo '<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >>$plistfile
|
|
echo '<plist version="1.0">' >>$plistfile
|
|
echo '<dict>' >>$plistfile
|
|
echo ' <key>CFBundleDevelopmentRegion</key>' >>$plistfile
|
|
echo ' <string>English</string>' >>$plistfile
|
|
echo ' <key>CFBundleExecutable</key>' >>$plistfile
|
|
echo ' <string>'$appfile'</string>' >>$plistfile
|
|
echo ' <key>CFBundleIconFile</key>' >>$plistfile
|
|
echo ' <string>macicon.icns</string>' >>$plistfile
|
|
echo ' <key>CFBundleIdentifier</key>' >>$plistfile
|
|
echo ' <string>org.pascal.lazarusimageeditor</string>' >>$plistfile
|
|
echo ' <key>CFBundleInfoDictionaryVersion</key>' >>$plistfile
|
|
echo ' <string>6.0</string>' >>$plistfile
|
|
echo ' <key>CFBundlePackageType</key>' >>$plistfile
|
|
echo ' <string>APPL</string>' >>$plistfile
|
|
echo ' <key>CFBundleSignature</key>' >>$plistfile
|
|
echo ' <string>IMG#</string>' >>$plistfile
|
|
echo ' <key>CFBundleVersion</key>' >>$plistfile
|
|
echo ' <string>1.0</string>' >>$plistfile
|
|
echo '</dict>' >>$plistfile
|
|
echo '</plist>' >>$plistfile
|
|
fi
|