2006-01-21 12:42:04 +00:00
|
|
|
#!/bin/csh
|
|
|
|
|
|
|
|
##
|
2006-02-16 11:21:40 +00:00
|
|
|
# Release Script for Macintosh BOINC Manager 2/16/06 by Charlie Fenton
|
2006-01-21 12:42:04 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
## Usage:
|
|
|
|
## cd to the root directory of the boinc tree, for example:
|
|
|
|
## cd [path]/boinc
|
|
|
|
##
|
|
|
|
## Invoke this script with the three parts of version number as arguments.
|
|
|
|
## For example, if the version is 3.2.1:
|
|
|
|
## source [path_to_this_script] 3 2 1
|
|
|
|
##
|
|
|
|
## This will create a director "BOINC_Installer" in the parent directory of
|
|
|
|
## the current directory
|
2006-01-23 13:16:28 +00:00
|
|
|
##
|
|
|
|
## For testing only, you can use the development build by adding a fourth argument -dev
|
|
|
|
## For example, if the version is 3.2.1:
|
|
|
|
## source [path_to_this_script] 3 2 1 -dev
|
|
|
|
|
|
|
|
## For different branding, modify the following 9 variables:
|
|
|
|
PR_PATH="../BOINC_Installer/GR_Pkg_Root"
|
|
|
|
IR_PATH="../BOINC_Installer/GR_Installer_Resources"
|
|
|
|
NEW_DIR_PATH="../BOINC_Installer/New_Release_GR_$1_$2_$3"
|
|
|
|
README_FILE="mac_installer/GR-ReadMe.rtf"
|
|
|
|
BRANDING_FILE="mac_installer/GR-Branding"
|
|
|
|
ICNS_FILE="GridRepublic.icns"
|
|
|
|
SAVER_SYSPREF_ICON_PATH="clientgui/mac/GridRepublic.tiff"
|
|
|
|
BRAND_NAME="GridRepublic"
|
|
|
|
LC_BRAND_NAME="gridrepublic"
|
|
|
|
|
2006-01-21 12:42:04 +00:00
|
|
|
|
|
|
|
if [ $# -lt 3 ]; then
|
|
|
|
echo "Usage:"
|
|
|
|
echo " cd [path]/boinc"
|
|
|
|
echo " source [path_to_this_script] major_version minor_version revision_number"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
pushd ./
|
|
|
|
|
|
|
|
## XCode 2.x has separate directories for Development and Deployment build products
|
|
|
|
if [ "$4" = "-dev" ]; then
|
|
|
|
if [ -d mac_build/build/Development/ ]; then
|
|
|
|
BUILDPATH="mac_build/build/Development"
|
|
|
|
else
|
|
|
|
BUILDPATH="mac_build/build"
|
|
|
|
fi
|
|
|
|
else
|
2006-02-02 12:48:36 +00:00
|
|
|
if [ -d mac_build/build/Deployment/ ]; then
|
|
|
|
BUILDPATH="mac_build/build/Deployment"
|
2006-01-21 12:42:04 +00:00
|
|
|
else
|
|
|
|
BUILDPATH="mac_build/build"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
sudo rm -dfR ${IR_PATH}
|
|
|
|
sudo rm -dfR ${PR_PATH}
|
|
|
|
|
|
|
|
mkdir -p ${IR_PATH}
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
cp -fp mac_Installer/License.rtf ${IR_PATH}/
|
|
|
|
cp -fp "${README_FILE}" ${IR_PATH}/ReadMe.rtf
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
# Create the installer's preinstall and preupgrade scripts from the standard preinstall script
|
|
|
|
cp -fp mac_installer/preinstall ${IR_PATH}/
|
|
|
|
sed -i "" s/BOINC/temp/g ${IR_PATH}/preinstall
|
|
|
|
sed -i "" s/${BRAND_NAME}/BOINC/g ${IR_PATH}/preinstall
|
|
|
|
sed -i "" s/temp/${BRAND_NAME}/g ${IR_PATH}/preinstall
|
|
|
|
cp -fp ${IR_PATH}/preinstall ${IR_PATH}/preupgrade
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
cp -fp mac_installer/postinstall ${IR_PATH}/
|
|
|
|
cp -fp mac_installer/postupgrade ${IR_PATH}/
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
cp -fpR $BUILDPATH/Postinstall.app ${IR_PATH}/
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
mkdir -p ${PR_PATH}
|
|
|
|
mkdir -p ${PR_PATH}/Applications
|
|
|
|
mkdir -p ${PR_PATH}/Library
|
|
|
|
mkdir -p ${PR_PATH}/Library/Screen\ Savers
|
|
|
|
mkdir -p ${PR_PATH}/Library/Application\ Support
|
|
|
|
mkdir -p ${PR_PATH}/Library/Application\ Support/${BRAND_NAME}\ Data
|
|
|
|
mkdir -p ${PR_PATH}/Library/Application\ Support/${BRAND_NAME}\ Data/locale
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
cp -fpR $BUILDPATH/BOINCManager.app ${PR_PATH}/Applications/
|
|
|
|
|
|
|
|
cp -fpR $BUILDPATH/BOINCSaver.saver ${PR_PATH}/Library/Screen\ Savers/
|
2006-01-21 12:42:04 +00:00
|
|
|
|
|
|
|
## Copy the localization files into the installer tree
|
|
|
|
## Old way copies CVS and *.po files which are not needed
|
2006-01-23 13:16:28 +00:00
|
|
|
## cp -fpR locale/client/ ${PR_PATH}/Library/Application\ Support/BOINC\ Data/locale
|
|
|
|
## sudo rm -dfR ${PR_PATH}/Library/Application\ Support/BOINC\ Data/locale/CVS
|
2006-01-21 12:42:04 +00:00
|
|
|
## New way copies only *.mo files (adapted from boinc/sea/make-tar.sh)
|
2006-02-16 11:21:40 +00:00
|
|
|
find locale/client -name '*.mo' | cut -d '/' -f 3 | awk -v PRPATH=${PR_PATH} -v BRANDNAME=${BRAND_NAME} '{print "\"" PRPATH "/Library/Application Support/" BRANDNAME " Data/locale/"$0"\""}' | xargs mkdir -p
|
2006-01-23 13:16:28 +00:00
|
|
|
find locale/client -name '*.mo' | cut -d '/' -f 3,4 | awk -v PRPATH=${PR_PATH} -v BRANDNAME=${BRAND_NAME} '{print "cp \"locale/client/"$0"\" \"" PRPATH "/Library/Application Support/" BRANDNAME " Data/locale/"$0"\""}' | bash
|
2006-01-21 12:42:04 +00:00
|
|
|
|
|
|
|
## Modify for Grid Republic
|
|
|
|
# Rename the Manager's bundle and its executable inside the bundle
|
2006-01-23 13:16:28 +00:00
|
|
|
mv -f ${PR_PATH}/Applications/BOINCManager.app/ ${PR_PATH}/Applications/${BRAND_NAME}\ Manager.app/
|
|
|
|
mv -f ${PR_PATH}/Applications/${BRAND_NAME}\ Manager.app/Contents/MacOS/BOINCManager ${PR_PATH}/Applications/${BRAND_NAME}\ Manager.app/Contents/MacOS/${BRAND_NAME}\ Manager
|
|
|
|
|
|
|
|
# Update the Manager's info.plist, InfoPlist.strings files
|
|
|
|
sed -i "" s/BOINCManager/${BRAND_NAME}\ Manager/g ${PR_PATH}/Applications/${BRAND_NAME}\ Manager.app/Contents/Info.plist
|
|
|
|
sed -i "" s/BOINCMgr.icns/"${ICNS_FILE}"/g ${PR_PATH}/Applications/${BRAND_NAME}\ Manager.app/Contents/Info.plist
|
|
|
|
sed -i "" s/BOINC/${BRAND_NAME}/g ${PR_PATH}/Applications/${BRAND_NAME}\ Manager.app/Contents/Resources/English.lproj/InfoPlist.strings
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
# Replace the Manager's BOINCMgr.icns file
|
|
|
|
cp -fp "client/mac/${ICNS_FILE}" "${PR_PATH}/Applications/${BRAND_NAME} Manager.app/Contents/Resources/${ICNS_FILE}"
|
|
|
|
rm -f ${PR_PATH}/Applications/${BRAND_NAME}\ Manager.app/Contents/Resources/BOINCMgr.icns
|
2006-01-21 12:42:04 +00:00
|
|
|
|
|
|
|
# Copy Branding file into both Application Bundle and Installer Package
|
2006-01-23 13:16:28 +00:00
|
|
|
cp -fp "${BRANDING_FILE}" ${PR_PATH}/Applications/${BRAND_NAME}\ Manager.app/Contents/Resources/Branding
|
|
|
|
cp -fp "${BRANDING_FILE}" ${IR_PATH}/Branding
|
2006-01-21 12:42:04 +00:00
|
|
|
|
|
|
|
# Rename the screensaver bundle and its executable inside the bundle
|
2006-01-23 13:16:28 +00:00
|
|
|
mv -f ${PR_PATH}/Library/Screen\ Savers/BOINCSaver.saver ${PR_PATH}/Library/Screen\ Savers/${BRAND_NAME}.saver
|
|
|
|
mv -f ${PR_PATH}/Library/Screen\ Savers/${BRAND_NAME}.saver/Contents/MacOS/BOINCSaver ${PR_PATH}/Library/Screen\ Savers/${BRAND_NAME}.saver/Contents/MacOS/${BRAND_NAME}
|
|
|
|
|
|
|
|
# Update screensaver's info.plist, InfoPlist.strings files
|
|
|
|
sed -i "" s/BOINCSaver/${BRAND_NAME}/g ${PR_PATH}/Library/Screen\ Savers/${BRAND_NAME}.saver/Contents/Info.plist
|
|
|
|
sed -i "" s/BOINC/${BRAND_NAME}/g ${PR_PATH}/Library/Screen\ Savers/${BRAND_NAME}.saver/Contents/Resources/English.lproj/InfoPlist.strings
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
# Replace screensaver's boinc.tif file
|
|
|
|
cp -fp "${SAVER_SYSPREF_ICON_PATH}" ${PR_PATH}/Library/Screen\ Savers/${BRAND_NAME}.saver/Contents/Resources/boinc.tiff
|
2006-01-21 12:42:04 +00:00
|
|
|
|
|
|
|
## Fix up ownership and permissions
|
2006-01-23 13:16:28 +00:00
|
|
|
sudo chown -R root:admin ${PR_PATH}/*
|
|
|
|
sudo chmod -R 775 ${PR_PATH}/*
|
|
|
|
sudo chmod 1775 ${PR_PATH}/Library
|
|
|
|
|
|
|
|
sudo chown -R 501:admin ${PR_PATH}/Library/Application\ Support/*
|
|
|
|
sudo chmod -R 755 ${PR_PATH}/Library/Application\ Support/*
|
|
|
|
|
|
|
|
sudo chown -R root:admin ${IR_PATH}/*
|
|
|
|
sudo chmod -R 755 ${IR_PATH}/*
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
sudo rm -dfR ${NEW_DIR_PATH}/
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
mkdir -p ${NEW_DIR_PATH}/
|
2006-02-02 13:20:53 +00:00
|
|
|
mkdir -p ${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal
|
|
|
|
mkdir -p ${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin
|
2006-01-23 13:16:28 +00:00
|
|
|
mkdir -p ${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_SymbolTables
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-02-02 13:20:53 +00:00
|
|
|
cp -fp "${README_FILE}" ${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/ReadMe.rtf
|
|
|
|
sudo chown -R 501:admin ${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/ReadMe.rtf
|
|
|
|
sudo chmod -R 755 ${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/ReadMe.rtf
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-02-02 13:20:53 +00:00
|
|
|
cp -fpR $BUILDPATH/boinc ${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin/
|
|
|
|
cp -fpR $BUILDPATH/boinc_cmd ${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin/
|
|
|
|
sudo chown -R root:admin ${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin/*
|
|
|
|
sudo chmod -R 755 ${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin/*
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
cp -fpR $BUILDPATH/SymbolTables ${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_SymbolTables/
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
# Make temporary copies of Pkg-Info.plist and Description.plist for PackageMaker and update for this branding
|
|
|
|
cp -fp mac_build/Pkg-Info.plist ${NEW_DIR_PATH}
|
|
|
|
cp -fp mac_Installer/Description.plist ${NEW_DIR_PATH}
|
|
|
|
sed -i "" s/BOINC/${BRAND_NAME}/g ${NEW_DIR_PATH}/Pkg-Info.plist
|
|
|
|
sed -i "" s/BOINC/${BRAND_NAME}/g ${NEW_DIR_PATH}/Description.plist
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
# Build the installer package
|
2006-02-02 13:20:53 +00:00
|
|
|
/Developer/Tools/packagemaker -build -p ${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/${BRAND_NAME}.pkg -f ${PR_PATH} -r ${IR_PATH} -i ${NEW_DIR_PATH}/Pkg-Info.plist -d ${NEW_DIR_PATH}/Description.plist -ds
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
# Remove temporary copies of Pkg-Info.plist and Description.plist
|
|
|
|
rm ${NEW_DIR_PATH}/Pkg-Info.plist
|
|
|
|
rm ${NEW_DIR_PATH}/Description.plist
|
2006-01-21 12:42:04 +00:00
|
|
|
|
2006-01-23 13:16:28 +00:00
|
|
|
# Compress the products
|
|
|
|
cd ${NEW_DIR_PATH}
|
2006-02-02 13:20:53 +00:00
|
|
|
zip -rq ${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal.zip ${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal
|
|
|
|
zip -rq ${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin.zip ${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin
|
2006-01-23 13:16:28 +00:00
|
|
|
zip -rq ${LC_BRAND_NAME}_$1.$2.$3_macOSX_SymbolTables.zip ${LC_BRAND_NAME}_$1.$2.$3_macOSX_SymbolTables
|
2006-01-21 12:42:04 +00:00
|
|
|
|
|
|
|
popd
|
|
|
|
return 0
|