#!/bin/csh -f # smkg -- new version of mkg: script for "building" a regular GELLMU article # # IMPORTANT: The sgmlspl script "xxmlgart.pl" requires a version of SGMLS.pm # (the one file) that has been supplemented to provide the method # $element->defempty . # set isok=1 set gdir=~hammond/public_html/gellmu if ($?GELLMU_Dir) then set gdir="$GELLMU_Dir" endif set pname=`basename $0` if (!((-d "$gdir/xml") && (-x "$gdir/xml"))) then echo "${pname}: No subdirectory "xml" in $gdir" exit 1 endif set xgdir="${gdir}/xml" set g2s="${gdir}/bin/g2s" set nsgmls="/usr/local/xml/bin/nsgmls -l -oempty -c ${gdir}/catalog" set xnsgmls="/usr/local/xml/bin/nsgmls -l -oempty -wxml -c ${xgdir}/catalog" set tname="/tmp/${pname}$$" setenv PERL5LIB "/usr/local/xml/lib/perl" if ($#argv != 1) then echo "Usage: $pname " exit endif $g2s "$1" if !($status == 0) then echo "${pname}: $g2s failed." exit 1 endif chmod 644 "${1}.glm" "${1}.sgml" echo "Making XML from ${1}.sgml" rm -f "${1}.xml~" if(-r "${1}.xml") mv "${1}.xml" "${1}.xml~" $nsgmls "${1}.sgml" | sgmlspl "${gdir}/xmlgart.pl" > "${1}.xml" if ($status != 0) then echo "${pname}: sgmlspl with ${gdir}/xmlgart.pl failed" echo " on ${1}.sgml" exit 1 endif chmod 644 "${1}.xml" echo "Validating parse of XML" $xnsgmls "${1}.xml" > "$tname" if ($status != 0) then echo "${pname}: validating parse of ${1}.xml failed" exit 2 endif echo "Making HTML" rm -f "${1}.html~" if(-r "${1}.html") mv "${1}.html" "${1}.html~" sgmlspl < "$tname" ${gdir}/htmlgart.pl > "${1}.html" chmod 644 "${1}.html" echo "Validating HTML" vhtml "${1}.html" if !($status == 0) set isok=0 echo "Making LaTeX" rm -f "${1}.ltx~" if(-r "${1}.ltx") mv "${1}.ltx" "${1}.ltx~" sgmlspl < "$tname" ${gdir}/ltxgart.pl > "${1}.ltx" chmod 644 "${1}.ltx" if ($status == 0) rm "$tname" latex "${1}.ltx" grep -q ' Rerun to get ' "${1}.log" if ($status == 0) latex "${1}.ltx" grep -q ' Rerun to get ' "${1}.log" if ($status == 0) latex "${1}.ltx" if !($status == 0) set isok=0 chmod 644 "${1}.dvi" if !($status == 0) set isok=0 # if($isok == 1) rm "${1}.sgml" if($isok == 1) echo "OK\!"