#!/bin/bash ## Make a new version of webalizer-ER.zip; by E Reimer 2008-12-30: DISDIR=/pix/pkg/webalizer-2.20-03-unmodified ##dir $DISDIR contains unmodified webalizer, as distributed ER_DIR=/pix/pkg/webalizer-2.20-03-ER ##dir $ER_DIR contains my modified version - will have extra files (config+make) ZIPDIR=/tmp/webalizer-ER-2.20-03 ##dir $ZIPDIR in which to-be-distributed version will be assembled DSTZIP=/er/website/programs/webalizer-ER.zip ##where the resulting zipfile goes rm -f -R $ZIPDIR; mkdir $ZIPDIR ##ensure $ZIPDIR is an empty directory cp -pfuv $ER_DIR/webalizer_lang.h $ER_DIR/lang/webalizer_lang.english ##ensure the English lang file is in its distribution location cp -dpRx $ER_DIR/lang $ZIPDIR ##copy the lang subdir from $ER_DIR to $ZIPDIR cd $DISDIR || exit for F in *;do ##for each "distribution" file $F... if [[ $F == lang ]];then continue; fi ##except lang subdir MSG="MODIFIED"; if cmp -s $F $ER_DIR/$F; then MSG="unmodified"; fi echo -n "Copying $F ($MSG): "; cp -pv $ER_DIR/$F $ZIPDIR/$F ##copy $F from $ER_DIR to $ZIPDIR done cd /tmp || exit; rm -f -R $DSTZIP; zip $DSTZIP ${ZIPDIR#/tmp/}/*{,/*} ##ZIP; to get path-names: webalizer-ER-2.20-03/... (try simplifying with -r) DATE=$(sed -n '/moddate.*20..-..-../s|.*\(20..-..-..\).*|\1|p' $ER_DIR/webalizer.c) ##get the moddate from webalizer.c cp -pfv $DSTZIP $ER_DIR/webalizer-ER-$DATE.zip ##keep a DATESTAMPED zipfile touch $ER_DIR/webalizer-ER-$DATE.zip $DSTZIP ##ensure DSTZIP at least as new as ER_DIR (see test in webput) cd /tmp/tmp || exit; rm -f -R *; cp $DSTZIP .; echo "under $(pwd)"; unzip *; echo "unzipping done" ##debug zipfile exit note: pattern after his tgz -- have virginal untgz'ed copy in $DISDIR; NEED TO OMIT: files made by configure: Makefile config.log config.status dnscache.db webalizer_lang.h NOTE: webalizer_lang.h <==> lang/webalizer_lang.english; ==REDO country-code mods to each file lang/webalizer_lang.* (not essential??) (also omit .o webalizer,webazolver... things removed by make clean) ZIPFILE to have top-level-dirname of: webalizer-ER-2.20-03 ==!!==REWRITE NEEDED to use automake, etc; SEE /etc/sbin/mk-charsetdetective-tarball 2010-10-27: remove-->rm -f -R;