#! /bin/csh
# set x
# set verbose
set UN=`whoami`.tmk
set RD=/tmp/$UN
if ( -d $RD ) then
else
   mkdir -m 755 $RD
endif
set TDSDIR=tds
set TDS=$RD/$TDSDIR
echo "BIB files"
if ( -d $TDS ) then
else
   mkdir -m 755 $TDS
endif
if ( -d $TDS/bibtex ) then
else
   mkdir -m 755 $TDS/bibtex
endif
if ( -d $TDS/bibtex/bib ) then
else
   mkdir -m 755 $TDS/bibtex/bib
endif
if ( -d $TDS/bibtex/bib/minitoc ) then
   \rm -rf $TDS/bibtex/bib/minitoc
endif
mkdir -m 755 $TDS/bibtex/bib/minitoc
foreach i ( minitoc-fr.bib minitoc.bib )
   cp $i $TDS/bibtex/bib/minitoc
   chmod 744 $TDS/bibtex/bib/minitoc/$i
end
#
echo "BST files"
if ( -d $TDS/bibtex/bst ) then
else
   mkdir -m 755 $TDS/bibtex/bst
endif
if ( -d $TDS/bibtex/bst/minitoc ) then
   \rm -rf $TDS/bibtex/bst/minitoc
endif
mkdir -m 755 $TDS/bibtex/bst/minitoc
foreach i ( en-mtc.bst fr-mtc.bst)
   cp $i $TDS/bibtex/bst/minitoc
   chmod 744 $TDS/bibtex/bst/minitoc/$i
end
#
echo "SCRIPT files"
if ( -d $TDS/scripts ) then
else
   mkdir -m 755 $TDS/scripts
endif
if ( -d $TDS/scripts/minitoc ) then
   \rm -rf $TDS/scripts/minitoc
endif
mkdir -m 755 $TDS/scripts/minitoc
foreach i ( emk fmk imk pmk rmk tmk cmk xmk )
   cp $i $TDS/scripts/minitoc
   chmod 755 $TDS/scripts/minitoc/$i
end
#
echo "DVIPS files"
if ( -d $TDS/dvips ) then
else
   mkdir -m 755 $TDS/dvips
endif
if ( -d $TDS/dvips/minitoc ) then
   \rm -rf $TDS/dvips/minitoc
endif
#
echo "INDEXING files"
if ( -d $TDS/makeindex ) then
else
   mkdir -m 755 $TDS/makeindex
endif
if ( -d $TDS/makeindex/minitoc ) then
   \rm -rf $TDS/makeindex/minitoc
endif
mkdir -m 755 $TDS/makeindex/minitoc
foreach i ( minitoc-fr.ist minitoc.ist )
   cp $i $TDS/makeindex/minitoc
   chmod 744 $TDS/makeindex/minitoc/$i
end
#
echo "LATEX files"
if ( -d  $TDS/tex ) then
else
   mkdir -m 755 $TDS/tex
endif
if ( -d $TDS/tex/latex ) then
else
   mkdir -m 755 $TDS/tex/latex
endif
if ( -d $TDS/tex/latex/minitoc ) then
   \rm -rf $TDS/tex/latex/minitoc
