#!/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 '' >$plistfile echo '' >>$plistfile echo '' >>$plistfile echo '' >>$plistfile echo ' CFBundleDevelopmentRegion' >>$plistfile echo ' English' >>$plistfile echo ' CFBundleExecutable' >>$plistfile echo ' '$appfile'' >>$plistfile echo ' CFBundleIconFile' >>$plistfile echo ' macicon.icns' >>$plistfile echo ' CFBundleIdentifier' >>$plistfile echo ' org.pascal.lazarusimageeditor' >>$plistfile echo ' CFBundleInfoDictionaryVersion' >>$plistfile echo ' 6.0' >>$plistfile echo ' CFBundlePackageType' >>$plistfile echo ' APPL' >>$plistfile echo ' CFBundleSignature' >>$plistfile echo ' IMG#' >>$plistfile echo ' CFBundleVersion' >>$plistfile echo ' 1.0' >>$plistfile echo '' >>$plistfile echo '' >>$plistfile fi