Fix and bulletproof osx packaging script; cleanup some obsolete .gitignore entries

This commit is contained in:
Paul Chote
2010-09-25 13:44:59 +12:00
committed by Chris Forbes
parent d6dd392028
commit c790db8e84
15 changed files with 41 additions and 76 deletions

39
packaging/osx/buildpackage.sh Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/bash
# Files to include in the package
# Specified relative to the build-dir (argument $1)
FILES="OpenRA.Game.exe OpenRA.Gl.dll OpenRA.FileFormats.dll FreeSans.ttf FreeSansBold.ttf titles.ttf shaders mods/ra mods/cnc VERSION"
# Files that match the above patterns, that should be excluded
EXCLUDE="*.mdb"
if [ $# -ne "2" ]; then
echo "Usage: `basename $0` build-dir version"
exit 1
fi
# Dirty build dir; last build failed?
if [ -e "OpenRA.app" ]; then
echo "Error: OpenRA.app already exists"
exit 2
fi
# Copy the template to build the game package
# Assumes it is layed out with the correct directory structure
cp -rv template.app OpenRA.app
for i in $FILES; do
cp -Rv "$1$i" "OpenRA.app/Contents/Resources/$i" || exit 3
done
# Delete excluded files
pushd "OpenRA.app/Contents/Resources/" &> /dev/null
for i in $EXCLUDE; do
find . -path "$i" -delete
done
popd &> /dev/null
# Package app bundle into a zip
zip OpenRA-$2 -r -9 OpenRA.app
rm -rf OpenRA.app
echo "Done!"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

View File

@@ -1,31 +0,0 @@
#!/bin/sh
# OpenRA Packaging script for osx
# Packages game files into the launcher app
# previously created by the package-launcher script
PACKAGING_PATH="$1/osxbuild"
SOURCE_PATH="$1"
BUNDLE_PATH="OpenRA.app"
TARGET_PATH="$PACKAGING_PATH/OpenRA.app/Contents/Resources"
FILES="OpenRA.Game.exe OpenRA.Gl.dll OpenRA.FileFormats.dll FreeSans.ttf FreeSansBold.ttf titles.ttf shaders mods/ra mods/cnc VERSION"
EXCLUDE="*.mdb"
# Copy source files into packaging dir
mkdir -p $PACKAGING_PATH
cp -r "$BUNDLE_PATH" "$PACKAGING_PATH/OpenRA.app"
mkdir -p "$TARGET_PATH/mods"
for i in $FILES; do
cp -R "$SOURCE_PATH/$i" "$TARGET_PATH/$i"
done
# Delete unwanted files
cd $TARGET_PATH
for i in $EXCLUDE; do
find . -path "$i" -delete
done
cd $PACKAGING_PATH
zip OpenRA-$2 -r -9 OpenRA.app
echo "Done!"

View File

@@ -1,32 +0,0 @@
#!/bin/sh
# OpenRA Packaging script for osx
# Packages game files into the launcher app
# previously created by the package-launcher script
PWD=`pwd`
PACKAGING_PATH="$PWD/osxbuild"
SOURCE_PATH="$PWD/."
BUNDLE_PATH="$SOURCE_PATH/packaging/osx/OpenRA.app"
TARGET_PATH="$PACKAGING_PATH/OpenRA.app/Contents/Resources"
FILES="OpenRA.Game.exe OpenRA.Gl.dll OpenRA.FileFormats.dll FreeSans.ttf FreeSansBold.ttf titles.ttf shaders mods/ra mods/cnc VERSION"
EXCLUDE="*.mdb ./mods/cnc/packages/*.mix ./mods/ra/packages/*.mix ./mods/cnc/packages/*.MIX ./mods/ra/packages/*.MIX"
# Copy source files into packaging dir
mkdir -p $PACKAGING_PATH
cp -r "$BUNDLE_PATH" "$PACKAGING_PATH/OpenRA.app"
mkdir -p "$TARGET_PATH/mods"
for i in $FILES; do
cp -R "$i" "$TARGET_PATH/$i"
done
# Delete unwanted files
cd $TARGET_PATH
for i in $EXCLUDE; do
find . -path "$i" -delete
done
cd $PACKAGING_PATH
zip OpenRA -r -9 OpenRA.app
echo "Done!"