#!/bin/bash # # makerel: script di servizio per generare le rel. dei sorgenti # coprig="Matteo Nastasi" copdat="2002-`date +%Y`" contac="nastasi@alternativeoutput.it" conta2="matteo.nastasi@milug.org" if [ $# -ne 1 ]; then exit 1 fi cw=`pwd` nome=`basename $cw` cd .. newdir="${nome}-$1" if [ -d ${newdir} ]; then echo $newdir exist exit 1 else cp -ar ${nome} $newdir fi cd $newdir for i in `find . -name '*.h' -o -name '*.c' -o -name '*.sh' -o -name '*.1'`; do cp $i file.tmp cat file.tmp | sed "s/vERSIOn/$1/g; s/cOPYRIGHt/$coprig/g; s/cOPYDATe/$copdat/g; s/cONTACt/$contac/g; s/cONTAC2t/$conta2/g" > $i rm file.tmp done rm makerel if [ -d .git ]; then rm -rf .git fi cd .. tar --owner nobody --group nogroup -zcvf ${nome}_${1}.tgz $newdir exit 0