diff --git a/Makefile b/Makefile index adc19ea3d4..52d15784ed 100644 --- a/Makefile +++ b/Makefile @@ -5,12 +5,13 @@ COMMON_LIBS = System.dll System.Core.dll System.Drawing.dll System.Xml.dll third PHONY = core tools package all mods clean distclean CC = gcc -CFLAGS = -O2 -Wall -m32 +CFLAGS = -O2 -Wall +CFLAGS32 = $(CFLAGS) -m32 .SUFFIXES: core: game renderers mod_ra mod_cnc tools: editor ralint seqed filex tsbuild utility -package: fixheader core editor utility winlaunch gtklaunch +package: fixheader core editor utility winlaunch gtklaunch gtklaunch32 mods: mod_ra mod_cnc all: core tools winlaunch clean: @@ -183,6 +184,10 @@ gtklaunch: $(gtklaunch_HEADERS) $(gtklaunch_SRCS) @echo CC launcher @$(CC) $(CFLAGS) $(shell pkg-config --cflags --libs gtk+-2.0 webkit-1.0) -I/usr/include/ -lgcrypt -o gtklaunch $(gtklaunch_SRCS) /usr/lib/libmicrohttpd.a +gtklaunch32: $(gtklaunch_HEADERS) $(gtklaunch_SRCS) + @echo CC launcher32 + @$(CC) $(CFLAGS32) $(shell pkg-config --cflags --libs gtk+-2.0 webkit-1.0) -I/usr/include/ -lgcrypt -o gtklaunch32 $(gtklaunch_SRCS) /usr/lib/libmicrohttpd.a + .PHONY: $(PHONY) $(PROGRAMS) # @@ -216,6 +221,7 @@ INSTALL_DIR = $(DESTDIR)$(datadir)/openra INSTALL = install INSTALL_PROGRAM = $(INSTALL) CORE = fileformats rcg rgl rnull game editor utility winlaunch + install: all gtklaunch @-echo "Installing OpenRA to $(INSTALL_DIR)" @$(INSTALL_PROGRAM) -d $(INSTALL_DIR) diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index 742b051dff..03e121dd0f 100644 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -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 diff --git a/packaging/linux/deb/DEBIAN/control b/packaging/linux/deb/DEBIAN/control index a21e0d7639..6e05a3fdc4 100644 --- a/packaging/linux/deb/DEBIAN/control +++ b/packaging/linux/deb/DEBIAN/control @@ -1,6 +1,6 @@ Package: openra Version: {VERSION} -Architecture: i386 +Architecture: {ARCH} Maintainer: Matthew Bowra-Dean Uploaders: Maikel van den Hout , Paul Chote Installed-Size: {SIZE} diff --git a/packaging/linux/deb/buildpackage.sh b/packaging/linux/deb/buildpackage.sh index b54a295ca1..2001ee054f 100755 --- a/packaging/linux/deb/buildpackage.sh +++ b/packaging/linux/deb/buildpackage.sh @@ -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 diff --git a/packaging/linux/pkgbuild/PKGBUILD b/packaging/linux/pkgbuild/PKGBUILD index aed42a8a3c..ef4cbb9522 100644 --- a/packaging/linux/pkgbuild/PKGBUILD +++ b/packaging/linux/pkgbuild/PKGBUILD @@ -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=() diff --git a/packaging/linux/pkgbuild/buildpackage.sh b/packaging/linux/pkgbuild/buildpackage.sh index 9d2d3df23a..26b22c58ab 100755 --- a/packaging/linux/pkgbuild/buildpackage.sh +++ b/packaging/linux/pkgbuild/buildpackage.sh @@ -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 diff --git a/packaging/linux/rpm/buildpackage.sh b/packaging/linux/rpm/buildpackage.sh index 4e1d593f41..e51fa4be80 100755 --- a/packaging/linux/rpm/buildpackage.sh +++ b/packaging/linux/rpm/buildpackage.sh @@ -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 diff --git a/packaging/package-all.sh b/packaging/package-all.sh index 38cc3f351c..b644c9af13 100755 --- a/packaging/package-all.sh +++ b/packaging/package-all.sh @@ -76,10 +76,15 @@ echo "Creating packages..." ( cd linux - sh buildpackage.sh "$VERSION" "$BUILTDIR" "$OUTPUTDIR" &> package.log + sh buildpackage.sh "$VERSION" "$BUILTDIR" "$OUTPUTDIR" "x86" &> package.log if [ $? -ne 0 ]; then echo "linux package build failed, refer to linux/package.log." fi + sh buildpackage.sh "$VERSION" "$BUILTDIR" "$OUTPUTDIR" "x64" &> package.log + if [ $? -ne 0 ]; then + echo "linux package build failed, refer to linux/package.log." + fi + ) & wait diff --git a/packaging/upload-all.sh b/packaging/upload-all.sh index ac80d1a1e1..009321c1c5 100755 --- a/packaging/upload-all.sh +++ b/packaging/upload-all.sh @@ -25,9 +25,12 @@ esac LINUXVERSION=`echo $VERSION | sed "s/-/\\./g"` -./uploader.sh linux "$VERSION" $PKGDIR/openra-$LINUXVERSION.deb "deblatest" "$FTPSERVER" "$FTPPATH" "$3" "$4" -./uploader.sh linux "$VERSION" $PKGDIR/openra-$LINUXVERSION-1.i686.rpm "rpmlatest" "$FTPSERVER" "$FTPPATH" "$3" "$4" -./uploader.sh linux "$VERSION" $PKGDIR/openra-$LINUXVERSION-1-i686.pkg.tar.xz "archlatest" "$FTPSERVER" "$FTPPATH" "$3" "$4" +./uploader.sh linux "$VERSION" $PKGDIR/openra-$LINUXVERSION-i386.deb "deblatest32" "$FTPSERVER" "$FTPPATH" "$3" "$4" +./uploader.sh linux "$VERSION" $PKGDIR/openra-$LINUXVERSION-1.i686.rpm "rpmlatest32" "$FTPSERVER" "$FTPPATH" "$3" "$4" +./uploader.sh linux "$VERSION" $PKGDIR/openra-$LINUXVERSION-1-i686.pkg.tar.xz "archlatest32" "$FTPSERVER" "$FTPPATH" "$3" "$4" +./uploader.sh linux "$VERSION" $PKGDIR/openra-$LINUXVERSION-amd64.deb "deblatest" "$FTPSERVER" "$FTPPATH" "$3" "$4" +./uploader.sh linux "$VERSION" $PKGDIR/openra-$LINUXVERSION-1.x86_64.rpm "rpmlatest" "$FTPSERVER" "$FTPPATH" "$3" "$4" +./uploader.sh linux "$VERSION" $PKGDIR/openra-$LINUXVERSION-1-x86_64.pkg.tar.xz "archlatest" "$FTPSERVER" "$FTPPATH" "$3" "$4" if [ "$TYPE" = "release" ]; then wput --basename=../ -u ../VERSION ftp://$3:$4@$FTPSERVER/$FTPPATHBASE/master/