64bit linux packages

This commit is contained in:
Matthew Bowra-Dean
2011-01-05 13:26:44 +13:00
parent 8dcba13491
commit 0d038f00ba
9 changed files with 66 additions and 26 deletions

View File

@@ -1,8 +1,8 @@
#!/bin/bash
# OpenRA packaging master script for linux packages
if [ $# -ne "3" ]; then
echo "Usage: `basename $0` version files-dir outputdir"
if [ $# -ne "4" ]; then
echo "Usage: `basename $0` version files-dir outputdir arch"
exit 1
fi
@@ -15,13 +15,19 @@ rm -rf root
# Game files
mkdir -p root/usr/bin/
cp -T $BUILTDIR/gtklaunch root/usr/bin/openra
if [ $4 -eq "x64" ]; then
cp -T $BUILTDIR/gtklaunch root/usr/bin/openra
else
cp -T $BUILTDIR/gtklaunch32 root/usr/bin/openra
fi
mkdir -p root/usr/share/openra/
cp -R $BUILTDIR/* "root/usr/share/openra/" || exit 3
# Remove unneeded files
rm root/usr/share/openra/OpenRA.Launcher.exe
rm root/usr/share/openra/gtklaunch
rm root/usr/share/openra/gtklaunch32
# Desktop Icons
mkdir -p root/usr/share/applications/
@@ -40,7 +46,7 @@ cp -r hicolor root/usr/share/icons/
(
echo "Building Debian package."
cd deb
./buildpackage.sh "$VERSION" ../root "$PACKAGEDIR" &> package.log
./buildpackage.sh "$VERSION" ../root "$PACKAGEDIR" $4 &> package.log
if [ $? -ne 0 ]; then
echo "Debian package build failed, refer to $PWD/package.log."
fi
@@ -49,7 +55,7 @@ cp -r hicolor root/usr/share/icons/
(
echo "Building Arch-Linux package."
cd pkgbuild
sh buildpackage.sh "$VERSION" ../root "$PACKAGEDIR" &> package.log
sh buildpackage.sh "$VERSION" ../root "$PACKAGEDIR" $4 &> package.log
if [ $? -ne 0 ]; then
echo "Arch-Linux package build failed, refer to $PWD/package.log."
fi
@@ -58,7 +64,7 @@ cp -r hicolor root/usr/share/icons/
(
echo "Building RPM package."
cd rpm
sh buildpackage.sh "$VERSION" ../root ~/rpmbuild "$PACKAGEDIR" &> package.log
sh buildpackage.sh "$VERSION" ../root ~/rpmbuild "$PACKAGEDIR" $4 &> package.log
if [ $? -ne 0 ]; then
echo "RPM package build failed, refer to $PWD/package.log."
fi

View File

@@ -1,6 +1,6 @@
Package: openra
Version: {VERSION}
Architecture: i386
Architecture: {ARCH}
Maintainer: Matthew Bowra-Dean <matthew@ijw.co.nz>
Uploaders: Maikel van den Hout <ma1kelvdh@gmail.com>, Paul Chote <sleipnir@sleipnirstuff.com>
Installed-Size: {SIZE}

View File

@@ -1,14 +1,20 @@
#!/bin/bash
# OpenRA packaging script for Debian based distributions
E_BADARGS=85
if [ $# -ne "3" ]
if [ $# -ne "4" ]
then
echo "Usage: `basename $0` version root-dir outputdir"
echo "Usage: `basename $0` version root-dir outputdir arch"
exit $E_BADARGS
fi
VERSION=$1
rootdir=`readlink -f $2`
PACKAGE_SIZE=`du --apparent-size -c $rootdir/usr | grep "total" | awk '{print $1}'`
if [ $4 -eq "x64" ]
then
ARCH=amd64
else
ARCH=i386
fi
# Copy template files into a clean build directory (required)
mkdir root
@@ -16,7 +22,7 @@ cp -R DEBIAN root
cp -R $rootdir/usr root
# Create the control and changelog files from templates
sed "s/{VERSION}/$VERSION/" DEBIAN/control | sed "s/{SIZE}/$PACKAGE_SIZE/" > root/DEBIAN/control
sed "s/{VERSION}/$VERSION/" DEBIAN/control | sed "s/{SIZE}/$PACKAGE_SIZE/" | sed "s/{ARCH}/$ARCH/" > root/DEBIAN/control
sed "s/{VERSION}/$VERSION/" DEBIAN/changelog > root/DEBIAN/changelog
# Build it in the temp directory, but place the finished deb in our starting directory
@@ -26,7 +32,7 @@ pushd root
md5sum `find . -type f | grep -v '^[.]/DEBIAN/'` | sed 's/\.\/usr\//usr\//g' > DEBIAN/md5sums
# Start building, the file should appear in the output directory
dpkg-deb -b . $3/openra-$VERSION.deb
dpkg-deb -b . $3/openra-$VERSION-$ARCH.deb
# Clean up
popd

View File

@@ -3,7 +3,7 @@ pkgname=openra
pkgver={VERSION}
pkgrel=1
pkgdesc="Open Source rebuild of the Red Alert game engine using Mono/OpenGL."
arch=('i686')
arch=('{ARCH}')
url="http://open-ra.org"
license=('GPL3')
groups=()

View File

@@ -1,22 +1,29 @@
#!/bin/bash
E_BADARGS=85
if [ $# -ne "3" ]
if [ $# -ne "4" ]
then
echo "Usage: `basename $0` version root-dir outputdir"
echo "Usage: `basename $0` version root-dir outputdir arch"
exit $E_BADARGS
fi
if [ $4 -eq "x64" ]
then
ARCH=x86_64
else
ARCH=i686
# Replace any dashes in the version string with periods
PKGVERSION=`echo $1 | sed "s/-/\\./g"`
sed -i "s/{VERSION}/$PKGVERSION/" PKGBUILD
rootdir=`readlink -f $2`
sed -i "s|{ROOT}|$rootdir|" PKGBUILD
sed -i "s/{ARCH}/$ARCH/" PKGBUILD
makepkg --holdver
if [ $? -ne 0 ]; then
exit 1
fi
mv openra-$PKGVERSION-1-i686.pkg.tar.xz $3
mv openra-$PKGVERSION-1-$ARCH.pkg.tar.xz $3

View File

@@ -1,11 +1,18 @@
#!/bin/bash
E_BADARGS=85
if [ $# -ne "4" ]
if [ $# -ne "5" ]
then
echo "Usage: `basename $0` version root-dir packaging-dir outputdir"
echo "Usage: `basename $0` version root-dir packaging-dir outputdir arch"
exit $E_BADARGS
fi
if [ $5 -eq "x64" ]
then
ARCH=x86_64
else
ARCH=i386
fi
# Replace any dashes in the version string with periods
PKGVERSION=`echo $1 | sed "s/-/\\./g"`
@@ -23,11 +30,11 @@ cp openra.spec "$3/SPECS/"
cd "$3"
rpmbuild --target i686 -bb SPECS/openra.spec
rpmbuild --target $ARCH -bb SPECS/openra.spec
if [ $? -ne 0 ]; then
exit 1
fi
cd RPMS/i686/
mv openra-$PKGVERSION-1.i686.rpm $4
cd RPMS/$ARCH/
mv openra-$PKGVERSION-1.$ARCH.rpm $4