build_gpl_release hack

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn
Thu Sep 22 08:07:10 PDT 2005


This hack (see attached patch) will make possible to build the 4 packages:

hostapd-<ver>.tar.gz
hostap-driver-<ver>.tar.gz
hostap-utils-<ver>.tar.gz
wpa_supplicant-<ver.tar.gz

out of the cvs hostap tar-ball downloaded from:

  http://hostap.epitest.fi/cgi-bin/viewcvs.cgi/hostap/hostap.tar.gz?tarball=1

Usage: build_gpl_release [-t <tar-ball>] <version>


Cheers,
Cristian
-------------- next part --------------
--- build_gpl_release.orig	2005-09-17 18:45:54.000000000 +0200
+++ build_gpl_release	2005-09-22 17:02:52.453507649 +0200
@@ -7,16 +7,54 @@ WINLOCAL=/home/jm/H-win/local
 WINNDISEVENTS=/home/jm/H-qa/windows/ndis_events.exe
 QT4HOSTBIN=/q/jm/qt4/bin
 
+SELF=${0##*/}
+
+usage () {
+    ret=$1 || :
+    [ "$ret" ] || ret=0 || :
+    # '-t' means we have a CVS source tree tar-ball
+    echo "$SELF [-t <tar-ball>] <version>" >&2
+    exit $ret
+}
+
 set -e
 
-if [ -z "$1" ]; then
-    echo "build_gpl_release <version>"
+[ "$1" ] || usage 0
+
+TARCMD="tar x"
+TARBFN=
+TARB=0 || :
+[ $# -gt 1 ] && while [ "$1" ]; do
+    case "$1" in
+	-t)
+	    TARB=1
+	    shift
+	    TARBFN=$1
+	    [ -f $TARBFN ] || {
+		echo "E: tar-ball file '$TARBFN' not found." >&2
     exit 1
-fi
+	    }
+	    [ $(expr $TARBFN : '.*\.gz$') -gt 0 ] && TARCMD="${TARCMD}z"
+	    [ $(expr $TARBFN : '.*\.tgz$') -gt 0 ] && TARCMD="${TARCMD}z"
+	    [ $(expr $TARBFN : '.*\.bz$') -gt 0 ] && TARCMD="${TARCMD}j"
+	    [ $(expr $TARBFN : '.*\.bz2$') -gt 0 ] && TARCMD="${TARCMD}j"
+	    [ $(expr $TARBFN : '.*\.tbz$') -gt 0 ] && TARCMD="${TARCMD}j"
+	    shift
+	    ;;
+	*)
+	    break
+	    ;;
+    esac
+done
+[ $TARB -eq 1 ] && TARCMD="${TARCMD}f $(realpath $TARBFN)"
+
+VER=$1 || :
+[ "$VER" ] || usage 1
 
-TMP=tmp.build_gpl_release
+echo "I: got this: TARCMD='$TARCMD', VER='$VER'" >&2
+
+TMP=tmp.$SELF
 RELDIR=`pwd`/Release
-VER=$1
 NOW=`date +%Y-%m-%d`
 DIR=hostap-$VER
 
@@ -24,21 +62,33 @@ REMOVE="build_gpl_release todo.lst Prism
 REMOVE_DIRS="testing www"
 
 if [ -r $TMP ]; then
-    echo "Temporary directory '$TMP' exists. Remove it before running this."
+    echo "W: Temporary directory '$TMP' exists. " \
+	 "Remove it before running this." >&2
     exit 1
 fi
 
 mkdir $TMP
 cd $TMP
 
-cvs export -D now -d "$DIR" hostap
+if [ $TARB -eq 1 ]; then
+    $TARCMD
+    [ -d hostap ] || {
+	echo "E: subdir 'hostap' not found." >&2
+	exit 1
+    }
+    \mv -v hostap $DIR
+else
+    cvs export -D now -d "$DIR" hostap
+fi
+
+#exit 0
 
 cd "$DIR"
 if [ -n "$REMOVE" ]; then
-    rm $REMOVE
+    \rm -f $REMOVE
 fi
 if [ -n "$REMOVE_DIRS" ]; then
-    rm -r $REMOVE_DIRS
+    \rm -rf $REMOVE_DIRS
 fi
 
 CONF=driver/modules/hostap_config.h



More information about the Hostap mailing list