Begin rework of packaging scripts. Restructure packaging system, and make osx and debian packages work.

Changed semantics:
- package upload is handled by a separate script
- dropped syntax highlighting (unnecessary, and had concurrency issues)
- `make install' is no longer used in the packaging process
- debian package changelog points to the forum, instead of showing out of date info
- debian package ships tao dlls in the game root, and doesn't insert them in the gac
- debian package refers users to the website for help manually installing packages
This commit is contained in:
Paul Chote
2010-10-08 21:37:47 +13:00
parent 493631cd90
commit f1b68a5207
11 changed files with 180 additions and 235 deletions

View File

@@ -0,0 +1,67 @@
#!/bin/bash
# OpenRA packaging master script for linux packages
if [ $# -ne "3" ]; then
echo "Usage: `basename $0` version files-dir outputdir"
exit 1
fi
VERSION=$1
BUILTDIR=$2
PACKAGEDIR=$3
# Game files
mkdir -p root/usr/bin/
cp openra root/usr/bin/
mkdir -p root/usr/share/openra/
cp -R "$BUILTDIR/" "root/usr/share/openra/" || exit 3
# Desktop Icons
mkdir -p root/usr/share/applications/
sed "s/{VERSION}/$VERSION/" openra-ra.desktop > root/usr/share/applications/openra-ra.desktop
sed "s/{VERSION}/$VERSION/" openra-cnc.desktop > root/usr/share/applications/openra-cnc.desktop
# Menu entries
mkdir -p root/usr/share/menu/
cp openra-ra root/usr/share/menu/
cp openra-cnc root/usr/share/menu/
# Icon images
mkdir -p root/usr/share/pixmaps/
cp openra.32.xpm root/usr/share/pixmaps/
mkdir -p root/usr/share/icons/
cp -r hicolor root/usr/share/icons/
(
echo "Building Debian package."
cd deb
./buildpackage.sh "$VERSION" ../root "$PACKAGEDIR" &> package.log
if [ $? -ne 0 ]; then
echo "Debian package build failed, refer to $PWD/package.log."
fi
) &
# (
# echo "Building Arch-Linux package."
# pushd pkgbuild/ &> /dev/null
# sh buildpackage.sh "$VERSION" "$PACKAGEDIR" &> package.log
# if [ $? -ne 0 ]; then
# echo "Arch-Linux package build failed, refer to $PWD/package.log."
# fi
# popd &> /dev/null
# ) &
#
# (
# echo "Building RPM package."
# pushd rpm/ &> /dev/null
# sh buildpackage.sh "$VERSION" ~/rpmbuild "$PACKAGEDIR" &> package.log
# if [ $? -ne 0 ]; then
# echo "RPM package build failed, refer to $PWD/package.log."
# fi
# popd &> /dev/null
# ) &
#
wait
# Clean up
rm -rf root

View File

@@ -1,16 +1,3 @@
openra (20100914) unstable; urgency=low openra ({VERSION}) unstable; urgency=low
* Changed MiG prerequisites to AFLD+STEK * The changelog is available at http://www.sleipnirstuff.com/forum/viewtopic.php?f=81&t=14844
* Removed KENN, build DOG directly from BARR now
* Chronotank can only teleport when fully charged
* Improved OpenGL error logging
* Fixed targeting of FIX
* Fixed crash when an engineer is trying to repair a building, but it dies/gets sold/etc.
* Added muzzle flashes to Yak and Hind chainguns * Fixed bounding boxes on some units
* Fixed accuracy of Tesla weapons
* Changed ownership of GUN and GTWR in CNC to both
* Fixed crash on destroying things that have a building reserved
* If ordered to move to an unpathable cell, move somewhere nearby that is pathable instead
* Fixed RPM linux package
-- Maikel van den Hout <ma1kelvdh@gmail.com> Thu, 09 Sep 2010 16:34:03 +0200

View File

@@ -1,14 +1,15 @@
Package: openra Package: openra
Version: 20100914 Version: {VERSION}
Architecture: all Architecture: all
Maintainer: Matthew Bowra-Dean <matthew@ijw.co.nz> Maintainer: Matthew Bowra-Dean <matthew@ijw.co.nz>
Uploaders: Maikel van den Hout <ma1kelvdh@gmail.com> Uploaders: Maikel van den Hout <ma1kelvdh@gmail.com>
Installed-Size: 8306 Installed-Size: {SIZE}
Depends: nvidia-cg-toolkit (>= 2.1), libopenal1, mono-runtime, libmono-winforms2.0-cil, libfreetype6, libsdl1.2debian, libgl1-mesa-glx, libgl1-mesa-dri, zenity, wget, unzip Depends: nvidia-cg-toolkit (>= 2.1), libopenal1, mono-runtime, libmono-winforms2.0-cil, libfreetype6, libsdl1.2debian, libgl1-mesa-glx, libgl1-mesa-dri, zenity, wget, unzip
Section: games Section: games
Priority: extra Priority: extra
Homepage: http://www.open-ra.org/ Homepage: http://www.open-ra.org/
Description: A multiplayer reimplementation of the Command & Conquer: Red Alert game engine in .NET/Mono, OpenGL, OpenAL and SDL. Has extensive modding support and includes Command & Conquer as an official mod. Description: A multiplayer reimplementation of the Command & Conquer: Red Alert game engine in .NET/Mono, OpenGL, OpenAL and SDL. Has extensive modding support and includes Command & Conquer as an official mod.
. .
Please note: OpenRA is currently at an alpha release stage. If you have any problems, please report them to the IRC channel (#openra on Please note: OpenRA is currently at an alpha release stage. Releases may be buggy
irc.freenode.net) or the bug-tracker (http://red-bull.ijw.co.nz:3690/OpenRA). or unstable. If you have any problems, please report them to the IRC channel (#openra on
irc.freenode.net) or the bug-tracker (http://bugs.open-ra.org).

View File

@@ -13,8 +13,7 @@ anw=`zenity --question --text "Download and install RA packages?"; echo $?`
if [ $anw = 0 ] ; then if [ $anw = 0 ] ; then
mono OpenRA.Utility.exe --download-packages=ra mono OpenRA.Utility.exe --download-packages=ra
else else
zenity --info --text "The RA packages will need to be manually extracted from http://open-ra.org/get-dependency.php?file=ra-packages \ zenity --info --text "The Red Alert packages need to be manually installed before it will work.\nSee the OpenRA website for more information."
to /usr/share/openra/mods/ra/packages before the RA mod will work."
break break
fi fi
@@ -23,15 +22,6 @@ anw=`zenity --question --text "Download and install C&amp;C packages?"; echo $?`
if [ $anw = 0 ] ; then if [ $anw = 0 ] ; then
mono OpenRA.Utility.exe --download-packages=cnc mono OpenRA.Utility.exe --download-packages=cnc
else else
zenity --info --text "The C&amp;C packages will need to be manually extracted from http://open-ra.org/get-dependency.php?file=cnc-packages \ zenity --info --text "The C&amp;C packages need to be manually installed before it will work.\nSee the OpenRA website for more information."
to /usr/share/openra/mods/cnc/packages before the C&amp;C mod will work."
break break
fi fi
gacutil -i thirdparty/Tao/Tao.Cg.dll
gacutil -i thirdparty/Tao/Tao.FreeType.dll
gacutil -i thirdparty/Tao/Tao.OpenAl.dll
gacutil -i thirdparty/Tao/Tao.OpenGl.dll
gacutil -i thirdparty/Tao/Tao.Sdl.dll
cd $start_directory

View File

@@ -1,57 +1,34 @@
#!/bin/bash #!/bin/bash
ARGS=7 # OpenRA packaging script for Mac OSX
E_BADARGS=85 E_BADARGS=85
if [ $# -ne "3" ]
if [ $# -ne "$ARGS" ]
then then
echo "Usage: `basename $0` ftp-server ftp-path username password version src-dir temp-packaging-dir" echo "Usage: `basename $0` version root-dir outputdir"
exit $E_BADARGS exit $E_BADARGS
fi fi
VERSION=$1
PKGVERSION=`echo $5 | sed "s/-/\\./g"` # HACK: bsd du doesn't like --apparant-size; remember to add back when running on debian
PACKAGE_SIZE=`du -c $2/usr | grep "total" | awk '{print $1}'`
# Delete lines and insert updated ones for version
sed -i '2,2 d' DEBIAN/control
sed -i "2,2 i\Version: $PKGVERSION" DEBIAN/control
sed -i '1,1 d' DEBIAN/changelog
sed -i "1,1 i\openra ($PKGVERSION) unstable; urgency=low" DEBIAN/changelog
# Get the size needed for the Installed-Size line and change it
sed -i '6,6 d' DEBIAN/control
PACKAGE_SIZE=`du --apparent-size -c $6/usr | grep total | sed 's/[a-z]//g' | sed 's/\ //g'`
sed -i "6,6 i\Installed-Size: $PACKAGE_SIZE" DEBIAN/control
# Copy our two needed folders to a clean package directory (yes, this is needed) # Copy our two needed folders to a clean package directory (yes, this is needed)
mkdir $7 mkdir root
cp -R DEBIAN $7 cp -R DEBIAN root
cp -R $6/usr $7 cp -R $2/usr root
# Build it in the package directory, but place the finished deb in our starting directory # Create the control and changelog files from templates
BUILD_DIR=$( pwd ) sed "s/{VERSION}/$VERSION/" DEBIAN/control | sed "s/{SIZE}/$PACKAGE_SIZE/" > root/DEBIAN/control
pushd $7 sed "s/{VERSION}/$VERSION/" DEBIAN/changelog > root/DEBIAN/changelog
# Build it in the temp directory, but place the finished deb in our starting directory
pushd root
# Calculate md5sums and clean up the /usr/ part of them # Calculate md5sums and clean up the /usr/ part of them
md5sum `find . -type f | grep -v '^[.]/DEBIAN/'` >DEBIAN/md5sums md5sum `find . -type f | grep -v '^[.]/DEBIAN/'` | sed 's/\.\/usr\//usr\//g' > DEBIAN/md5sums
sed -i 's/\.\/usr\//usr\//g' DEBIAN/md5sums
# Start building, the file should appear in directory the script was executed in # Start building, the file should appear in the output directory
dpkg-deb -b . $BUILD_DIR/openra-$PKGVERSION.deb dpkg-deb -b . $3/openra-$VERSION.deb
# Get back to begin directory
# Clean up
popd popd
rm -rf root
# Get package file and dump it on ftp
PACKAGEFILE=openra-$PKGVERSION.deb
size=`stat -c "%s" $PACKAGEFILE`
echo "$5,$size,$PACKAGEFILE" > /tmp/deblatest.txt
wput $PACKAGEFILE "ftp://$3:$4@$1/$2/"
cd /tmp
wput -u deblatest.txt "ftp://$3:$4@$1/$2/"
# remove temp-packaging-dir
rm -rf $7

View File

@@ -1,6 +1,6 @@
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Version=20100907-1 Version={VERSION}
Name=OpenRA - Command & Conquer Name=OpenRA - Command & Conquer
Comment=The OpenRA RTS engine running Command & Conquer Comment=The OpenRA RTS engine running Command & Conquer
Icon=openra Icon=openra

View File

@@ -1,6 +1,6 @@
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Version=20100907-1 Version={VERSION}
Name=OpenRA - Red Alert Name=OpenRA - Red Alert
Comment=The OpenRA RTS engine running Red Alert Comment=The OpenRA RTS engine running Red Alert
Icon=openra Icon=openra

View File

@@ -1,14 +1,12 @@
#!/bin/bash #!/bin/bash
ARGS=5
E_BADARGS=85 E_BADARGS=85
if [ $# -ne "2" ]
if [ $# -ne "$ARGS" ]
then then
echo "Usage: `basename $0` ftp-server ftp-path username password version" echo "Usage: `basename $0` version outputdir"
exit $E_BADARGS exit $E_BADARGS
fi fi
PKGVERSION=`echo $5 | sed "s/-/\\./g"` PKGVERSION=`echo $1 | sed "s/-/\\./g"`
sed -i "s/pkgver=[0-9\\.]\+/pkgver=$PKGVERSION/" PKGBUILD sed -i "s/pkgver=[0-9\\.]\+/pkgver=$PKGVERSION/" PKGBUILD
makepkg --holdver makepkg --holdver
@@ -16,12 +14,4 @@ if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
PACKAGEFILE="openra-git-$PKGVERSION-1-any.pkg.tar.xz" mv openra-git-$PKGVERSION-1-any.pkg.tar.xz $2
size=`stat -c "%s" $PACKAGEFILE`
echo "$5,$size,$PACKAGEFILE" > archlatest.txt
wput $PACKAGEFILE "ftp://$3:$4@$1/$2/"
wput -u archlatest.txt "ftp://$3:$4@$1/$2/"

View File

@@ -1,18 +1,16 @@
#!/bin/bash #!/bin/bash
ARGS=6
E_BADARGS=85 E_BADARGS=85
if [ $# -ne "3" ]
if [ $# -ne "$ARGS" ]
then then
echo "Usage: `basename $0` ftp-server ftp-path username password version packaging-dir" echo "Usage: `basename $0` version packaging-dir outputdir"
exit $E_BADARGS exit $E_BADARGS
fi fi
PKGVERSION=`echo $5 | sed "s/-/\\./g"` PKGVERSION=`echo $1 | sed "s/-/\\./g"`
sed -i "s/%define version [0-9\\.]\+/%define version $PKGVERSION/" openra.spec sed -i "s/%define version [0-9\\.]\+/%define version $PKGVERSION/" openra.spec
cp openra.spec "$6/SPECS/" cp openra.spec "$2/SPECS/"
cd "$6" cd "$2"
rpmbuild --target noarch -bb SPECS/openra.spec rpmbuild --target noarch -bb SPECS/openra.spec
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
@@ -20,12 +18,4 @@ if [ $? -ne 0 ]; then
fi fi
cd RPMS/noarch/ cd RPMS/noarch/
PACKAGEFILE=openra-$PKGVERSION-1.noarch.rpm mv openra-$PKGVERSION-1.noarch.rpm $3
size=`stat -c "%s" $PACKAGEFILE`
echo "$5,$size,$PACKAGEFILE" > /tmp/rpmlatest.txt
wput $PACKAGEFILE "ftp://$3:$4@$1/$2/"
cd /tmp
wput -u rpmlatest.txt "ftp://$3:$4@$1/$2/"

View File

@@ -1,14 +1,8 @@
#!/bin/bash #!/bin/bash
# OpenRA packaging script for Mac OSX
# Files to include in the package if [ $# -ne "3" ]; then
# Specified relative to the build-dir (argument $1) echo "Usage: `basename $0` version files-dir outputdir"
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 exit 1
fi fi
@@ -21,19 +15,13 @@ fi
# Copy the template to build the game package # Copy the template to build the game package
# Assumes it is layed out with the correct directory structure # Assumes it is layed out with the correct directory structure
cp -rv template.app OpenRA.app cp -rv template.app OpenRA.app
cp -R "$2/" "OpenRA.app/Contents/Resources/" || exit 3
for i in $FILES; do # Remove the tao and WindowsBase dlls (which are shipped with the deps package)
cp -Rv "$1/$i" "OpenRA.app/Contents/Resources/$i" || exit 3 rm OpenRA.app/Contents/Resources/Tao.*
done rm OpenRA.app/Contents/Resources/WindowsBase.dll
# Delete excluded files # Package app bundle into a zip and clean up
pushd "OpenRA.app/Contents/Resources/" &> /dev/null zip OpenRA-$1 -r -9 OpenRA.app
for i in $EXCLUDE; do mv OpenRA-$1.zip $3
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 rm -rf OpenRA.app
echo "Done!"

View File

@@ -1,124 +1,79 @@
#!/bin/bash #!/bin/bash
msg () { # OpenRA master packaging script
echo -ne $1
echo $2
echo -ne "\E[0m"
}
TAG=$1 if [ $# -ne "3" ]; then
echo "Usage: `basename $0` tag srcdir outputdir"
exit 1
fi
TYPE=`echo $TAG | grep -o "^[a-z]\\+"` VERSION=`echo $1 | grep -o "[0-9]\\+-\\?[0-9]\\?"`
VERSION=`echo $TAG | grep -o "[0-9]\\+-\\?[0-9]\\?"` SRCDIR=$2
PACKAGEDIR=$3
BUILTDIR="${SRCDIR}/packaging/built"
FTPSERVER=openra.res0l.net # Build the code and push the files into a clean dir
cd "$SRCDIR"
echo $1 > VERSION
make game editor
mkdir packaging/built
mkdir packaging/built/mods
export FTPSERVER # List of files that are packaged on all platforms
# Note that the Tao dlls are shipped on all platforms except osx
# and that they are now installed to the game directory instead of being placed in the gac
FILES="OpenRA.Game.exe OpenRA.Editor.exe OpenRA.Gl.dll OpenRA.FileFormats.dll FreeSans.ttf FreeSansBold.ttf titles.ttf shaders mods/ra mods/cnc VERSION"
case "$TYPE" in # Files that match the above patterns, that should be excluded
"release") EXCLUDE="*.mdb"
FTPPATH="openra.res0l.net/releases"
;;
"playtest")
FTPPATH="openra.res0l.net/playtests"
;;
*)
msg "\E[31m" "Unrecognized tag prefix $TYPE"
exit 1
;;
esac
####### Windows ####### for i in $FILES; do
( cp -R "$i" "packaging/built/$i" || exit 3
msg "\E[34m" "Building Windows package." done
pushd windows/ &> /dev/null for i in $EXCLUDE; do
makensis -DSRCDIR=/home/openra/openra-package/OpenRA-build OpenRA.nsi &> package.log find . -path "$i" -delete
if [ $? -eq 0 ]; then done
mv OpenRA.exe OpenRA-$VERSION.exe
../uploader.sh windows "$VERSION" OpenRA-$VERSION.exe "$FTPPATH" "$2" "$3" # Copy Tao
else cp thirdparty/Tao/* packaging/built
msg "\E[31m" "Windows package build failed, refer to $PWD/package.log."
fi # Copy WindowsBase.dll for linux packages
popd &> /dev/null cp thirdparty/WindowsBase.dll packaging/built
) &
# Change into packaging directory and run the platform-dependant packaging in parallel
cd packaging
# ####### Windows #######
# (
# msg "\E[34m" "Building Windows package."
# pushd windows/ &> /dev/null
# makensis -DSRCDIR="$SRCDIR" OpenRA.nsi &> package.log
# if [ $? -eq 0 ]; then
# mv OpenRA.exe "$PACKAGEDIR"OpenRA-$VERSION.exe
# else
# msg "\E[31m" "Windows package build failed, refer to $PWD/package.log."
# fi
# popd &> /dev/null
# ) &
####### OSX ####### ####### OSX #######
( (
msg "\E[34m" "Building OSX package." echo "Building OSX package."
pushd osx/ &>/dev/null cd osx
sh buildpackage.sh /home/openra/openra-package/OpenRA-build "$VERSION" &> package.log sh buildpackage.sh "$VERSION" "$BUILTDIR" "$PACKAGEDIR" &> package.log
if [ $? -eq 0 ]; then if [ $? -ne 0 ]; then
../uploader.sh mac "$VERSION" OpenRA-$VERSION.zip "$FTPPATH" "$2" "$3" echo "OSX package build failed, refer to $PWD/package.log."
else
msg "\E[31m" "OSX package build failed, refer to $PWD/package.log."
fi fi
popd &> /dev/null
) & ) &
####### *nix Builds ####### ####### Linux #######
( (
pushd linux &> /dev/null echo "Building linux common."
cd linux
#Desktop Icons sh buildpackage.sh "$VERSION" "$BUILTDIR" "$PACKAGEDIR" &> package.log
BUILTDIR=../../../built if [ $? -ne 0 ]; then
mkdir -p $BUILTDIR/usr/share/applications/ echo "linux package build failed, refer to $PWD/package.log."
sed -i "3,3 d" openra-ra.desktop fi
sed -i "3,3 i\Version=$VERSION" openra-ra.desktop
sed -i "3,3 d" openra-cnc.desktop
sed -i "3,3 i\Version=$VERSION" openra-cnc.desktop
cp openra-ra.desktop $BUILTDIR/usr/share/applications/
cp openra-cnc.desktop $BUILTDIR/usr/share/applications/
#Menu entries
mkdir -p $BUILTDIR/usr/share/menu/
cp openra-ra $BUILTDIR/usr/share/menu/
cp openra-cnc $BUILTDIR/usr/share/menu/
#Icon images
mkdir -p $BUILTDIR/usr/share/pixmaps/
cp openra.32.xpm $BUILTDIR/usr/share/pixmaps/
mkdir -p $BUILTDIR/usr/share/icons/
cp -r hicolor $BUILTDIR/usr/share/icons/
popd &> /dev/null
(
#Arch-Linux
msg "\E[34m" "Building Arch-Linux package."
pushd linux/pkgbuild/ &> /dev/null
sh buildpackage.sh "$FTPSERVER" "$FTPPATH/linux" "$2" "$3" "$VERSION" &> package.log
if [ $? -ne 0 ]; then
msg "\E[31m" "Arch-Linux package build failed, refer to $PWD/package.log."
fi
popd &> /dev/null
) &
(
#RPM
msg "\E[34m" "Building RPM package."
pushd linux/rpm/ &> /dev/null
sh buildpackage.sh "$FTPSERVER" "$FTPPATH/linux" "$2" "$3" "$VERSION" ~/rpmbuild &> package.log
if [ $? -ne 0 ]; then
msg "\E[31m" "RPM package build failed, refer to $PWD/package.log."
fi
popd &> /dev/null
) &
(
#deb
msg "\E[34m" "Building deb package."
pushd linux/deb/ &> /dev/null
./buildpackage.sh "$FTPSERVER" "$FTPPATH/linux" "$2" "$3" "$VERSION" ~/openra-package/built ~/debpackage &> package.log
if [ $? -ne 0 ]; then
msg "\E[31m" "deb package build failed, refer to $PWD/package.log."
fi
popd &> /dev/null
) &
wait
) & ) &
wait wait
if [ "$TYPE" = "release" ]; then rm -rf $BUILTDIR
wput --basename=../ -u ../VERSION ftp://$2:$3@$FTPSERVER/$FTPPATH/master/
fi