Author: ceros-guest
Date: 2008-01-15 18:09:12 +0000 (Tue, 15 Jan 2008)
New Revision: 5370

Modified:
   packages/trunk/alien-arena/debian/alien-arena-get-orig-source
Log:
Fixing get-orig-source script.

Modified: packages/trunk/alien-arena/debian/alien-arena-get-orig-source
===================================================================
--- packages/trunk/alien-arena/debian/alien-arena-get-orig-source       
2008-01-15 15:53:18 UTC (rev 5369)
+++ packages/trunk/alien-arena/debian/alien-arena-get-orig-source       
2008-01-15 18:09:12 UTC (rev 5370)
@@ -1,86 +1,135 @@
 #! /bin/sh
 
-# This script is used to generate the alien-arena_6.10.orig tarball that can be
+# This script is used to generate the alien-arena orig tarball that can be
 # distributed through Debian.
 
-if [ ! -f alienarena2007-20071011-linux.zip ] ; then
+ALIEN_ARENA_TARBALL="alienarena2007-20071011-linux.zip"
+ALIEN_ARENA_VERSION="6.10"
+CORRECT_CHECKSUM="7ebb0dfeec4be80311921a075379c8dc"
+
+USAGE="\
+alien-arena orig tarball download script\n\
+This script will generate an orig tarball that's distrubeted through Debian.\n\
+Usage: alien-arena-get-orig-source [OPTION]\n\
+\n\
+ -h, --help                 Display this text\n\
+--keep-upstream             Don't delete the upstream source tarball\n\
+--keep-orig-dir             Don't delete the orig directory\n"
+
+while [ "$#" -gt "0" ]
+do
+    case "$1" in
+        -h|--help)
+            echo -e "${USAGE}"
+            exit 1
+            ;;
+        --keep-upstream-tarball)
+            echo "The 'keep-upstream-tarball' option will have meaning once a"
+            echo "suitable location to download the upstream tarball directly"
+            echo "is found."
+            shift
+            ;;
+        --keep-orig-dir)
+            KEEP_ORIG_DIR=1
+            shift
+            ;;
+    esac
+done
+
+if [ ! -f $ALIEN_ARENA_TARBALL ] ; then
        # Download upstream zip file
-       wget -c 
http://icculus.org/alienarena/files/alienarena2007-20071011-linux.zip
-       echo "Downloaded upstream zip file"
+       #wget -c http://icculus.org/alienarena/files/$ALIEN_ARENA_TARBALL
+       #echo "Downloaded upstream zip file"
+       # TODO: Need to find a direct download of the upstream source tarball.
+       echo "Currently, there is no suitable location to directly download the"
+       echo "upstream source tarball. Until one is found, you will have to use"
+       echo "one of the sites that ask for registration, or makes you wait in"
+       echo "line to get the upstream source tarball. This script should still"
+       echo "work correctly if your running it from a directory with the 
upstream"
+       echo "source. The upstream source should be named $ALIEN_ARENA_TARBALL."
+       exit 1
 fi
 
 # Verify the checksum
-CORRECT_CHECKSUM=7ebb0dfeec4be80311921a075379c8dc
-COMPUTED_CHECKSUM=`md5sum alienarena2007-20071011-linux.zip | cut -d ' ' -f 1`
+echo -n "Verifying MD5 checksum..."
+COMPUTED_CHECKSUM=`md5sum $ALIEN_ARENA_TARBALL | cut -d ' ' -f 1`
+echo "done."
 
 if [ $CORRECT_CHECKSUM != $COMPUTED_CHECKSUM ] ; then
        echo "Checksum verification failed. Checksum was $COMPUTED_CHECKSUM
 Expected checksum $CORRECT_CHECKSUM"
-       exit 0
+       exit 1
 else
        echo "Checksum verified. Checksum is $COMPUTED_CHECKSUM."
 fi
 
-# Prepare the alien-arena_6.10.orig tarball
+# Prepare the alien-arena orig tarball
 if [ ! -d alienarena2007 ]; then
-       echo "Extracting alienarena2007-20071011-linux.zip"
-       unzip alienarena2007-20071011-linux.zip
+       echo -n "Extracting $ALIEN_ARENA_TARBALL..."
+       unzip -qq $ALIEN_ARENA_TARBALL
+       echo "done."
 else
        echo "Already found extracted alienarena2007 directory. Please remove 
-or move alienarena2007 and alien-arena-6.10 directories and also 
alien-arena_6.10.orig.tar.gz."
-       exit 0
+or move alienarena2007 and alien-arena-$ALIEN_ARENA_VERSION directories and 
also alien-arena_$ALIEN_ARENA_VERSION.orig.tar.gz."
+       exit 1
 fi
-if [ ! -d alien-arena-6.10 ]; then
-       echo "Renaming extracted alienarena2007 directory to alien-arena-6.10"
-       mv alienarena2007 alien-arena-6.10
+if [ ! -d alien-arena-$ALIEN_ARENA_VERSION ]; then
+       echo "Renaming extracted alienarena2007 directory to 
alien-arena-$ALIEN_ARENA_VERSION"
+       mv alienarena2007 alien-arena-$ALIEN_ARENA_VERSION
 else
