[MOBY-guts] biomoby commit
Eddie Kawas
kawas at dev.open-bio.org
Tue Aug 28 22:31:56 UTC 2007
kawas
Tue Aug 28 18:31:55 EDT 2007
Update of /home/repository/moby/moby-live/Perl
In directory dev.open-bio.org:/tmp/cvs-serv21887
Modified Files:
Makefile.PL
Log Message:
new dependencies added to further the quest of removing java from the registry
moby-live/Perl Makefile.PL,1.26,1.27
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- /home/repository/moby/moby-live/Perl/Makefile.PL 2007/07/18 10:47:24 1.26
+++ /home/repository/moby/moby-live/Perl/Makefile.PL 2007/08/28 22:31:55 1.27
@@ -3,6 +3,231 @@
use strict;
my $VERSION = '0.87';
+# need a way of relaying the information that LS cannot be found on CPAN
+eval "require LS";
+if ($@) {
+ print STDOUT <<'END_OF_TEXT';
+
+############## IMPORTANT ##############
+Module 'LS' is not installed. Unfortunately, this module is
+not available on CPAN and must be manually installed.
+
+You can try searching Google using the keywords:
+
+ 'perl LS lsid'
+
+or, try downloading it from the following link:
+
+ 'http://sourceforge.net/project/showfiles.php?group_id=130827'
+
+A makefile will not be created ... Sorry.
+
+
+END_OF_TEXT
+
+exit(0);
+}
+
+sub MY::postamble {
+ # Now build documentation.
+ 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;
+ my @MOD_NAMES = map {$pods{$_}} @PM;
+ # Make home for all docs
+ # If we build the home from here, it will only be built when the user runs "perl Makefile.PL"
+ # It's more robust to put it directly into the Makefile,
+ # so that it can be rebuilt with a simple "make" if needed.
+ # But that would require figuring out how to walk a tree from the shell,
+ # and I don't have time for that. Maybe some other day.
+ 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;
+ my @make_dirs_list;
+ 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/;
+# print STDERR "EXamining $doc_dir\n";
+ if ( !($doc_dir =~ /CVS$/) ) {
+ push @make_dirs_list, $doc_dir # Always put into list, whether exists or not, since it goes into a rule
+ unless (grep /^$doc_dir$/, @make_dirs_list); # unless seen already
+ if (!(-e $doc_dir)) {
+ my $made_dir = mkdir $doc_dir;
+ if (!$made_dir) {
+ print STDERR "Couldn't create directory '$doc_dir' because '$!'";
+ }
+ }
+ }
+ }
+ 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";
+# $postamble .= "\n\nHTML_DIRS = " . join(" \\\n", @make_dirs_list) . "\n";
+# . "\n\nhtml:\n"; # \$(HTML_DIRS)
+# $postamble .= "\$(HTML_DIRS):\n\tfor file in "
+# . join(" \\\n", @make_dirs_list) .
+# "\\\n; do \\\n if [! -d \$\$file ] ; then mkdir \$\$file ; fi\\\n done\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) \$(ECHO) Generating HTML for MOBY::$MOD_NAMES[$i]
+ \$(NOECHO) pod2html --htmlroot=$HTML_ROOT --outfile=$HTML[$i] $PM[$i]
+RULE
+ }
+# print "HTML_ROOT: $HTML_ROOT\n";
+ # Auto-generate an index page, with links to the individual POD-generated pages.
+ # Make sure it works on the local filesystem.
+ # Trim HTML files down to relative paths.
+ make_index_page(\@PM ,
+ [ map { my $x= $_; $x =~ s/^$cur_dir\///; $x} @HTML ],
+ \@MOD_NAMES);
+ return $postamble;
+}
+
+
+sub make_index_page {
+ # Generate an index to the auto-generated HTML docs.
+ my ($pms, $html, $mod_names) = @_;
+ open INDEX, ">index.html" or die "Couldn't open index.html ($!)";
+ print INDEX <<HEAD;
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="content-type"
+ content="text/html; charset=ISO-8859-1">
+ <title>MOBY-S Perl Module Documentation</title>
+</head>
+<body>
+<div style="text-align: center;">
+<h1>MOBY-S Perl Modules Documentation</h1>
+</div>
+For an overview of how to do various things in Perl, see the <a href='http://biomoby.open-bio.org/index.php/for-developers/perl_tutorial'>
+Perl Tutorial</a><p>
+The documents below (including this one) are generated by pod2html from the various perl
+modules and give specific interface information for each of the Perl modules described in the tutorial.
+
+<ul>
+HEAD
+ for (my $i = 0; $i < @{$pms}; $i++) {
+ print INDEX "<li><a href=\"$html->[$i]\">MOBY::$mod_names->[$i]</a></li>\n";
+ }
+print INDEX <<FOOT;
+</ul>
+</body>
+</html>
+FOOT
+}
+
+
+# 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/\s+(pure_all)/ $add $1/;
+ 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,
+ # VERSION_FROM => Would be nicer not to have to specify the version number here, but to take it directly from the codebase....
+ PMLIBDIRS => ['MOBY'], #Get code from "MOBY", not "lib/MOBY"
+ # Version numbers specified for prerequiisites are simply "desired" versions,
+ # not minimum, or anything else.
+ PREREQ_PM => {
+ 'SOAP::Lite' => 0.69,
+ 'SOAP::MIME' => 0.55,
+ 'XML::LibXML' => 1.58,
+ 'XML::XPath' => 1.12,
+ 'Text::Shellwords' => 1.00,
+ 'HTML::Entities' => 0.01,
+ 'Test::More' => 0.60,
+ # Database stuff required only for local registry, but notify user if missing anyway.
+ 'DBI' => 0.01,
+ 'DBD::mysql' => 0.01,
+ 'WSRF::Lite' => '',
+ 'Test::Simple' => 0.44,
+ 'XML::DOM' => '',
+ 'DateTime::Format::Epoch' => '',
+ 'DateTime::Format::W3CDTF' => '',
+ 'HTTP::Daemon' => '',
+ 'HTTP::Daemon::SSL' => '',
+ 'MIME::Base64' => '',
+ 'Digest::SHA1' => '',
+ 'Crypt::OpenSSL::X509' => '',
+ 'Crypt::OpenSSL::RSA' => '',
+ 'XML::CanonicalizeXML' => 0.02,
+ 'Sys::Hostname::Long' => '',
+ 'RDF::Core' => '.51',
+ # Sharable only used for isAlive script
+ 'IPC::Shareable' => '0.6', #presence of this lib makes windows a no no ...
+ #obtain from http://sourceforge.net/project/showfiles.php?group_id=130827
+ 'LS' => 1.1.4,
+
+ }, # e.g., Module::Name => 1.1
+ #PM_FILTER => "",
+ ($] >= 5.005 ? ## Add these new keywords supported since 5.005
+ (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') : ()),
+);
+
+#
+# Insert additional MOBY specific Makefile targets
+#
+#
+#sub MY::postamble {
+# return <<"MAKE_FRAG";
+#Central:
+# echo 'Make (local) MOBY Central stub'
+#
+#Server:
+# echo 'Make (local) MOBY Server stub'
+#
+#WWWClient:
+# echo 'Setting up MOBY WWW Client'
+# cp scripts/MOBY-Client.cgi \$(MOBY_CGI_BIN_PATH)
+# chown \$(MOBY_WWW_USER):\$(MOBY_WWW_GROUP) \$(MOBY_CGI_BIN_PATH)/MOBY-Client.cgi
+#
+#MAKE_FRAG
+#}
+
+use ExtUtils::MakeMaker;
+use FindBin '$Bin';
+use strict;
+my $VERSION = '0.87';
+
sub MY::postamble {
# Now build documentation.
@@ -155,19 +380,23 @@
'DBD::mysql' => 0.01,
# 'WSRF::Lite' => '0.8.2.1', but it is not declared in the proper way there
'WSRF::Lite' => '',
- 'Test::Simple' => 0.44,
- 'XML::DOM' => '',
- 'DateTime::Format::Epoch' => '',
- 'DateTime::Format::W3CDTF' => '',
- 'HTTP::Daemon' => '',
- 'HTTP::Daemon::SSL' => '',
- 'MIME::Base64' => '',
- 'Digest::SHA1' => '',
- 'Crypt::OpenSSL::X509' => '',
- 'Crypt::OpenSSL::RSA' => '',
- 'XML::CanonicalizeXML' => 0.02,
- 'Sys::Hostname::Long' => ''
- # LS::ID => 1.1.1,
+ 'Test::Simple' => 0.44,
+ 'XML::DOM' => '',
+ 'DateTime::Format::Epoch' => '',
+ 'DateTime::Format::W3CDTF' => '',
+ 'HTTP::Daemon' => '',
+ 'HTTP::Daemon::SSL' => '',
+ 'MIME::Base64' => '',
+ 'Digest::SHA1' => '',
+ 'Crypt::OpenSSL::X509' => '',
+ 'Crypt::OpenSSL::RSA' => '',
+ 'XML::CanonicalizeXML' => 0.02,
+ 'Sys::Hostname::Long' => '',
+ 'RDF::Core' => '.51',
+ #Sharable only used for isAlive script
+ 'IPC::Shareable' => '0.6', #presence of this lib makes windows a no no ...
+ #obtain from http://sourceforge.net/project/showfiles.php?group_id=130827
+ 'LS' => 1.1.4,
}, # e.g., Module::Name => 1.1
#PM_FILTER => "",
($] >= 5.005 ? ## Add these new keywords supported since 5.005
@@ -194,3 +423,4 @@
#
#MAKE_FRAG
#}
+
More information about the MOBY-guts
mailing list