1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
#!/bin/sh
#A Frank Lübeck
##
## Usage: cd <GAPDIR>/pkg; ../etc/packpack <pack>
##
## This is a utility to archive a package. Produces:
## <pack>.zoo (for GAP's unzoo, with obvious text files marked as such)
## <pack>-win.zip (Windows line breaks in obvious text files)
## <pack>.tar.gz
## <pack>.tar.bz2
##
## All files ending in "~" and CVS directories are automatically not
## archived.
##
## The "obvious text files" are currently:
## *.txt, *.gi, *.gd, *.g, *.c, *.h, *.htm, *.html, *.xml, *.tex,
## *.six, *.bib, *.tst, README.*, INSTALL.*, Makefile
##
##
pname=$1
# all files except CVS directories and files ending in ~
allfiles=`find $1 -path "*/CVS" -prune -o -regex ".*[^~]" -print`
############# zoo ########################
# start new zoo file
rm -f $1.zoo
# zoo it
zoo ah $1.zoo $allfiles
# mark some files as text files
for a in `find $1 -regex ".*\(\.txt\|\.gi\|\.gd\|\.g\|\.c\|\.h\|\.htm\|\.html\|\.xml\|\.tex\|\.six\|\.bib\|\.tst\|README.*\|INSTALL.*\|Makefile\)"`
do
(echo '!TEXT!'; echo '/END') | zoo c $1.zoo $a
done
############# zip ########################
# start new zip file
#rm -f $1.zip
rm -f $1-win.zip
# zip it
#zip -9 $1 $allfiles
# for Windows-version first the files considered as binary
zip -9 $1-win `find $1 -regex ".*\(\.txt\|\.gi\|\.gd\|\.g\|\.c\|\.h\|\.htm\|\.html\|\.xml\|\.tex\|\.six\|\.bib\|\.tst\|README.*\|INSTALL.*\|Makefile\|/CVS\|/CVS/.*\|~\)" -prune -o -print`
# text files with CR-LF line ends
zip -9 -l $1-win `find $1 -regex ".*\(\.txt\|\.gi\|\.gd\|\.g\|\.c\|\.h\|\.htm\|\.html\|\.xml\|\.tex\|\.six\|\.bib\|\.tst\|README.*\|INSTALL.*\|Makefile\)"`
############# tar.gz ########################
# remove old tar.gz file
rm -f $1.tar.gz
# tar and gzip it
find $1 -regex ".*\(/CVS\|CVS/.*\|~\)" | tar cv $1 --exclude-from - |gzip -c -9 > $1.tar.gz
############# tar.bz2 ########################
# remove old tar.gz file
rm -f $1.tar.bz2
# tar and bzip2 it
find $1 -regex ".*\(/CVS\|CVS/.*\|~\)" | tar cv $1 --exclude-from - |bzip2 -c -9 > $1.tar.bz2
|