#! /bin/csh # set verbose # choose a type of printer set HEADER=duplex2v.pro # create a backup directory set w=`whoami` set OLD=/tmp/$w/OLD if ( -d $OLD ) then else mkdir -p $OLD echo "$OLD directory created" endif # save some files into the backup directory echo "Saving old files into $OLD directory" mv minitoc.sty mtcoff.sty mtcmess.sty minitoc.ist fminitoc.dtx fminitoc.ist minitoc.pre $OLD mv minitoc.lan fminitoc.lan $OLD mv boldsc.sty mypatches.sty franc.sty frbib.sty frnew.sty $OLD mv mtcpatchmem.sty $OLD mv *.mld $OLD mv *.mlo $OLD mv mtc-add.bib $OLD foreach i ( tex ) mv mtc-gap.$i $OLD mv mtc-apx.$i mtc-amm.$i mtc-mem.$i mtc-mm1.$i mtc-fo1.$i mtc-fo2.$i mtc-scr.$i mtc-sbf.$i mtc-tsf.$i mtc-tbi.$i mtc-2c.$i mtc-bo.$i mtc-hop.$i $OLD mv mtc-cri.$i mtc-liv.$i mtc-ch0.$i mtc-tlc.$i mtc-mu.$i mtc-hir.$i mtc-hia.$i mtc-hi1.$i mtc-hi2.$i $OLD mv mtc-add.$i mtc-ads.$i mtc-bk.$i mtc-art.$i mtc-2nd.$i mtc-syn.$i $OLD end foreach i ( pdf ) cp mtc-gap.$i $OLD cp mtc-apx.$i mtc-amm.$i mtc-mem.$i mtc-mm1.$i mtc-fo1.$i mtc-fo2.$i mtc-scr.$i mtc-sbf.$i mtc-tsf.$i mtc-tbi.$i mtc-2c.$i mtc-bo.$i mtc-hop.$i $OLD cp mtc-cri.$i mtc-liv.$i mtc-ch0.$i mtc-tlc.$i mtc-mu.$i mtc-hir.$i mtc-hia.$i mtc-hi1.$i mtc-hi2.$i $OLD cp mtc-add.$i mtc-ads.$i mtc-bk.$i mtc-art.$i mtc-2nd.$i mtc-syn.$i $OLD end echo 'Creating the package... you can sip a cappuccino' # create the package from minitoc.ins and minitoc.dtx latex minitoc.ins # save the log file of this phase cp minitoc.log minitoc.log1 # cat mtc-add.bib | grep -v endinput|grep -v '^%%' > addbib;mv addbib mtc-add.bib # cat mtc-add.bib | grep -v '^%%' > addbib;mv addbib mtc-add.bib # create the documentation (DVI): 4 latex runs, with index and biblio if ( -f minitoc.dtx ) then if ( -f minitoc.maf ) then cat minitoc.maf | xargs -i -t \rm {} endif echo 'Creating the english documentation...' latex minitoc.dtx sed -e's/:>/=/' < minitoc.idx > minitoc.idx1; mv minitoc.idx1 minitoc.idx bibtex minitoc makeindex -s minitoc.ist -o minitoc.ind minitoc.idx mv minitoc.ilg minitoc.ilg1 # latex minitoc.dtx sed -e's/:>/=/' < minitoc.idx > minitoc.idx1; mv minitoc.idx1 minitoc.idx makeindex -s minitoc.ist -o minitoc.ind minitoc.idx mv minitoc.ilg minitoc.ilg1 # latex minitoc.dtx sed -e's/:>/=/' < minitoc.idx > minitoc.idx1; mv minitoc.idx1 minitoc.idx makeindex -s minitoc.ist -o minitoc.ind minitoc.idx mv minitoc.ilg minitoc.ilg1 # latex minitoc.dtx sed -e's/:>/=/' < minitoc.idx > minitoc.idx1; mv minitoc.idx1 minitoc.idx cp minitoc.log ps-minitoc.log # convert the .dvi into PostScript dvips -h $HEADER -o minitoc.ps minitoc # create the documentation (PDF): 4 pdflatex runs, with index and biblio pdflatex minitoc.dtx sed -e's/:>/=/' < minitoc.idx > minitoc.idx1; mv minitoc.idx1 minitoc.idx bibtex minitoc makeindex -s minitoc.ist -o minitoc.ind minitoc.idx mv minitoc.ilg minitoc.ilg1 # pdflatex minitoc.dtx sed -e's/:>/=/' < minitoc.idx > minitoc.idx1; mv minitoc.idx1 minitoc.idx makeindex -s minitoc.ist -o minitoc.ind minitoc.idx mv minitoc.ilg minitoc.ilg1 # pdflatex minitoc.dtx sed -e's/:>/=/' < minitoc.idx > minitoc.idx1; mv minitoc.idx1 minitoc.idx makeindex -s minitoc.ist -o minitoc.ind minitoc.idx mv minitoc.ilg minitoc.ilg1 # pdflatex minitoc.dtx sed -e's/:>/=/' < minitoc.idx > minitoc.idx1; mv minitoc.idx1 minitoc.idx endif # french documentation if ( -f fminitoc.dtx ) then if ( -f fminitoc.maf ) then cat fminitoc.maf | xargs -i -t \rm {} endif echo 'Creating the french documentation...' # create the french documentation (DVI): 4 latex runs, with index and biblio latex fminitoc.dtx sed -e's/:>/=/' < fminitoc.idx > fminitoc.idx1; mv fminitoc.idx1 fminitoc.idx bibtex fminitoc makeindex -s fminitoc.ist -o fminitoc.ind fminitoc.idx mv fminitoc.ilg fminitoc.ilg1 # latex fminitoc.dtx sed -e's/:>/=/' < fminitoc.idx > fminitoc.idx1; mv fminitoc.idx1 fminitoc.idx makeindex -s fminitoc.ist -o fminitoc.ind fminitoc.idx mv fminitoc.ilg fminitoc.ilg1 # latex fminitoc.dtx sed -e's/:>/=/' < fminitoc.idx > fminitoc.idx1; mv fminitoc.idx1 fminitoc.idx makeindex -s fminitoc.ist -o fminitoc.ind fminitoc.idx mv fminitoc.ilg fminitoc.ilg1 # latex fminitoc.dtx sed -e's/:>/=/' < fminitoc.idx > fminitoc.idx1; mv fminitoc.idx1 fminitoc.idx cp fminitoc.log ps-fminitoc.log # convert the .dvi into PostScript dvips -h $HEADER -o fminitoc.ps fminitoc # create the french documentation (PDF): 4 pdflatex runs, with index and biblio pdflatex fminitoc.dtx sed -e's/:>/=/' < fminitoc.idx > fminitoc.idx1; mv fminitoc.idx1 fminitoc.idx bibtex fminitoc makeindex -s fminitoc.ist -o fminitoc.ind fminitoc.idx mv fminitoc.ilg fminitoc.ilg1 # pdflatex fminitoc.dtx sed -e's/:>/=/' < fminitoc.idx > fminitoc.idx1; mv fminitoc.idx1 fminitoc.idx makeindex -s fminitoc.ist -o fminitoc.ind fminitoc.idx mv fminitoc.ilg fminitoc.ilg1 # pdflatex fminitoc.dtx sed -e's/:>/=/' < fminitoc.idx > fminitoc.idx1; mv fminitoc.idx1 fminitoc.idx makeindex -s fminitoc.ist -o fminitoc.ind fminitoc.idx mv fminitoc.ilg fminitoc.ilg1 # pdflatex fminitoc.dtx sed -e's/:>/=/' < fminitoc.idx > fminitoc.idx1; mv fminitoc.idx1 fminitoc.idx else echo 'French is still missing' endif # composition ####################### foreach f ( mtc-add mtc-ads ) foreach i ( 1 2 3 ) pdflatex $f bibtex $f if ( -e $f.idx ) then makeindex -s gind.ist -o $f.ind $f.idx endif if ( -e $f.glo ) then makeindex -s gglo.ist -o $f.gls $f.glo endif end if ( -e $f.maf ) then \rm -f `cat $f.maf` $f.aux $f.log $f.toc $f.bbl $f.blg $f.lof $f.lot $f.ind $f.idx $f.ind $f.maf endif end ####################### foreach f ( mtc-hi1 mtc-hi2 mtc-apx mtc-amm mtc-mem mtc-mm1 mtc-fo1 mtc-fo2 mtc-scr mtc-sbf \ mtc-tsf mtc-tbi mtc-2c mtc-bo mtc-hop mtc-cri mtc-liv mtc-ch0 mtc-tlc mtc-mu mtc-hir mtc-hia mtc-gap \ mtc-bk mtc-art mtc-2nd mtc-syn ) foreach i ( 1 2 3 ) pdflatex $f end if ( -e $f.maf ) then \rm -f `cat $f.maf` $f.aux $f.log $f.toc $f.bbl $f.blg $f.lof $f.lot $f.ind $f.idx $f.ind $f.maf endif end # repartition echo 'Repartition of files into classes' set WCL=/tmp/$w/CL foreach i ( 0 1 2 3 4 5 6 7 8 9 ) if ( -e ${WCL}$i ) then \rm -rf ${WCL}$i endif if ( -d ${WCL}$i ) then \rm -rf ${WCL}$i/* rmdir ${WCL}$i else mkdir -p ${WCL}$i endif end # class 0 echo 'Class 0' cp minitoc.dtx minitoc.ins fminitoc.dtx ${WCL}0 # class 1 echo 'Class 1' cp minitoc.sty mtcoff.sty mtcmess.sty mtcpatchmem.sty ${WCL}1 cp *.mld *.mlo ${WCL}1 # class 2 echo 'Class 2' cp INSTALL minitoc.l README catalog TODO ${WCL}2 # class 3 echo 'Class 3' cp mtc-add.bib ${WCL}3 foreach i ( tex pdf ) cp mtc-bk.$i mtc-art.$i mtc-add.$i mtc-ads.$i ${WCL}3 cp mtc-hi1.$i mtc-hi2.$i mtc-apx.$i mtc-amm.$i mtc-mem.$i mtc-mm1.$i ${WCL}3 cp mtc-fo1.$i mtc-fo2.$i mtc-scr.$i mtc-sbf.$i mtc-tsf.$i mtc-tbi.$i mtc-2c.$i mtc-bo.$i mtc-hop.$i mtc-cri.$i ${WCL}3 cp mtc-liv.$i mtc-ch0.$i mtc-tlc.$i mtc-mu.$i mtc-hir.$i mtc-hia.$i ${WCL}3 cp mtc-gap.$i mtc-2nd.$i mtc-syn.$i ${WCL}3 end # class 4 echo 'Class 4' cp minitoc.bug minitoc.sum ${WCL}4 # class 5 echo 'Class 5' cp minitoc.dtx minitoc.ins minitoc.bib minitoc.ist minitoc.lan en-mtc.bst ${WCL}5 cp lamed.eps lamed.pdf lamed.tex ${WCL}5 # class 6 echo 'Class 6' cp minitoc.dtx fminitoc.dtx fminitoc.bib fminitoc.ist fminitoc.lan minitoc.pre ${WCL}6 cp franc.sty frbib.sty frnew.sty fr-mtc.bst ${WCL}6 # class 7 echo 'Class 7' cp minitoc.pdf minitoc.ps ${WCL}7 # class 8 echo 'Class 8' cp fminitoc.pdf fminitoc.ps ${WCL}8 # class 9 echo 'Class 9' cp pmk imk emk fmk rmk xmk duplex2v.pro ${WCL}9 # Cleaning echo "Cleaning" if ( -f minitoc.maf ) then cat minitoc.maf | xargs -i -t \rm {} endif if ( -f fminitoc.maf ) then cat fminitoc.maf | xargs -i -t \rm {} endif # it's all! echo "It's all, folks..." exit