Updated install_name_tool script to fit version 2.0.104

This commit is contained in:
Micke Prag 2011-03-04 17:18:40 +00:00
parent 8576b4e1d7
commit ac04adc3a4

View file

@ -1,7 +1,7 @@
#!/bin/bash
PLUGINS="Devices SystrayIcon TelldusCorePlugin"
VERSION="2.0.2"
PLUGINS="Devices SystrayIcon TelldusCorePlugin TelldusLive"
VERSION="2.0.104"
copy_framework() {
echo "Copy framework $1"
@ -9,10 +9,6 @@ copy_framework() {
cp -R /Library/Frameworks/$1.framework/ TelldusCenter.app/Contents/Frameworks/$1.framework/
}
copy_plugin_translations() {
cp Plugins/script/$1/*.qm TelldusCenter.app/Contents/Plugins/script/$1/
}
strip_qt_development_files() {
# Strip development-files
rm -r ${2}/${1}_debug.dSYM
@ -30,10 +26,6 @@ change_telldus_core() {
}
if [ ! -d /Library/Frameworks/TelldusCore.framework/Versions/Current/Frameworks ]; then
mkdir /Library/Frameworks/TelldusCore.framework/Versions/Current/Frameworks
fi
if [ ! -d /Library/Frameworks/TelldusCore.framework/Versions/Current/Libraries ]; then
mkdir /Library/Frameworks/TelldusCore.framework/Versions/Current/Libraries
fi
@ -41,33 +33,32 @@ if [ ! -d TelldusCenter.app/Contents/Frameworks ]; then
mkdir TelldusCenter.app/Contents/Frameworks
fi
### QtCore ###
if [ ! -d /Library/Frameworks/TelldusCore.framework/Versions/Current/Frameworks/QtCore.framework ]; then
echo "Copy framework QtCore"
cp -R /Library/Frameworks/QtCore.framework /Library/Frameworks/TelldusCore.framework/Versions/Current/Frameworks/
install_name_tool -id "/Library/Frameworks/TelldusCore.framework/Versions/${VERSION}/Frameworks/QtCore.framework/Versions/4.0/QtCore" /Library/Frameworks/TelldusCore.framework/Versions/Current/Frameworks/QtCore.framework/Versions/4.0/QtCore
strip_qt_development_files QtCore /Library/Frameworks/TelldusCore.framework/Versions/Current/Frameworks/QtCore.framework
fi
### TelldusCore ###
echo "Fixing TelldusCore"
if [ ! -f /Library/Frameworks/TelldusCore.framework/Versions/Current/Libraries/libftd2xx.0.1.4.dylib ]; then
echo "Copy libftd2xx.0.1.4.dylib"
cp /usr/local/lib/libftd2xx.0.1.4.dylib /Library/Frameworks/TelldusCore.framework/Versions/Current/Libraries/
install_name_tool -id "/Library/Frameworks/TelldusCore.framework/Versions/${VERSION}/Libraries/libftd2xx.0.1.4.dylib" /Library/Frameworks/TelldusCore.framework/Versions/Current/Libraries/libftd2xx.0.1.4.dylib
FTD2XX_VERSION="1.0.2"
if [ ! -f /Library/Frameworks/TelldusCore.framework/Versions/Current/Libraries/libftd2xx.${FTD2XX_VERSION}.dylib ]; then
echo "Copy libftd2xx.${FTD2XX_VERSION}.dylib"
cp /usr/local/lib/libftd2xx.${FTD2XX_VERSION}.dylib /Library/Frameworks/TelldusCore.framework/Versions/Current/Libraries/
install_name_tool -id "/Library/Frameworks/TelldusCore.framework/Versions/${VERSION}/Libraries/libftd2xx.${FTD2XX_VERSION}.dylib" /Library/Frameworks/TelldusCore.framework/Versions/Current/Libraries/libftd2xx.${FTD2XX_VERSION}.dylib
fi
install_name_tool -id /Library/Frameworks/TelldusCore.framework/TelldusCore /Library/Frameworks/TelldusCore.framework/TelldusCore
install_name_tool -change QtCore.framework/Versions/4/QtCore "/Library/Frameworks/TelldusCore.framework/Versions/${VERSION}/Frameworks/QtCore.framework/Versions/4.0/QtCore" /Library/Frameworks/TelldusCore.framework/TelldusCore
install_name_tool -change /usr/local/lib/libftd2xx.0.1.4.dylib "/Library/Frameworks/TelldusCore.framework/Versions/${VERSION}/Libraries/libftd2xx.0.1.4.dylib" /Library/Frameworks/TelldusCore.framework/TelldusCore
install_name_tool -change /usr/local/lib/libftd2xx.${FTD2XX_VERSION}.dylib "/Library/Frameworks/TelldusCore.framework/Versions/${VERSION}/Libraries/libftd2xx.${FTD2XX_VERSION}.dylib" /Library/Frameworks/TelldusCore.framework/TelldusCore
### QtCore ###
if [ ! -d TelldusCenter.app/Contents/Frameworks/QtCore.framework ]; then
FRAMEWORK="TelldusCenter.app/Contents/Frameworks/QtCore.framework/QtCore"
copy_framework QtCore
strip_qt_development_files QtCore TelldusCenter.app/Contents/Frameworks/QtCore.framework
install_name_tool -id @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore ${FRAMEWORK}
fi
### QtGui ###
if [ ! -d TelldusCenter.app/Contents/Frameworks/QtGui.framework ]; then
FRAMEWORK="TelldusCenter.app/Contents/Frameworks/QtGui.framework/QtGui"
copy_framework QtGui
strip_qt_development_files QtGui TelldusCenter.app/Contents/Frameworks/QtGui.framework
install_name_tool -id @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui ${FRAMEWORK}
install_name_tool -change QtCore.framework/Versions/4/QtCore "/Library/Frameworks/TelldusCore.framework/Versions/${VERSION}/Frameworks/QtCore.framework/Versions/4/QtCore" ${FRAMEWORK}
install_name_tool -id @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui ${FRAMEWORK}
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore ${FRAMEWORK}
fi
### QtNetwork ###
@ -75,8 +66,8 @@ if [ ! -d TelldusCenter.app/Contents/Frameworks/QtNetwork.framework ]; then
FRAMEWORK="TelldusCenter.app/Contents/Frameworks/QtNetwork.framework/QtNetwork"
copy_framework QtNetwork
strip_qt_development_files QtNetwork TelldusCenter.app/Contents/Frameworks/QtNetwork.framework
install_name_tool -id @executable_path/../Frameworks/QtNetwork.framework/Versions/4.0/QtNetwork ${FRAMEWORK}
install_name_tool -change QtCore.framework/Versions/4/QtCore "/Library/Frameworks/TelldusCore.framework/Versions/${VERSION}/Frameworks/QtCore.framework/Versions/4/QtCore" ${FRAMEWORK}
install_name_tool -id @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork ${FRAMEWORK}
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore ${FRAMEWORK}
fi
### QtScript ###
@ -84,61 +75,43 @@ if [ ! -d TelldusCenter.app/Contents/Frameworks/QtScript.framework ]; then
FRAMEWORK="TelldusCenter.app/Contents/Frameworks/QtScript.framework/QtScript"
copy_framework QtScript
strip_qt_development_files QtScript TelldusCenter.app/Contents/Frameworks/QtScript.framework
install_name_tool -id @executable_path/../Frameworks/QtScript.framework/Versions/4.0/QtScript ${FRAMEWORK}
install_name_tool -change QtCore.framework/Versions/4/QtCore "/Library/Frameworks/TelldusCore.framework/Versions/${VERSION}/Frameworks/QtCore.framework/Versions/4/QtCore" ${FRAMEWORK}
install_name_tool -id @executable_path/../Frameworks/QtScript.framework/Versions/4/QtScript ${FRAMEWORK}
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore ${FRAMEWORK}
fi
### TelldusGui ###
if [ -L TelldusCenter.app/Contents/Frameworks/TelldusGui.framework ]; then
echo "Framework TelldusGui is a symlink, removing"
rm TelldusCenter.app/Contents/Frameworks/TelldusGui.framework
fi
if [ ! -d TelldusCenter.app/Contents/Frameworks/TelldusGui.framework ]; then
FRAMEWORK="TelldusCenter.app/Contents/Frameworks/TelldusGui.framework/TelldusGui"
copy_framework TelldusGui
install_name_tool -id @executable_path/../Frameworks/TelldusGui.framework/Versions/2/TelldusGui ${FRAMEWORK}
install_name_tool -change QtCore.framework/Versions/4/QtCore "/Library/Frameworks/TelldusCore.framework/Versions/${VERSION}/Frameworks/QtCore.framework/Versions/4.0/QtCore" ${FRAMEWORK}
install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui ${FRAMEWORK}
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore ${FRAMEWORK}
install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui ${FRAMEWORK}
fi
### TelldusCenter ###
echo "Fixing TelldusCenter"
install_name_tool -change QtCore.framework/Versions/4/QtCore "/Library/Frameworks/TelldusCore.framework/Versions/${VERSION}/Frameworks/QtCore.framework/Versions/4.0/QtCore" TelldusCenter.app/Contents/MacOS/TelldusCenter
install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui TelldusCenter.app/Contents/MacOS/TelldusCenter
install_name_tool -change QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4.0/QtNetwork TelldusCenter.app/Contents/MacOS/TelldusCenter
install_name_tool -change QtScript.framework/Versions/4/QtScript @executable_path/../Frameworks/QtScript.framework/Versions/4.0/QtScript TelldusCenter.app/Contents/MacOS/TelldusCenter
if [ -L TelldusCenter.app/Contents/Plugins/script/com ]; then
echo "Scripts is a symlink, export from subversion"
rm TelldusCenter.app/Contents/Plugins/script/com
svn export http://svn.telldus.com/svn/tellstick/branches/2.0/telldus-gui/TelldusCenter/Plugins/script/com TelldusCenter.app/Contents/Plugins/script/com
fi
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore TelldusCenter.app/Contents/MacOS/TelldusCenter
install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui TelldusCenter.app/Contents/MacOS/TelldusCenter
install_name_tool -change QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork TelldusCenter.app/Contents/MacOS/TelldusCenter
install_name_tool -change QtScript.framework/Versions/4/QtScript @executable_path/../Frameworks/QtScript.framework/Versions/4/QtScript TelldusCenter.app/Contents/MacOS/TelldusCenter
### Plugins ###
for plugin in $PLUGINS; do
PLUGIN_PATH="TelldusCenter.app/Contents/Plugins/script/lib${plugin}.dylib"
PLUGIN_PATH="TelldusCenter.app/Contents/Plugins/script/${plugin}.dylib"
echo "Fixing plugin ${plugin}"
install_name_tool -id lib${plugin}.dylib $PLUGIN_PATH
install_name_tool -change QtCore.framework/Versions/4/QtCore "/Library/Frameworks/TelldusCore.framework/Versions/${VERSION}/Frameworks/QtCore.framework/Versions/4.0/QtCore" $PLUGIN_PATH
install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui $PLUGIN_PATH
install_name_tool -change QtScript.framework/Versions/4/QtScript @executable_path/../Frameworks/QtScript.framework/Versions/4.0/QtScript $PLUGIN_PATH
install_name_tool -id ${plugin}.dylib $PLUGIN_PATH
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore $PLUGIN_PATH
install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui $PLUGIN_PATH
install_name_tool -change QtScript.framework/Versions/4/QtScript @executable_path/../Frameworks/QtScript.framework/Versions/4/QtScript $PLUGIN_PATH
install_name_tool -change QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork $PLUGIN_PATH
change_telldus_core $PLUGIN_PATH
TPATH=`otool -L $PLUGIN_PATH | grep "/TelldusGui " | cut -f2 | cut -d ' ' -f1`
if [ "$TPATH" != "" ]; then
echo " Plugin ${plugin} is linked to TelldusGui"
install_name_tool -change $TPATH @executable_path/../Frameworks/TelldusGui.framework/Versions/2/TelldusGui $PLUGIN_PATH
install_name_tool -change $TPATH @executable_path/../Frameworks/TelldusGui.framework/TelldusGui $PLUGIN_PATH
fi
done
### I18N ###
echo "Copy translation files"
copy_plugin_translations com/telldus/gui
copy_plugin_translations com/telldus/systray
echo "Fixing tdtool"
change_telldus_core /usr/local/bin/tdtool
install_name_tool -change QtCore.framework/Versions/4/QtCore "/Library/Frameworks/TelldusCore.framework/Versions/${VERSION}/Frameworks/QtCore.framework/Versions/4/QtCore" /usr/local/bin/tdtool
install_name_tool -change /usr/local/lib/libftd2xx.0.1.4.dylib "/Library/Frameworks/TelldusCore.framework/Versions/${VERSION}/Libraries/libftd2xx.0.1.4.dylib" /usr/local/bin/tdtool