endif
mkdir -m 755 $TDS/tex/latex/minitoc
foreach i ( \
UKenglish.mld \
USenglish.mld \
acadian.mld \
acadien.mld \
afrikaan.mld \
afrikaans.mld \
albanian.mld \
american.mld \
arab.mld \
arab2.mld \
arabi.mld \
arabic.mld \
armenian.mld \
australian.mld \
austrian.mld \
bahasa.mld \
bahasai.mld \
bahasam.mld \
bangla.mld \
basque.mld \
bengali.mld \
bicig.mld \
bicig2.mld \
bicig3.mld \
bithe.mld \
brazil.mld \
brazilian.mld \
breton.mld \
british.mld \
bulgarian.mld \
bulgarianb.mld \
buryat.mld \
buryat2.mld \
canadian.mld \
canadien.mld \
castillan.mld \
castillian.mld \
catalan.mld \
chinese1.mld \
chinese1.mlo \
chinese2.mld \
chinese2.mlo \
croatian.mld \
czech.mld \
danish.mld \
devanagari.mld \
dutch.mld \
english.mld \
english1.mld \
english2.mld \
esperant.mld \
esperanto.mld \
estonian.mld \
ethiopia.mld \
ethiopian.mld \
ethiopian2.mld \
farsi1.mld \
farsi1.mlo \
farsi2.mld \
farsi2.mlo \
farsi3.mld \
finnish.mld \
finnish2.mld \
francais.mld \
french.mld \
french1.mld \
french2.mld \
frenchb.mld \
frenchle.mld \
frenchpro.mld \
galician.mld \
german.mld \
germanb.mld \
germanb2.mld \
greek-mono.mld \
greek-polydemo.mld \
greek-polykatha.mld \
greek.mld \
guarani.mld \
hangul-u8.mld \
hangul-u8.mlo \
hangul1.mld \
hangul1.mlo \
hangul2.mld \
hangul2.mlo \
hangul3.mld \
hangul3.mlo \
hangul4.mld \
hangul4.mlo \
hanja-u8.mld \
hanja-u8.mlo \
hanja1.mld \
hanja1.mlo \
hanja2.mld \
hanja2.mlo \
hebrew.mld \
hebrew2.mld \
hindi-modern.mld \
hindi.mld \
hungarian.mld \
icelandic.mld \
indon.mld \
indonesian.mld \
interlingua.mld \
irish.mld \
italian.mld \
italian2.mld \
japanese.mld \
japanese.mlo \
japanese2.mld \
japanese2.mlo \
japanese3.mld \
japanese3.mlo \
japanese4.mld \
japanese4.mlo \
japanese5.mld \
japanese5.mlo \
japanese6.mld \
japanese6.mlo \
kannada.mld \
khalkha.mld \
latin.mld \
latin2.mld \
latinc.mld \
latinc2.mld \
latvian.mld \
latvian2.mld \
letton.mld \
letton2.mld \
lithuanian.mld \
lithuanian2.mld \
lowersorbian.mld \
lsorbian.mld \
magyar.mld \
magyar2.mld \
magyar3.mld \
malay.mld \
malayalam-b.mld \
malayalam-keli.mld \
malayalam-keli2.mld \
malayalam-mr.mld \
malayalam-omega.mld \
malayalam-omega.mlo \
malayalam-rachana.mld \
malayalam-rachana2.mld \
malayalam-rachana3.mld \
manju.mld \
mexican.mld \
meyalu.mld \
minitoc.sty \
mongol.mld \
mongolb.mld \
mongolian.mld \
mtcmess.sty \
mtcoff.sty \
mtcpatchmem.sty \
naustrian.mld \
newzealand.mld \
ngerman.mld \
ngermanb.mld \
ngermanb2.mld \
norsk.mld \
norsk2.mld \
nynorsk.mld \
nynorsk2.mld \
occitan.mld \
occitan2.mld \
polish.mld \
polish2.mld \
polski.mld \
portuges.mld \
portuguese.mld \
romanian.mld \
romanian2.mld \
romanian3.mld \
russian-cca.mld \
russian-cca.mlo \
russian-cca1.mld \
russian-cca1.mlo \
russian-lh.mld \
russian-lh.mlo \
russian-lhcyralt.mld \
russian-lhcyralt.mlo \
russian-lhcyrkoi.mld \
russian-lhcyrkoi.mlo \
russian-lhcyrwin.mld \
russian-lhcyrwin.mlo \
russian.mld \
russian2m.mld \
russian2o.mld \
russianb.mld \
russianc.mld \
samin.mld \
scottish.mld \
serbian.mld \
serbianc.mld \
slovak.mld \
slovene.mld \
spanish.mld \
spanish2.mld \
spanish3.mld \
spanish4.mld \
swahili.mld \
swedish.mld \
swedish2.mld \
thai.mld \
thai.mlo \
turkish.mld \
uighur.mld \
uighur2.mld \
uighur3.mld \
ukraineb.mld \
ukrainian.mld \
uppersorbian.mld \
usorbian.mld \
vietnam.mld \
vietnamese.mld \
welsh.mld \
xalx.mld \
xalx2.mld \
xalx3.mld \
)
   cp $i $TDS/tex/latex/minitoc
   chmod 744 $TDS/tex/latex/minitoc/$i
