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:
@@ -1,57 +1,34 @@
|
||||
#!/bin/bash
|
||||
ARGS=7
|
||||
# OpenRA packaging script for Mac OSX
|
||||
E_BADARGS=85
|
||||
|
||||
if [ $# -ne "$ARGS" ]
|
||||
if [ $# -ne "3" ]
|
||||
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
|
||||
fi
|
||||
VERSION=$1
|
||||
|
||||
PKGVERSION=`echo $5 | sed "s/-/\\./g"`
|
||||
|
||||
# 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
|
||||
# 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}'`
|
||||
|
||||
# Copy our two needed folders to a clean package directory (yes, this is needed)
|
||||
mkdir $7
|
||||
cp -R DEBIAN $7
|
||||
cp -R $6/usr $7
|
||||
mkdir root
|
||||
cp -R DEBIAN root
|
||||
cp -R $2/usr root
|
||||
|
||||
# Build it in the package directory, but place the finished deb in our starting directory
|
||||
BUILD_DIR=$( pwd )
|
||||
pushd $7
|
||||
# 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/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
|
||||
md5sum `find . -type f | grep -v '^[.]/DEBIAN/'` >DEBIAN/md5sums
|
||||
sed -i 's/\.\/usr\//usr\//g' DEBIAN/md5sums
|
||||
md5sum `find . -type f | grep -v '^[.]/DEBIAN/'` | sed 's/\.\/usr\//usr\//g' > DEBIAN/md5sums
|
||||
|
||||
# Start building, the file should appear in directory the script was executed in
|
||||
dpkg-deb -b . $BUILD_DIR/openra-$PKGVERSION.deb
|
||||
|
||||
# Get back to begin directory
|
||||
# Start building, the file should appear in the output directory
|
||||
dpkg-deb -b . $3/openra-$VERSION.deb
|
||||
|
||||
# Clean up
|
||||
popd
|
||||
|
||||
# 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
|
||||
rm -rf root
|
||||
|
||||
Reference in New Issue
Block a user