-       echo "Already found alien-arena-6.10 directory. Please remove 
-or move alienarena2007 and alien-arena-6.10 directories and also 
alien-arena_6.10.orig.tar.gz."
-       exit 0
+       echo "Already found alien-arena-$ALIEN_ARENA_VERSION directory. Please 
remove 
+or move alienarena2007 and alien-arena-$ALIEN_ARENA_VERSION directories and 
also alien-arena_$ALIEN_ARENA_VERSION.orig.tar.gz."
+       exit 1
 fi
 
 # Remove all precompiled binaries
 echo "Removing all precompiled binaries"
-for REMOVE_DLL in `find alien-arena-6.10 -name *.dll`; do
-       rm -rf "$REMOVE_DLL"
+for REMOVE_DLL in `find alien-arena-$ALIEN_ARENA_VERSION -name *.dll`; do
+       rm -r "$REMOVE_DLL"
 done
-for REMOVE_SO in `find alien-arena-6.10 -name *.so`; do
-       rm -rf "$REMOVE_SO"
+for REMOVE_SO in `find alien-arena-$ALIEN_ARENA_VERSION -name *.so`; do
+       rm -r "$REMOVE_SO"
 done
-for REMOVE_EXE in `find alien-arena-6.10 -name *.exe`; do
-       rm -rf "$REMOVE_EXE"
+for REMOVE_EXE in `find alien-arena-$ALIEN_ARENA_VERSION -name *.exe`; do
+       rm -r "$REMOVE_EXE"
 done
-for REMOVE_LIB in `find alien-arena-6.10 -name *.lib`; do
-       rm -rf "$REMOVE_LIB"
+for REMOVE_LIB in `find alien-arena-$ALIEN_ARENA_VERSION -name *.lib`; do
+       rm -r "$REMOVE_LIB"
 done
 
 # Removing other non-distributable components
 echo "Removing non-distributable components"
-for REMOVE_ICO in `find alien-arena-6.10 -name *.ico`; do
-       rm -rf "$REMOVE_ICO"
+for REMOVE_ICO in `find alien-arena-$ALIEN_ARENA_VERSION -name *.ico`; do
+       rm -r "$REMOVE_ICO"
 done
-for REMOVE_BAT in `find alien-arena-6.10 -name *.bat`; do
-       rm -rf "$REMOVE_BAT"
+for REMOVE_BAT in `find alien-arena-$ALIEN_ARENA_VERSION -name *.bat`; do
+       rm -r "$REMOVE_BAT"
 done
-for REMOVE_DSP in `find alien-arena-6.10 -name *.dsp`; do
-       rm -rf "$REMOVE_DSP"
+for REMOVE_DSP in `find alien-arena-$ALIEN_ARENA_VERSION -name *.dsp`; do
+       rm -r "$REMOVE_DSP"
 done
-for REMOVE_DSW in `find alien-arena-6.10 -name *.dsw`; do
-       rm -rf "$REMOVE_DSW"
+for REMOVE_DSW in `find alien-arena-$ALIEN_ARENA_VERSION -name *.dsw`; do
+       rm -r "$REMOVE_DSW"
 done
 
-# Remove components distributed through alien-arena-data package
-echo "Removing components distributed through alien-arena-data package."
-rm -rf alien-arena-6.10/arena
-rm -rf alien-arena-6.10/botinfo
-rm -rf alien-arena-6.10/data1
+# Remove components distributed through alien-arena package
+echo -n "Removing components distributed through alien-arena-data package..."
+rm -r alien-arena-$ALIEN_ARENA_VERSION/arena
+rm -r alien-arena-$ALIEN_ARENA_VERSION/botinfo
+rm -r alien-arena-$ALIEN_ARENA_VERSION/data1
+echo "done."
 
 # Create the tarball
-if [ ! -f alien-arena_6.10.orig.orig.tar.gz ]; then
+if [ ! -f alien-arena_$ALIEN_ARENA_VERSION.orig.tar.gz ]; then
        echo "Creating orig tarball."
-       tar -czf alien-arena_6.10.orig.tar.gz alien-arena-6.10/
+       tar -czf alien-arena_$ALIEN_ARENA_VERSION.orig.tar.gz 
alien-arena-$ALIEN_ARENA_VERSION/
+       if [ ! -n "$KEEP_ORIG_DIR" ]; then
+               echo -n "Removing orig directory..."
+               rm -rf alien-arena-$ALIEN_ARENA_VERSION/
+               echo "done."
+       fi
 else
        echo "Already found orig tarball. Please remove or move
-alien-arena_6.10.orig.tar.gz."
-       exit 0
+alien-arena_$ALIEN_ARENA_VERSION.orig.tar.gz."
+       exit 1
 fi


_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-games-commits

Reply via email to