Chris@34: #!/bin/bash Chris@34: Chris@34: set -e Chris@34: Chris@34: # Execute this from the top-level directory of the project (the one Chris@34: # that contains the .app bundle). Supply the name of the application Chris@34: # as argument. Chris@34: # Chris@34: # This now performs *only* the app deployment step - copying in Chris@34: # libraries and setting up paths etc. It does not create a Chris@34: # package. Use deploy-and-package.sh for that. Chris@34: Chris@34: app="$1" Chris@34: source="$app.app" Chris@34: Chris@34: if [ -z "$app" ] || [ ! -d "$source" ] || [ -n "$2" ]; then Chris@34: echo "Usage: $0 " Chris@34: echo " e.g. $0 MyApplication" Chris@34: echo " The app bundle must exist in ./.app." Chris@34: echo " Version number will be extracted from version.h." Chris@34: exit 2 Chris@34: fi Chris@34: Chris@34: set -u Chris@34: Chris@34: version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h` Chris@34: stem=${version%%-*} Chris@34: stem=${stem%%pre*} Chris@34: case "$stem" in Chris@34: [0-9].[0-9]) bundleVersion="$stem".0 ;; Chris@34: [0-9].[0-9].[0-9]) bundleVersion="$stem" ;; Chris@34: *) echo "Error: Version stem $stem (of version $version) is neither two- nor three-part number" ;; Chris@34: esac Chris@34: Chris@34: echo Chris@34: echo "Copying in frameworks and plugins from Qt installation directory." Chris@34: Chris@34: deploy/osx/copy-qt.sh "$app" || exit 2 Chris@34: Chris@34: echo Chris@34: echo "Fixing up paths." Chris@34: Chris@34: deploy/osx/paths.sh "$app" Chris@34: Chris@34: echo Chris@34: echo "Copying in qt.conf to set local-only plugin paths." Chris@34: echo "Make sure all necessary Qt plugins are in $source/Contents/plugins/*" Chris@34: echo "You probably want platforms/, accessible/ and imageformats/ subdirectories." Chris@34: cp deploy/osx/qt.conf "$source"/Contents/Resources/qt.conf Chris@34: Chris@34: echo Chris@34: echo "Writing version $bundleVersion in to bundle." Chris@34: echo "(This should be a three-part number: major.minor.point)" Chris@34: Chris@34: perl -p -e "s/PACK_VERSION/$bundleVersion/" deploy/osx/Info.plist \ Chris@34: > "$source"/Contents/Info.plist Chris@34: Chris@34: echo "Done: check $source/Contents/Info.plist for sanity please"