2006-01-21 12:42:04 +00:00
#!/bin/csh
2006-07-06 11:04:46 +00:00
## Berkeley Open Infrastructure for Network Computing
## http://boinc.berkeley.edu
## Copyright (C) 2005 University of California
##
## This is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation;
## either version 2.1 of the License, or (at your option) any later version.
##
## This software is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
## See the GNU Lesser General Public License for more details.
##
## To view the GNU Lesser General Public License visit
## http://www.gnu.org/copyleft/lesser.html
## or write to the Free Software Foundation, Inc.,
2007-10-09 11:35:47 +00:00
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2006-07-06 11:04:46 +00:00
2006-01-21 12:42:04 +00:00
##
2008-02-22 04:59:05 +00:00
# Release Script for Macintosh GridRepublic Desktop by Charlie Fenton
2008-09-04 00:26:23 +00:00
## updated 9/3/08 by Charlie Fenton
2006-01-21 12:42:04 +00:00
##
2008-02-22 04:59:05 +00:00
## NOTE: This script is deprecated.
## It does not put the branded skin into the installer package.
##
## Use the make_GridRepublic.sh script instead!
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"
2007-10-31 10:40:19 +00:00
SCRIPTS_PATH = "../BOINC_Installer/GR_Installer\ Scripts"
2006-01-23 13:16:28 +00:00
NEW_DIR_PATH = " ../BOINC_Installer/New_Release_GR_ $1 _ $2 _ $3 "
README_FILE = "mac_installer/GR-ReadMe.rtf"
BRANDING_FILE = "mac_installer/GR-Branding"
2007-06-08 11:16:48 +00:00
ICNS_FILE = "gridrepublic.icns"
INSTALLER_ICNS_FILE = "GR_install.icns"
UNINSTALLER_ICNS_FILE = "GR_uninstall.icns"
SAVER_SYSPREF_ICON_PATH = "clientgui/mac/gridrepublic.tiff"
2008-02-22 04:59:05 +00:00
SAVER_LOGO_PATH = "clientscr/res/gridrepublic_ss_logo.png"
2006-01-23 13:16:28 +00:00
BRAND_NAME = "GridRepublic"
2006-04-17 07:58:19 +00:00
MANAGER_NAME = "GridRepublic Desktop"
2006-01-23 13:16:28 +00:00
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"
2006-04-17 07:58:19 +00:00
return 1
2006-01-21 12:42:04 +00:00
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-04-17 07:58:19 +00:00
sudo rm -dfR " ${ IR_PATH } "
sudo rm -dfR " ${ PR_PATH } "
2007-10-31 10:40:19 +00:00
sudo rm -dfR " ${ SCRIPTS_PATH } "
2006-01-23 13:16:28 +00:00
2006-04-17 07:58:19 +00:00
mkdir -p " ${ IR_PATH } "
2007-10-31 10:40:19 +00:00
mkdir -p " ${ SCRIPTS_PATH } "
2006-01-21 12:42:04 +00:00
2006-04-17 07:58:19 +00:00
cp -fp mac_Installer/License.rtf " ${ IR_PATH } / "
cp -fp " ${ README_FILE } " " ${ IR_PATH } /ReadMe.rtf "
2007-06-12 10:25:48 +00:00
cp -fp win_build/installerv2/redist/all_projects_list.xml " ${ IR_PATH } / "
2006-04-17 23:55:35 +00:00
# Update version number
sed -i "" s/"<VER_NUM>" /" $1 . $2 . $3 " /g " ${ 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
2007-10-31 10:40:19 +00:00
cp -fp mac_installer/preinstall " ${ SCRIPTS_PATH } / "
2006-04-17 07:58:19 +00:00
2007-10-31 10:40:19 +00:00
sed -i "" s/BOINCManager/" ${ MANAGER_NAME } " /g " ${ SCRIPTS_PATH } /preinstall "
sed -i "" s/BOINCSaver/" ${ BRAND_NAME } " /g " ${ SCRIPTS_PATH } /preinstall "
2007-09-06 01:40:05 +00:00
2007-09-05 13:34:47 +00:00
##### We've decided not to customize BOINC Data directory name for branding
2007-10-31 10:40:19 +00:00
#### sed -i "" s/BOINC/temp/g "${SCRIPTS_PATH}/preinstall"
#### sed -i "" s/"${BRAND_NAME}"/BOINC/g "${SCRIPTS_PATH}/preinstall"
#### sed -i "" s/temp/"${BRAND_NAME}"/g "${SCRIPTS_PATH}/preinstall"
2006-04-17 07:58:19 +00:00
2007-10-31 10:40:19 +00:00
cp -fp " ${ SCRIPTS_PATH } /preinstall " " ${ SCRIPTS_PATH } /preupgrade "
2006-01-21 12:42:04 +00:00
2007-10-31 10:40:19 +00:00
cp -fp mac_installer/postinstall " ${ SCRIPTS_PATH } / "
cp -fp mac_installer/postupgrade " ${ SCRIPTS_PATH } / "
2006-01-21 12:42:04 +00:00
2007-04-03 09:48:57 +00:00
cp -fpR " $BUILDPATH /PostInstall.app " " ${ IR_PATH } / "
2006-01-21 12:42:04 +00:00
2006-04-17 07:58:19 +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 "
2006-01-21 12:42:04 +00:00
2006-04-17 07:58:19 +00:00
##### We've decided not to customize BOINC Data directory name for branding
#### mkdir -p "${PR_PATH}/Library/Application Support/${BRAND_NAME} Data"
#### mkdir -p "${PR_PATH}/Library/Application Support/${BRAND_NAME} Data/locale"
mkdir -p " ${ PR_PATH } /Library/Application Support/BOINC Data "
2007-06-06 11:42:51 +00:00
mkdir -p " ${ PR_PATH } /Library/Application Support/BOINC Data/locale "
2006-06-20 11:25:23 +00:00
mkdir -p " ${ PR_PATH } /Library/Application Support/BOINC Data/switcher "
2007-07-11 09:52:05 +00:00
mkdir -p " ${ PR_PATH } /Library/Application Support/BOINC Data/skins "
2006-06-20 11:25:23 +00:00
2006-06-27 12:56:11 +00:00
cp -fpR " $BUILDPATH /switcher " " ${ PR_PATH } /Library/Application Support/BOINC Data/switcher/ "
2006-07-06 11:04:46 +00:00
cp -fpR " $BUILDPATH /setprojectgrp " " ${ PR_PATH } /Library/Application Support/BOINC Data/switcher/ "
2007-02-20 01:39:26 +00:00
## cp -fpR "$BUILDPATH/AppStats" "${PR_PATH}/Library/Application Support/BOINC Data/switcher/"
2006-01-23 13:16:28 +00:00
2006-10-28 11:18:09 +00:00
## Put Branding file into BOINC Data folder to make it available to screensaver
cp -fp " ${ BRANDING_FILE } " " ${ PR_PATH } /Library/Application Support/BOINC Data/Branding "
cp -fp curl/ca-bundle.crt " ${ PR_PATH } /Library/Application Support/BOINC Data/ "
2006-08-25 12:38:18 +00:00
2006-06-27 12:56:11 +00:00
cp -fpR " $BUILDPATH /BOINCManager.app " " ${ PR_PATH } /Applications/ "
2006-04-17 07:58:19 +00:00
2006-06-27 12:56:11 +00:00
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
2006-04-17 07:58:19 +00:00
2006-01-21 12:42:04 +00:00
## Old way copies CVS and *.po files which are not needed
2006-04-17 07:58:19 +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-04-17 07:58:19 +00:00
##### We've decided not to customize BOINC Data directory name for branding
#### 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
#### 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
find locale/client -name '*.mo' | cut -d '/' -f 3 | awk -v PRPATH = ${ PR_PATH } '{print "\"" PRPATH "/Library/Application Support/BOINC Data/locale/"$0"\""}' | xargs mkdir -p
find locale/client -name '*.mo' | cut -d '/' -f 3,4 | awk -v PRPATH = ${ PR_PATH } '{print "cp \"locale/client/"$0"\" \"" PRPATH "/Library/Application Support/BOINC 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-04-17 07:58:19 +00:00
mv -f " ${ PR_PATH } /Applications/BOINCManager.app/ " " ${ PR_PATH } /Applications/ ${ MANAGER_NAME } .app/ "
mv -f " ${ PR_PATH } /Applications/ ${ MANAGER_NAME } .app/Contents/MacOS/BOINCManager " " ${ PR_PATH } /Applications/ ${ MANAGER_NAME } .app/Contents/MacOS/ ${ MANAGER_NAME } "
2006-01-23 13:16:28 +00:00
# Update the Manager's info.plist, InfoPlist.strings files
2006-04-17 07:58:19 +00:00
sed -i "" s/BOINCManager/" ${ MANAGER_NAME } " /g " ${ PR_PATH } /Applications/ ${ MANAGER_NAME } .app/Contents/Info.plist "
sed -i "" s/BOINCMgr.icns/" ${ ICNS_FILE } " /g " ${ PR_PATH } /Applications/ ${ MANAGER_NAME } .app/Contents/Info.plist "
sed -i "" s/BOINC/" ${ BRAND_NAME } " /g " ${ PR_PATH } /Applications/ ${ MANAGER_NAME } .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
2006-07-28 09:33:47 +00:00
cp -fp " clientgui/res/ ${ ICNS_FILE } " " ${ PR_PATH } /Applications/ ${ MANAGER_NAME } .app/Contents/Resources/ ${ ICNS_FILE } "
2006-04-17 07:58:19 +00:00
rm -f " ${ PR_PATH } /Applications/ ${ MANAGER_NAME } .app/Contents/Resources/BOINCMgr.icns "
2006-01-21 12:42:04 +00:00
2006-10-28 11:18:09 +00:00
# Copy Branding file into both Application Bundle and Installer Package\
2006-04-17 07:58:19 +00:00
cp -fp " ${ BRANDING_FILE } " " ${ PR_PATH } /Applications/ ${ MANAGER_NAME } .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-04-17 07:58:19 +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 } "
2006-01-23 13:16:28 +00:00
# Update screensaver's info.plist, InfoPlist.strings files
2006-04-17 07:58:19 +00:00
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
2007-09-06 01:40:05 +00:00
# Replace screensaver's boinc.tiff or boinc.jpg file
rm -f " ${ PR_PATH } /Library/Screen Savers/ ${ BRAND_NAME } .saver/Contents/Resources/boinc.jpg "
2006-04-17 07:58:19 +00:00
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
2008-02-22 04:59:05 +00:00
# Replace screensaver's boinc_ss_logo.png file
rm -f " ${ PR_PATH } /Library/Screen Savers/ ${ BRAND_NAME } .saver/Contents/Resources/boinc_ss_logo.png "
cp -fp " ${ SAVER_LOGO_PATH } " " ${ PR_PATH } /Library/Screen Savers/ ${ BRAND_NAME } .saver/Contents/Resources/boinc_ss_logo.png "
2006-01-21 12:42:04 +00:00
## Fix up ownership and permissions
2006-04-17 07:58:19 +00:00
sudo chown -R root:admin " ${ PR_PATH } " /*
2006-06-20 11:25:23 +00:00
sudo chmod -R u+rw,g+rw,o+r-w " ${ PR_PATH } " /*
2006-04-17 07:58:19 +00:00
sudo chmod 1775 " ${ PR_PATH } /Library "
2006-01-23 13:16:28 +00:00
2006-04-17 07:58:19 +00:00
sudo chown -R 501:admin " ${ PR_PATH } /Library/Application Support " /*
2006-06-20 11:25:23 +00:00
sudo chmod -R u+rw,g+r-w,o+r-w " ${ PR_PATH } /Library/Application Support " /*
2006-01-23 13:16:28 +00:00
2006-04-17 07:58:19 +00:00
sudo chown -R root:admin " ${ IR_PATH } " /*
2007-10-31 10:40:19 +00:00
sudo chown -R root:admin " ${ SCRIPTS_PATH } " /*
2006-06-20 11:25:23 +00:00
sudo chmod -R u+rw,g+r-w,o+r-w " ${ IR_PATH } " /*
2007-10-31 10:40:19 +00:00
sudo chmod -R u+rw,g+r-w,o+r-w " ${ SCRIPTS_PATH } " /*
2006-01-21 12:42:04 +00:00
2006-04-17 07:58:19 +00:00
sudo rm -dfR " ${ NEW_DIR_PATH } / "
2006-01-21 12:42:04 +00:00
2006-04-17 07:58:19 +00:00
mkdir -p " ${ NEW_DIR_PATH } / "
mkdir -p " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal "
2007-06-09 11:42:26 +00:00
mkdir -p " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras "
2006-01-21 12:42:04 +00:00
2006-04-17 23:55:35 +00:00
cp -fp " ${ IR_PATH } /ReadMe.rtf " " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ReadMe.rtf "
2006-04-17 07:58:19 +00:00
sudo chown -R 501:admin " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ReadMe.rtf "
2006-06-20 11:25:23 +00:00
sudo chmod -R 644 " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ReadMe.rtf "
2008-09-04 00:26:23 +00:00
2007-06-09 11:42:26 +00:00
cp -fp "COPYING" " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras "
sudo chown -R 501:admin " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/COPYING "
sudo chmod -R 644 " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/COPYING "
2008-09-04 00:26:23 +00:00
cp -fp "COPYING.LESSER" " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras "
sudo chown -R 501:admin " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/COPYING.LESSER "
sudo chmod -R 644 " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/COPYING.LESSER "
2007-06-09 11:42:26 +00:00
cp -fp "COPYRIGHT" " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/ "
sudo chown -R 501:admin " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/COPYRIGHT "
sudo chmod -R 644 " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/COPYRIGHT "
2006-01-21 12:42:04 +00:00
2007-06-06 11:42:51 +00:00
# Copy & rename the Uninstall application's bundle and rename its executable inside the bundle
2007-06-09 11:42:26 +00:00
sudo cp -fpR " $BUILDPATH /Uninstall BOINC.app " " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/Uninstall ${ BRAND_NAME } .app "
sudo mv -f " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/Uninstall ${ BRAND_NAME } .app/Contents/MacOS/Uninstall BOINC " " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/Uninstall ${ BRAND_NAME } .app/Contents/MacOS/Uninstall ${ BRAND_NAME } "
2007-06-06 11:42:51 +00:00
# Update Uninstall application's info.plist, InfoPlist.strings files
2007-06-09 11:42:26 +00:00
sudo sed -i "" s/BOINC/" ${ BRAND_NAME } " /g " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/Uninstall ${ BRAND_NAME } .app/Contents/Info.plist "
sudo sed -i "" s/MacUninstaller.icns/" ${ UNINSTALLER_ICNS_FILE } " /g " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/Uninstall ${ BRAND_NAME } .app/Contents/Info.plist "
#### sed -i "" s/BOINC/"${BRAND_NAME}"/g "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/extras/Uninstall ${BRAND_NAME}.app/Contents/Resources/English.lproj/InfoPlist.strings"
2007-06-08 11:16:48 +00:00
# Replace the Uninstall application's MacUninstaller.icns file
2007-06-09 11:42:26 +00:00
sudo cp -fp " clientgui/res/ ${ UNINSTALLER_ICNS_FILE } " " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/Uninstall ${ BRAND_NAME } .app/Contents/Resources/ ${ UNINSTALLER_ICNS_FILE } "
sudo rm -f " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/Uninstall ${ BRAND_NAME } .app/Contents/Resources/MacUninstaller.icns "
2007-09-06 01:40:05 +00:00
# Remove the Uninstall application's resource file so it will show generic "Are you sure?" dialog
sudo rm -f " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/Uninstall ${ BRAND_NAME } .app/Contents/Resources/Uninstall BOINC.rsrc "
2007-06-08 11:16:48 +00:00
2007-06-09 11:42:26 +00:00
sudo chown -R root:admin " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/Uninstall ${ BRAND_NAME } .app "
sudo chmod -R 555 " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/extras/Uninstall ${ BRAND_NAME } .app "
2007-06-06 11:42:51 +00:00
2006-04-17 07:58:19 +00:00
##### We've decided not to create branded command-line executables; they are identical to standard ones
#### mkdir -p "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin"
#### cp -fpR $BUILDPATH/boinc "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin/"
2008-05-01 09:25:51 +00:00
#### cp -fpR $BUILDPATH/boinccmd "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin/"
2006-08-29 05:59:38 +00:00
#### cp -fpR curl/ca-bundle.crt "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin/"
2006-04-17 07:58:19 +00:00
#### sudo chown -R root:admin "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin"/*
2006-08-29 05:59:38 +00:00
#### sudo chmod -R u+rw-s,g+r-ws,o+r-w "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin"/*
2006-01-21 12:42:04 +00:00
2006-04-17 07:58:19 +00:00
##### We've decided not to create branded symbol table file; it is identical to standard one
#### mkdir -p "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_SymbolTables"
2008-03-19 11:33:19 +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
2006-04-17 07:58:19 +00:00
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-06-27 12:56:11 +00:00
# Copy the installer wrapper application "${BRAND_NAME} Installer.app"
2006-06-28 08:12:16 +00:00
cp -fpR " $BUILDPATH /BOINC Installer.app " " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ ${ BRAND_NAME } Installer.app "
2007-06-08 11:16:48 +00:00
# Update the installer wrapper application's info.plist, InfoPlist.strings files
sed -i "" s/BOINC/" ${ BRAND_NAME } " /g " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ ${ BRAND_NAME } Installer.app/Contents/Info.plist "
sed -i "" s/MacInstaller.icns/" ${ INSTALLER_ICNS_FILE } " /g " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ ${ BRAND_NAME } Installer.app/Contents/Info.plist "
## sed -i "" s/BOINC/"${BRAND_NAME}"/g "${NEW_DIR_PATH}/${LC_BRAND_NAME}_$1.$2.$3_macOSX_universal/${BRAND_NAME} Installer.app/Contents/Resources/English.lproj/InfoPlist.strings"
# Replace the installer wrapper application's MacInstaller.icns file
cp -fp " clientgui/res/ ${ INSTALLER_ICNS_FILE } " " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ ${ BRAND_NAME } Installer.app/Contents/Resources/ ${ INSTALLER_ICNS_FILE } "
rm -f " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ ${ BRAND_NAME } Installer.app/Contents/Resources/MacInstaller.icns "
# Rename the installer wrapper application's executable inside the bundle
mv -f " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ ${ BRAND_NAME } Installer.app/Contents/MacOS/BOINC Installer " " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ ${ BRAND_NAME } Installer.app/Contents/MacOS/ ${ BRAND_NAME } Installer "
2007-10-31 10:40:19 +00:00
DarwinVersion = ` uname -r` ;
DarwinMajorVersion = ` echo $DarwinVersion | sed 's/\([0-9]*\)[.].*/\1/' ` ;
# DarwinMinorVersion=`echo $version | sed 's/[0-9]*[.]\([0-9]*\).*/\1/' `;
#
# echo "major = $DarwinMajorVersion"
# echo "minor = $DarwinMinorVersion"
#
# Darwin version 9.x.y corresponds to OS 10.5.x
# Darwin version 8.x.y corresponds to OS 10.4.x
# Darwin version 7.x.y corresponds to OS 10.3.x
# Darwin version 6.x corresponds to OS 10.2.x
2006-06-27 12:56:11 +00:00
# Build the installer package inside the wrapper application's bundle
2007-10-31 10:40:19 +00:00
if [ " $DarwinMajorVersion " = "9" ] ; then
# OS 10.5 packagemaker
/Developer/usr/bin/packagemaker -r " ${ PR_PATH } " -e " ${ IR_PATH } " -s " ${ SCRIPTS_PATH } " -f " ${ NEW_DIR_PATH } /Pkg-Info.plist " -t " ${ MANAGER_NAME } " -n " $1 . $2 . $3 " -b -o " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ ${ BRAND_NAME } Installer.app/Contents/Resources/ ${ BRAND_NAME } .pkg "
# Remove TokenDefinitions.plist which, along with IFPkgPathMappings in Info.plist, would cause installer to find a previous copy of BOINCManager and install there
sudo rm -f " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ ${ BRAND_NAME } Installer.app/Contents/Resources/ ${ BRAND_NAME } .pkg/Contents/Resources/TokenDefinitions.plist "
2007-11-08 12:05:56 +00:00
defaults delete " $PWD / ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ ${ BRAND_NAME } Installer.app/Contents/Resources/ ${ BRAND_NAME } .pkg/Contents/Info " IFPkgPathMappings
2007-10-31 10:40:19 +00:00
else
# OS 10.4 packagemaker
/Developer/Tools/packagemaker -build -p " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ ${ BRAND_NAME } Installer.app/Contents/Resources/ ${ BRAND_NAME } .pkg " -f " ${ PR_PATH } " -r " ${ IR_PATH } " -i " ${ NEW_DIR_PATH } /Pkg-Info.plist " -d " ${ NEW_DIR_PATH } /Description.plist " -ds
fi
2006-06-27 12:56:11 +00:00
# Allow the installer wrapper application to modify the package's Info.plist file
sudo chmod u+w,g+w,o+w " ${ NEW_DIR_PATH } / ${ LC_BRAND_NAME } _ $1 . $2 . $3 _macOSX_universal/ ${ BRAND_NAME } Installer.app/Contents/Resources/ ${ BRAND_NAME } .pkg/Contents/Info.plist "
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-25 09:16:32 +00:00
zip -rqy ${ LC_BRAND_NAME } _$1 .$2 .$3 _macOSX_universal.zip ${ LC_BRAND_NAME } _$1 .$2 .$3 _macOSX_universal
2006-04-17 07:58:19 +00:00
##### We've decided not to create branded command-line executables; they are identical to standard ones
#### zip -rqy ${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin.zip ${LC_BRAND_NAME}_$1.$2.$3_universal-apple-darwin
##### We've decided not to create branded symbol table file; it is identical to standard one
#### zip -rqy ${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
2007-06-08 11:16:48 +00:00
# Force Finder to recognize changed icons by deleting the uncompressed products and expanding the zip file
sudo rm -dfR ${ LC_BRAND_NAME } _$1 .$2 .$3 _macOSX_universal
open ${ LC_BRAND_NAME } _$1 .$2 .$3 _macOSX_universal.zip
2006-01-21 12:42:04 +00:00
popd
return 0