#!/usr/local/bin/perl # # ndbdoxy.pl Executes doxygen on a checked out version of NDB Cluster # # Written by Lars Thalmann, 2003. use strict; umask 000; # ----------------------------------------------------------------------------- # Settings # ----------------------------------------------------------------------------- my $root = "/home/elathal/public_html/cvsdoxy"; $ENV{LD_LIBRARY_PATH} = "/usr/local/lib:/opt/as/local/lib"; $ENV{LD_LIBRARY_PATH} = $ENV{LD_LIBRARY_PATH} . ":/opt/as/forte6/SUNWspro/lib"; $ENV{PATH} = $ENV{PATH} . ":/usr/local/bin:/opt/as/local/bin"; $ENV{PATH} = $ENV{PATH} . ":/opt/as/local/teTeX/bin/sparc-sun-solaris2.8"; my $DOXYGEN = "doxygen"; my $PDFLATEX = "pdflatex"; my $MAKEINDEX = "makeindex"; # ----------------------------------------------------------------------------- # Argument handling # ----------------------------------------------------------------------------- if (@ARGV != 3) { print< <version> where <module> is cvsdoxy module to doxgenify <title> is title of report <version> is version of NDB Cluster END exit; } my $module = $ARGV[0]; my $title = $ARGV[1]; my $version = $ARGV[2]; my $destdir = "."; # ----------------------------------------------------------------------------- # Execute Doxygen -g # ----------------------------------------------------------------------------- if (-r "${root}/doxyfiles/${module}.doxyfile") { system("cd ${destdir}; \ cp ${root}/doxyfiles/${module}.doxyfile Doxyfile"); } elsif (-r "${root}/doxyfiles/default.doxyfile") { system("cd ${destdir}; \ cp ${root}/doxyfiles/default.doxyfile Doxyfile"); } else { system("cd ${destdir}; $DOXYGEN -g"); } # ----------------------------------------------------------------------------- # HTML Footer # ----------------------------------------------------------------------------- if (-r "${root}/doxyfiles/htmlfooter") { system("cd ${destdir}; \ cp ${root}/doxyfiles/htmlfooter footer.html"); open (INFILE, "< ${destdir}/footer.html") or die "Error opening ${destdir}/footer.html.\n"; open (OUTFILE, "> ${destdir}/footer.html.new") or die "Error opening ${destdir}/footer.html.new.\n"; while (<INFILE>) { if (/(.*)DATE(.*)$/) { print OUTFILE $1 . localtime() . $2; } else { print OUTFILE; } } close INFILE; close OUTFILE; system("mv ${destdir}/footer.html.new ${destdir}/footer.html"); } else { print("Warning: No ${root}/doxyfiles/${module}.htmlfooter"); } # ----------------------------------------------------------------------------- # Execute Doxygen # ----------------------------------------------------------------------------- system("cd ${destdir}; $DOXYGEN"); # ----------------------------------------------------------------------------- # Change a little in refman.tex # ----------------------------------------------------------------------------- open (INFILE, "< ${destdir}/latex/refman.tex") or die "Error opening ${destdir}/latex/refman.tex.\n"; open (OUTFILE, "> ${destdir}/latex/refman.tex.new") or die "Error opening ${destdir}/latex/refman.tex.new.\n"; while (<INFILE>) { if (/(.*)Reference Manual(.*)$/) { print OUTFILE $1 . "\\mbox{}\\vspace{-3cm}\\mbox{}" . "\\hrule\\bigskip\\bigskip\\bigskip\\bigskip" . "\\Huge{" . $title . "}" . $2; } elsif (/(.*)Generated by Doxygen 1.2.1[0-9](.*)$/) { print OUTFILE $1 . "\\begin{center}" . "\\LARGE{MySQL AB}" . "\\end{center}". "\\hfill\\bigskip\\bigskip\\bigskip\\hrule" . "\\bigskip\\bigskip\\bigskip\\bigskip\\bigskip" . "\\bigskip\\bigskip\\bigskip\\bigskip\\bigskip" . "\\bigskip\\bigskip NDB Cluster Release " . $version . "\\bigskip\\bigskip\\bigskip\\bigskip\\bigskip\\hfill" . $2; } elsif (/\\chapter\{File Index\}/) { print OUTFILE "\%\\chapter{File Index}\n"; } elsif (/\\input{files}/) { print OUTFILE "\%\\input{files}\n"; } elsif (/\\chapter\{Page Index\}/) { print OUTFILE "\%\\chapter{Page Index}\n"; } elsif (/\\input{pages}/) { print OUTFILE "\%\\input{pages}\n"; } else { print OUTFILE; } } close INFILE; close OUTFILE; system("mv ${destdir}/latex/refman.tex.new ${destdir}/latex/refman.tex"); # ----------------------------------------------------------------------------- # Change a little in doxygen.sty # ----------------------------------------------------------------------------- open (INFILE, "< ${destdir}/latex/doxygen.sty") or die "Error opening INFILE.\n"; open (OUTFILE, "> ${destdir}/latex/doxygen.sty.new") or die "Error opening OUTFILE.\n"; while (<INFILE>) { if (/\\rfoot/) { print OUTFILE "\\rfoot[\\fancyplain{}{\\bfseries\\small \\copyright~Copyright 2003 MySQL AB\\hfill support-cluster\@mysql.com}]{}\n"; } elsif (/\\lfoot/) { print OUTFILE "\\lfoot[]{\\fancyplain{}{\\bfseries\\small support-cluster\@mysql.com\\hfill \\copyright~Copyright 2003 MySQL AB}}\n"; } else { print OUTFILE; } } close INFILE; close OUTFILE; system("mv ${destdir}/latex/doxygen.sty.new ${destdir}/latex/doxygen.sty"); # ----------------------------------------------------------------------------- # Other # ----------------------------------------------------------------------------- #system("cd ${root}/tmp/${module}; \ # mkdir html.tar; \ # cd html.tar; \ # cp -r ../html ${module}; \ # tar cf ${module}.html.tar ${module}; \ # /usr/local/bin/gzip ${module}.html.tar; \ # /bin/rm -rf ${root}/tmp/${module}/html.tar/${module}"); #system("cd ${destdir}/latex/; \ # $PDFLATEX refman.tex \ # $MAKEINDEX refman.idx \ # $PDFLATEX refman.tex \ # mv -f refman.pdf ${module}.pdf"); print<<END; Execute: latex refman; makeindex refman; latex refman END