/usr/bin/mkstatic is in emboss-explorer 2.2.0-9.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | #!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use Pod::Usage;
use EMBOSS::GUI;
use EMBOSS::GUI::Conf;
use EMBOSS::GUI::XHTML;
my $frames = 1;
my $cgi = "/cgi-bin/emboss";
GetOptions(
"frames!" => \$frames,
"cgi=s" => \$cgi
) or pod2usage();
my $dir = shift || $EMBOSS::GUI::Conf::HTML_PATH;
-d $dir && -w $dir
or pod2usage("$dir is not a writeable directory");
print <<EOF;
I am about to dump static EMBOSS Explorer pages to the following directory:
$dir
These pages will overwrite existing HTML at this location.
EOF
while (1) {
print "\nDo you wish to continue (y/n)? ";
my $response = <STDIN>;
if ($response =~ /^y/i) {
last;
} elsif ($response =~ /^n/i) {
exit;
}
}
#my $style_url = $EMBOSS::GUI::Conf::STYLE_URL =~
# /^$EMBOSS::GUI::Conf::HTML_URL\/(.*)/ ? $1: $EMBOSS::GUI::Conf::STYLE_URL;
my $style_url = $EMBOSS::GUI::Conf::STYLE_URL;
#my $image_url = $EMBOSS::GUI::Conf::IMAGE_URL =~
# /^$EMBOSS::GUI::Conf::HTML_URL\/(.*)/ ? $1 : $EMBOSS::GUI::Conf::IMAGE_URL;
my $image_url = $EMBOSS::GUI::Conf::IMAGE_URL;
#my $manual_url = $EMBOSS::GUI::Conf::MANUAL_URL =~
# /^$EMBOSS::GUI::Conf::HTML_URL\/(.*)/ ? $1 : $EMBOSS::GUI::Conf::MANUAL_URL;
my $manual_url = $EMBOSS::GUI::Conf::MANUAL_URL;
my $html = EMBOSS::GUI::XHTML->new(
frames => $frames,
style_url => $style_url,
image_url => $image_url,
manual_url => $manual_url,
script_url => $cgi,
static => 1
);
my $emboss = EMBOSS::GUI->new(
html => $html
);
my $pages = 0;
if ($frames) {
dump_page("$dir/index.html", $html->frameset_page);
dump_page("$dir/alphamenu.html", $html->menu_page($emboss->apps));
dump_page("$dir/groupmenu.html", $html->menu_page($emboss->groups));
dump_page("$dir/intro.html", $html->intro_page);
}
my $manual_dir = $EMBOSS::GUI::Conf::MANUAL_URL;
$manual_dir =~ s/$EMBOSS::GUI::Conf::HTML_URL/$dir/;
-d $manual_dir or mkdir $manual_dir
or die "error creating directory $manual_dir: $!";
foreach my $aref ($emboss->apps) {
my ($app, $doc) = @$aref;
if (!$emboss->is_excluded($app)) {
if (my $acdfile = $emboss->_find_acd($app)) {
if (my $acd = eval { EMBOSS::ACD->new($acdfile) }) {
dump_page("$dir/$app.html", $html->input_page($acd));
} else {
warn "failed to parse $acdfile\n";
}
} else {
warn "failed to locate ACD file for $app\n";
}
if (my $manual = $emboss->_find_manual($app)) {
dump_page("$manual_dir/$app.html",
$html->manual_page($app, $manual));
} else {
warn "failed to locate manual for $app\n";
}
}
}
print <<EOF;
Done. If the location above is not the same location given during the
installation of EMBOSS Explorer, the style, images, and manual directories
will have to be copied over to the new location.
EOF
sub dump_page {
my ($path, $content) = @_;
++$pages;
$emboss->_write_to_file($path, $content)
or die "error writing to $path: $!\n";
}
=head1 NAME
mkstatic
=head1 AUTHOR
Luke McCarthy <lukem@gene.pbi.nrc.ca>
=head1 SYNOPSIS
mkstatic
[ --noframes ]
[ --cgi URL ]
[ DIRECTORY ]
=head1 DESCRIPTION
TODO...
=head1 OPTIONS
=over4
=item --frames | --noframes
Controls whether or not the generated HTML has a separate frame for the
application menu. The default is to use a separate frame.
=item --cgi URL
Use the specified URL as the location of the CGI script that application input
forms are submitted to.
=back
=head1 COPYRIGHT
Copyright (c) 2004 Luke McCarthy. All rights reserved. This program is free
software. You may copy or redistribute it under the same terms as Perl itself.
|