end
#
## echo "TPM file"
## if ( -d $TDS/tpm ) then
## else
##    mkdir -m 755 $TDS/tpm
## endif
## cp minitoc.tpm $TDS/tpm/minitoc.tpm
## chmod 744 $TDS/tpm/minitoc.tpm
#
echo "DOCUMENTATION files"
if ( -d $TDS/doc ) then
else
   mkdir -m 755 $TDS/doc
endif
if ( -d $TDS/doc/latex ) then
else
   mkdir -m 755 $TDS/doc/latex
endif
if ( -d $TDS/doc/latex/minitoc ) then
   \rm -rf $TDS/doc/latex/minitoc
endif
mkdir -m 755 $TDS/doc/latex/minitoc
foreach i ( \
INSTALL \
README \
TODO \
CATALOG \
minitoc-fr.lan \
minitoc-fr.pdf \
minitoc.bug \
minitoc.l \
minitoc.lan \
minitoc.pdf \
minitoc.pre \
minitoc.sum \
franc.sty \
frbib.sty \
frnew.sty \
)
   cp $i $TDS/doc/latex/minitoc
end
echo "EXAMPLE files"
mkdir -m 755 $TDS/doc/latex/minitoc/examples
foreach i ( \
mtc-2c.pdf \
mtc-2c.tex \
mtc-2nd.pdf \
mtc-2nd.tex \
mtc-3co.pdf \
mtc-3co.tex \
mtc-add.pdf \
mtc-add.tex \
mtc-add.bib \
mtc-ads.pdf \
mtc-ads.tex \
mtc-amm.pdf \
mtc-amm.tex \
mtc-apx.pdf \
mtc-apx.tex \
mtc-art.pdf \
mtc-art.tex \
mtc-bk.pdf \
mtc-bk.tex \
mtc-bo.pdf \
mtc-bo.tex \
mtc-ch0.pdf \
mtc-ch0.tex \
mtc-cri.pdf \
mtc-cri.tex \
mtc-fko.pdf \
mtc-fko.tex \
mtc-fo1.pdf \
mtc-fo1.tex \
mtc-fo2.pdf \
mtc-fo2.tex \
mtc-gap.pdf \
mtc-gap.tex \
mtc-hi1.pdf \
mtc-hi1.tex \
mtc-hi2.pdf \
mtc-hi2.tex \
mtc-hia.pdf \
mtc-hia.tex \
mtc-hir.pdf \
mtc-hir.tex \
mtc-hop.pdf \
mtc-hop.tex \
mtc-liv.pdf \
mtc-liv.tex \
mtc-mem.pdf \
mtc-mem.tex \
mtc-mm1.pdf \
mtc-mm1.tex \
mtc-mu.pdf \
mtc-mu.tex \
mtc-nom.pdf \
mtc-nom.tex \
mtc-ocf.pdf \
mtc-ocf.tex \
mtc-ofs.pdf \
mtc-ofs.tex \
mtc-sbf.pdf \
mtc-sbf.tex \
mtc-scr.pdf \
mtc-scr.tex \
mtc-syn.pdf \
mtc-syn.tex \
mtc-tbi.pdf \
mtc-tbi.tex \
mtc-tlc.pdf \
mtc-tlc.tex \
mtc-tsf.pdf \
mtc-tsf.tex \
mtc-vti.pdf \
mtc-vti.tex \
)
cp $i $TDS/doc/latex/minitoc/examples
end
echo "IMAGE files"
mkdir -m 755 $TDS/doc/latex/minitoc/images
foreach i ( \
aaland-f.png \
acadian-m.pdf \
acadie-f.png \
acadien-m.pdf \
afghan-f.png \
africa-lf.png \
africa-lo.pdf \
afrsud-l.pdf \
afrsud-p.pdf \
albania.pdf \
albania-f.png\
alb2.png \
alba-eth.pdf \
algeria-f.png \
allemand.jpg \
alsace-f.png \
andorra-f.png \
argentina-f.png \
anglo1.pdf \
angola-f.png \
arab-l.jpg \
arabw.png \
armenia-f.png \
armeniad.pdf \
armenian-l.png \
armeniar.jpg \
aruba-f.png \
australia-f.png \
austria-f.png \
azerbaijan-f.png \
bahamas-f.png \
bahrain-f.png \
baltes.jpg \
bangla.png \
bangla1.png \
bangla2.png \
bangladesh-f.png \
barbados-f.png \
basque-de.png \
basque-df.png \
basque1.pdf \
basque2.pdf \
be-dg-f.png \
belarus-f.png \
belgique.pdf \
belgium-f.png \
belize-f.png \
bengali-m.jpg \
benin-f.png \
bolivia-f.png \
bolzano-f.png \
bosnia.pdf \
bosnia-hz-f.png \
bozen-f.png \
brazil.pdf \
brazil-f.png \
brazilp.pdf \
bretagne.pdf \
brussels-f.png \
bulgaria-f.png \
bulgariar.jpg \
bulgarski.png \
bulgmap.png \
bur-f.png \
burkina-f.png \
burundi-f.png \
buryatia.pdf \
buryatia-l.pdf \
california-f.png \
cambodia-f.png \
cameroon-f.png \
canada.pdf \
canada-f.png \
canada-l.pdf \
canada-pe.png \
canada-pf.pdf \
canada1.pdf \
cap-verde-f.png \
castille-f.png \
catalan-d.pdf \
catalan-p.pdf \
catalonia-f.png \
caucasus.pdf \
central-africa-f.png \
chad-f.png \
chile-f.png \
china-ae.png \
china-af.png \
china-ch.png \
china-f.png \
china-l.pdf \
china-w.png \
chine1.pdf \
chine2.pdf \
cis-f.png \
colombia-f.png \
comoros-f.png \
congo-f.png \
corsica-f.jpg \
costa-rica-f.jpg \
cplp-0.png \
cplpmap.png \
croatia-f.png \
croatia-un.png \
croatie2.png \
cuba-f.png \
cyprus-f.png \
cyr-alf.png \
cz1.pdf \
cz3.png \
czech-f.png \
czechd.pdf \
dane-f.png \
danemark.jpg \
danishd.pdf \
danishg.pdf \
devanagari.png \
djibouti-f.png \
dominica-f.png \
dominican-f.png \
dutchw.pdf \
east-timor-f.png \
ecosse1.pdf \
ecosse2.pdf \
ecosse3.pdf \
ecuador-f.jpg \
egypt-f.png \
el-salvador-f.png \
england-f.jpg \
equa-guinea-f.png \
eritrea-f.png \
espa-l.pdf \
espa-o.png \
esperanto-f.png \
estonia-a.pdf \
estonia-b.pdf \
estonia-f.png \
eth2.png \
ethiolang.png \
ethiopia.pdf \
ethiopia-f.png \
ethiopia-p.pdf \
euro-lan.png \
euro-lan1.png \
euro-lan2.png \
eusk-f.png \
euskara.png \
faroe-f.png \
farsi.pdf \
farsi-logo.png \
feroe.jpg \
fiji-f.png \
finland-f.png \
finlande1.png \
finlande2.pdf \
finnishd.pdf \
finnishl.pdf \
flanders-f.png \
france-f.png \
france-lr.png \
franco.png \
francophonie-f.png \
gabon-f.png \
gael-ft.pdf \
gaid.jpg \
galicia-f.png \
galicia-m.pdf \
galicia-mp.pdf \
galician-l.png \
galles1.pdf \
galles2.pdf \
georgia-f.png \
germ-w.png \
german-c.pdf \
german-d.pdf \
german-m.pdf \
germany-f.jpg \
ghana-f.png \
gibraltar-f.png \
grece1.pdf \
grece2.pdf \
greece-f.png \
greeka.png \
greekm.jpg \
greenland-f.png \
guatemala-f.jpg \
guinea-bissau-f.png \
guinea-f.png \
gwenn-f.png \
haiti-f.jpg \
hangul.png \
hanja.png \
hanzi.png \
hin.png \
hindi-b.png \
hindi-p.png \
hispano.png \
honduras-f.png \
hrv.png \
hun1.png \
hun2.jpg \
hungary-f.png \
iceland-f.png \
imongolia-f.png \
inde1.pdf \
inde2.jpg \
india-f.png \
indonesia-f.png \
indonesia1.pdf \
indonesia2.pdf \
iran-f.png \
iranian.jpg \
iraq-f.png \
ireland-f.png \
irish.png \
irlande.pdf \
islam-pbc.png \
islam-sw.pdf \
islande.png \
islandep.jpg \
isr1.pdf \
isr2.pdf \
israel-f.png \
italian.pdf \
italy-f.png \
italo1.png \
italysm.png \
ivory-f.png \
ivrit.png \
jamaica-f.png \
japan-f.png \
japon1.pdf \
japon2.jpg \
jordan-f.png \
jutland-f.png \
kannada-n.png \
karnad1.jpg \
karnataka.jpg \
karnataka-f.jpg \
kazakhstan-f.png \
kenya-f.png \
kerala.jpg \
kerala-f.jpg \
khalkha.pdf \
kiribati-f.png \
korea-n-f.png \
korea-s-f.png \
korean1.png \
korean2.jpg \
kos-alb.png \
kos-ml.png \
kosovo-f.png \
kuwait-f.png \
kyrgyzstan-f.png \
lamed3.png \
lang-g.png \
laos-f.png \
latvia-f.png \
latvian-d.png \
latvian-r1.png \
lebanon-f.png \
lettonie.jpg \
leur.png \
liberia-f.png \
libya-f.jpg \
liech-f.png \
lithuania-f.jpg \
lituanie.png \
lorraine-f.jpg \
louisiana-f.png \
ls-f.png \
luso1.pdf \
luso2.pdf \
lux-f.png \
macau-f.png \
macedonia-f.png \
madagascar-f.png \
maine-f.jpg \
malawi-f.png \
malayalam.pdf \
malayalam.png \
malaysia-f.png \
malaysia1.pdf \
malaysia2.pdf \
mali-f.png \
malta1-f.png \
manchu.jpg \
manchuria.jpg \
manjuc.jpg \
manjui.png \
mauritania-f.png \
mauritius-f.png \
mex1.pdf \
mex2.pdf \
mex3.pdf \
mexico-f.jpg \
mexip.pdf \
meyalu.png \
moldova-f.png \
monaco-f.png \
mondep.png \
mongasie.pdf \
mongolcy.png \
mongolia-f.png \
mongolian.pdf \
mongols.png \
mongoltr.png \
montenegro-f.jpg \
morocco-f.png \
mozambique-f.png \
namibia-f.png \
nbrunswick-f.png \
ncyprus-f.png \
neder.pdf \
netherlands-antilles-f.png \
netherlands-f.png \
new-york-f.png \
newzealand-f.png \
nicaragua-f.png \
nice-f.png \
niger-f.png \
nigeria-f.png \
nihongo.png \
norvege-c.pdf \
norvege-t.pdf \
norway-f.png \
norway-p.pdf \
)
cp $i $TDS/doc/latex/minitoc/images
chmod 644 $TDS/doc/latex/minitoc/images/$i
end
#
foreach i ( \
occ-f.png \
occdial1.jpg \
occdial2.png \
occitanie.png \
occtaur.jpg \
oman-f.png \
opole-f.png \
pakistan-f.png \
palestine-f.png \
panama-f.png \
paraguay.png \
paraguay-f.png \
paraguayp.pdf \
peru-f.png \
philippines-f.png \
poland-f.png \
polish-d.jpg \
polmin.jpg \
pologne.pdf \
polski-f.png \
portu-a.png \
portu-b.png \
portu-p.jpg \
portu-r.jpg \
portugal.pdf \
portugal-f.png \
puerto-rico-f.png \
qatar-f.png \
quebec-f.png \
rdcongo-f.png \
romania-f.png \
romanian.pdf \
rus-cyr.png \
rus-re.png \
rus-su.pdf \
russia-f.png \
russian.png \
russian-e.pdf \
russian-n.png \
russian-w.png \
rwanda-f.png \
saint-lucia-f.png \
same.png \
same-f.png \
sami-f.png \
samoa-f.png \
san-marino-f.png \
sao-f.png \
saudi-arabia-f.png \
scotland-f.png \
senegal-f.png \
serb-a.pdf \
serbia-f.png \
serbia-f2.png \
serbia1.pdf \
seychelles-f.png \
singapore-f.png \
slovak-ok.png \
slovakia.pdf \
slovakia-f.png \
slovenia-f.png \
slovenian.png \
slovenie.pdf \
solomon-islands-f.png \
somalia-f.png \
sorabe-1.jpg \
sorabe-2.jpg \
sorben.jpg \
sorbian.jpg \
south-africa-f.png \
spain.png \
spain-f.png \
spilhennig.png \
start.jpg \
stop.png \
sudan-f.png \
suede-a.pdf \
suede-fin.pdf \
suisse-f.png \
suriname-f.png \
svenska.png \
swahili.pdf \
swahili-m.png \
fswahili.pdf \
sweden.pdf \
sweden-f.png \
syria-f.png \
taiwan-f.png \
tajikistan-f.png \
tanzania-f.png \
thai.pdf \
thai.png \
thailand-f.png \
togo-f.png \
tonga-f.png \
tunisia-f.png \
turkey-f.png \
turkish.png \
turkmenistan-f.png \
turquie.pdf \
tuvalu-f.png \
uae-f.png \
uganda-f.png \
uighur-f.png \
uighur.pdf \
uk-f.png \
ukra.png \
ukraine.jpg \
ukraine-f.png \
ukrainep.pdf \
uruguay-f.png \
us-f.png \
usa-f.png \
uzbekistan-f.png \
vanuatu-f.png \
vatican-f.jpg \
venezuela-f.png \
vermont-f.png \
viet2.pdf \
viet3.pdf \
viet4.pdf \
viet-w.pdf \
vietnam-f.png \
vojvodina-f.png \
wales-f.png \
wallonia-f.png \
wallonie.pdf \
wiki.png \
wikif.png \
wrs-a.png \
wrs-c.png \
xinjiang.png \
xinjiangc.png \
xyugo.png \
yemen-f.png \
zambia-f.png \
zanzibar-f.png \
zimbabwe-f.png \
)
cp $i $TDS/doc/latex/minitoc/images
chmod 644 $TDS/doc/latex/minitoc/images/$i
end
#
echo "SOURCE files"
if ( -d $TDS/source ) then
else
   mkdir -m 755 $TDS/source
endif
if ( -d $TDS/source/latex ) then
else
   mkdir -m 755 $TDS/source/latex
endif
if ( -d $TDS/source/latex/minitoc ) then
   \rm -rf $TDS/source/latex/minitoc
endif
mkdir -m 755 $TDS/source/latex/minitoc
foreach i ( minitoc-fr.dtx minitoc.dtx minitoc.ins )
   cp $i $TDS/source/latex/minitoc
   chmod 744 $TDS/source/latex/minitoc/$i
end
#
echo "MINITOC-TDS.ZIP"
set WD=`pwd`
cd $RD/$TDSDIR
\rm -f minitoc-tds.zip
\rm -f minitoc.tds.zip
zip -r minitoc.tds.zip * -i \*
cd $WD
