diff options
author | Kevin Rushforth <[email protected]> | 2006-10-03 22:49:56 +0000 |
---|---|---|
committer | Kevin Rushforth <[email protected]> | 2006-10-03 22:49:56 +0000 |
commit | 4cea6bc0a5a520de1053e4031bd26f4eb15e81f5 (patch) | |
tree | 83b5c61068ba07413e7e481a904e021b95a29abf /build-tools/genzip | |
parent | 3d6820eb37d7bcc7490790105186081c9d39ec89 (diff) |
Updated build files to build pre-release self-extracting shell-archives for UNIX
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@707 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'build-tools/genzip')
-rw-r--r-- | build-tools/genzip | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/build-tools/genzip b/build-tools/genzip new file mode 100644 index 0000000..85b0832 --- /dev/null +++ b/build-tools/genzip @@ -0,0 +1,54 @@ +#!/bin/sh + +# usage: genzip <archive-name> <license-file> <file> [ <file> ... ] + +tmpscr1=script1.$$ +tmpscr2=script2.$$ + +archive=$1 +shift +license=$1 +shift + +echo "zip'ing..." + +zip -r $archive.zip $* + +cat ../unzipsfx $archive.zip > $archive + +echo "Checksumming..." + +sum=`/usr/bin/sum $archive` +index=1 +for s in $sum +do + case $index in + 1) sum1=$s; + index=2; + ;; + 2) sum2=$s; + index=3; + ;; + esac +done +echo sum = $sum1 $sum2 + +cat ../script1.txt $license ../script2.txt > $tmpscr1 + +linecount=`/usr/bin/wc -l < $tmpscr1` +linecount=$(($linecount + 1)) +echo linecount = $linecount + +echo "Generating .bin script..." + +sed -e s/@LINECOUNT@/$linecount/ -e s/@SUM1@/$sum1/ -e s/@SUM2@/$sum2/ < $tmpscr1 > $tmpscr2 +cat $tmpscr2 $archive > ../$archive.bin +chmod +x ../$archive.bin + +echo "Cleaning up..." +rm -f $tmpscr1 +rm -f $tmpscr2 +rm -f $archive.zip +rm -f $archive + +echo "Done" |