[MOBY-dev] [moby] [MOBY-guts] biomoby commit
Mark Wilkinson
markw at illuminae.com
Thu Feb 2 18:09:49 UTC 2006
Thanks Frank!!!
I take it I can now remove the HTML documentation from the CVS tree as
well?
Halleluja!!
M
On Thu, 2006-02-02 at 13:12 -0500, Frank Gibbons wrote:
> fgibbons
> Thu Feb 2 13:12:31 EST 2006
> Update of /home/repository/moby/moby-live/Perl
> In directory pub.open-bio.org:/tmp/cvs-serv2194
>
> Modified Files:
> Makefile.PL
> Log Message:
> - New & improved!
> - Added extra rules to generate HTML from Perl modules.
> * Docs now live in separate tree from source, defaulting to "docs/html"
> * The doc-tree is built automatically, and echoes the source tree.
> * HTML is generated from the default rule (just type 'make').
> * HTML can also be generated specifically by typing 'make html'.
> * New rules incorporate dependencies between each module and its HTML.
> * New HTML is generated only if the perl module has been changed.
> - Your source tree lives under "MOBY". The "lib/MOBY" duplicate tree,
> which was formerly required, and auto-generated by the Makefile,
> is no longer used. To avoid confusion you should delete it.
>
> moby-live/Perl Makefile.PL,1.10,1.11
> ===================================================================
> RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v
> retrieving revision 1.10
> retrieving revision 1.11
> diff -u -r1.10 -r1.11
> --- /home/repository/moby/moby-live/Perl/Makefile.PL 2005/12/22 00:08:44 1.10
> +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2006/02/02 18:12:31 1.11
> @@ -1,11 +1,15 @@
> use ExtUtils::MakeMaker;
> use FindBin '$Bin';
>
> -my $VERSION = '0.1';
> +my $VERSION = '0.87';
>
> -system "mkdir lib" unless (-e 'lib' && -d 'lib'); # put the files into the lib directory so that they will be properly installed
> -system "cp -rf MOBY lib";
> -system q{xcopy /E MOBY .\lib\MOBY\ };
> +# Anyone know why it was ever necessary to copy everything in "lib"?
> +#system "mkdir lib" unless (-e 'lib' && -d 'lib'); # put the files into the lib directory so that they will be properly installed
> +#my $os = $^O;
> +#if ($os =~ /(linux|unix)/) { system "cp -rf MOBY lib"; }
> +#elsif ($os =~ /ms.*win/i) { # windows only, usually $^O="mswin32", is this true on all Windows?
> +# system q{xcopy /E MOBY .\lib\MOBY\ };
> +#}
>
> #my $WWW_ROOT_PATH = "/usr/local/apache" ;
> #my $CGI_BIN = "cgi-bin" ;
> @@ -71,21 +75,91 @@
> # See lib/ExtUtils/MakeMaker.pm for details of how to influence
> # the contents of the Makefile that is written.
>
> +sub MY::postamble {
> + use Pod::Find qw(pod_find simplify_name);
> + use Cwd;
> + my $cur_dir = getcwd();
> + # Find the files that contain POD, starting from the top-level build directory, and do it silently.
> + my %pods = pod_find({ -verbose => 0},
> + File::Spec->catfile($cur_dir, "MOBY") );
> + my @PM = sort keys %pods;
> + # Make home for all docs
> + my $HTML_ROOT = File::Spec->catfile($cur_dir, qw(docs html));
> + mkdir File::Spec->catfile($cur_dir, "docs")
> + unless -e File::Spec->catfile($cur_dir, "docs");
> + mkdir $HTML_ROOT unless -e $HTML_ROOT;
> + # Create a new directory tree for the documentation, that mirrors the source tree.
> + use File::Find;
> + sub wanted { # Define nested subroutine, to inherit variable scope
> + my $src_dir = $File::Find::dir;
> + (my $doc_dir = $src_dir) =~ s/$cur_dir/$HTML_ROOT/;
> + if (!(-e $doc_dir) && !($doc_dir =~ /CVS$/)) {
> + my $made_dir = mkdir $doc_dir;
> + if (!$made_dir) { print STDERR "Couldn't create directory '$doc_dir' because '$OS_ERROR'"; }
> + }
> + }
> + find(\&wanted, File::Spec->catfile($cur_dir, "MOBY"));
> + # Finally, start writing the rules.
> + # Let's make a big rule to build all the docs at once, call it 'html'
> + # Then other little rules to keep each PM-file's docs up to date, without having to build everything.
> + my @HTML = map { # Edit beginning and end of PM files, to make HTML filenames
> + my $x = $_; # Don't want to change the original...
> + $x =~ s/\.p[lm]$/\.html/;
> + $x =~ s/^$cur_dir/$HTML_ROOT/;
> + $x} @PM;
> + my $postamble = "# Rules to keep developer docs up-to-date.\n";
> + $postamble .= "POD_TO_HTML = " . join("\\\n", @HTML)
> + . "\n\nhtml: \$(POD_TO_HTML)\n\n";
> +
> + # Now, finally, we build rules for the makefile.
> + # The TAB ('\t') characters are essential, otherwise 'make' will silently ignore the rules.
> + # Don't be tempted to remove them.
> + for (my $i = 0; $i < @PM; $i++) {
> + $postamble .= <<RULE
> +$HTML[$i]:$PM[$i]
> + \$(NOECHO) pod2html --outfile=$HTML[$i] $PM[$i]
> + \$(NOECHO) \$(ECHO) Generating HTML for $PM[$i]
> +
> +RULE
> + }
> + return $postamble;
> +}
> +
> +# Override built-in target, by adding the 'html' dependency
> +# Now HTML gets updated every time you type "make"
> +sub MY::top_targets {
> + my $self = shift;
> + my $string = $self->MM::top_targets;
> + my $add = 'html';
> + $string =~ s/(pure_all\s+)(.*)/$1 $add $2/;
> + return $string;
> +}
> +
> +#sub MY::install {
> +# my $self = shift;
> +# my $string = $self->MM::install;
> +# my $add = 'html';
> +# $string =~ s/(pure_install\s+)(.*)/$1 $add $2/;
> +# print "INSTALL: $string\n";
> +# return $string;
> +#}
> +
> WriteMakefile(
> - 'NAME' => 'MOBY-S',
> - 'VERSION' => $VERSION,
> - 'PREREQ_PM' => {
> - 'SOAP::Lite' => 0.55,
> - 'XML::LibXML' => 1.58,
> - 'Text::Shellwords' => 1.00,
> - 'SOAP::MIME' => 0.55,
> - 'XML::XPath' => 1.12,
> - # 'LS::ID' => 1.1.1,
> + NAME => 'MOBY-S',
> + VERSION => $VERSION,
> + PMLIBDIRS => ['MOBY'], #Get code from "MOBY", not "lib/MOBY"
> + PREREQ_PM => {
> + SOAP::Lite => 0.55,
> + SOAP::MIME => 0.55,
> + XML::LibXML => 1.58,
> + XML::XPath => 1.12,
> + Text::Shellwords => 1.00,
> + # LS::ID => 1.1.1,
> }, # e.g., Module::Name => 1.1
> - #'PM_FILTER' => "",
> + #PM_FILTER => "",
> ($] >= 5.005 ? ## Add these new keywords supported since 5.005
> - (ABSTRACT => 'Perl module binding for MOBY-S',
> - AUTHOR => 'Mark Wilkinson [markw at illuminae.com]') : ()),
> + (ABSTRACT => 'Perl binding for MOBY-S, a web-services toolkit for exchanging bioinformatic data',
> + AUTHOR => 'Mark Wilkinson [markw at illuminae.com] and the BioMOBY Core Developers') : ()),
> );
>
> #
>
> _______________________________________________
> MOBY-guts mailing list
> MOBY-guts at biomoby.org
> http://biomoby.org/mailman/listinfo/moby-guts
--
--
...his last words were 'Hey guys! Watch this!'
--
Mark Wilkinson
Asst. Professor
Dept. of Medical Genetics
University of British Columbia
PI in Bioinformatics
iCAPTURE Centre
St. Paul's Hospital
Rm. 166, 1081 Burrard St.
Vancouver, BC, V6Z 1Y6
tel: 604 682 2344 x62129
fax: 604 806 9274
"For most of this century we have viewed communications as a conduit,
a pipe between physical locations on the planet.
What's happened now is that the conduit has become so big and interesting
that communication has become more than a conduit,
it has become a destination in its own right..."
Paul Saffo - Director, Institute for the Future
More information about the MOBY-dev
mailing list