SYNOPSIS

  use strict;
  use Debian::Package::HTML;
  my $package = Debian::Package::HTML->new(%packageHash);
  $package->output(%contextHash);

REQUIRES

HTML::Template

EXPORTS

Nothing

DESCRIPTION

This module outputs a webpage using HTML::Template templates which resumes the information of a normal build environment for a package in Debian (source files, binary packages and changelogs) using Linda/Lintian for sanity checks. It is useful for making unified presentation webpages for those packages which are being sponsorized by someone in Debian.

METHODS

\$1

Constructs an $object with all information concerning the package, including location for binary/source files, changelogs, diffs, pristine sources, as well as templates, charsets and other settings. Possible elements for the hash are: \*(L"binary\*(R", \*(L"control\*(R", \*(L"source\*(R", \*(L"diff\*(R", \*(L"changes\*(R", each one of them specifying one of the five possible files generated by a package building process in Debian. \*(L"control\*(R" is mandatory. Does the actual \s-1XHTML\s0 output. Possible elements for the hash are: \*(L"briefing\*(R" (boolean): if \s-1TRUE\s0, WebInfo will look for a briefing.html in the current directory, and will include the content in the resulting output. Useful for introducing commentaries without touching the final \s-1HTML\s0. Defaults to \s-1FALSE\s0. \*(L"charset\*(R": determines the output charset. Defaults to \*(L"\s-1ISO-8859-1\s0\*(R". \*(L"resultTemplate\*(R": specifies the location of an HTML::Template style template for output. This is mandatory, and defaults to \*(L"result.tmpl\*(R" \*(L"pageStyle\*(R": specifies the location of a \s-1CSS\s0 file which might be included. \*(L"doChecks\*(R" (boolean): if \s-1TRUE\s0, WebInfo will run linda and lintian over the control file and will generate a ${packageName}-checks.txt file which will be included in the final output. Defaults to \s-1FALSE\s0. \*(L"dump\*(R": determines where to put the resulting \s-1HTML\s0 output. Defaults to index.html

DIAGNOSTICS

You need to specify a \s-1DSC\s0 control file using the \*(L"control\*(R" parameter for the new() method. If you don't, WebInfo can't do much. The package will inform if the file could not be \s-1FOUND\s0 or could not be \s-1OPEN\s0. Please report the bugs, I'd love to work on them.

CUSTOMIZATION

You can customize the final output using your own HTML::Template template file and specifying it as a parameter for the output() method. The following template variable names are honored by WebInfo: packageName: the name of the package packageVersion: the version of the package maintainerName: the name of the maintainer maintainerMail: the e-mail address of the maintainer maintainerPlus: a \*(L"+\*(R" separated name/surname for the maintainer (useful for \s-1URL\s0 searching) pageCharset: the page charset (customizable in the output() method) pageStyle: the \s-1CSS\s0 file (customizable in the output() method) packagef: the available package files as an array reference, so HTML::Template should iterate over the \*(L"packagefile\*(R" variable. date: the date specified by the current locale doChecks: a boolean variable specifying if Linda/Lintian checks were made briefing: a boolean variable specifying if a briefing.html file should be included An example template is in: http://debian.bureado.com.ve/package-info/result.tmpl \s-1HTML\s0 outputs with that template and no \s-1CSS\s0 look like: http://debian.bureado.com.ve/falselogin/

EXAMPLES

#!/usr/bin/perl use strict; use warnings; use Debian::Package::HTML; my $package = Debian::Package::HTML->new( "control" => "falselogin.dsc" ); $package->output ( "resultTemplate" => "result.tmpl", "dump" => "index.html" ); #!/usr/bin/perl use strict; use warnings; use Debian::Package::HTML; my $package = Debian::Package::HTML->new("control" => "falselogin.dsc", "binary" => "falselogin.deb", "diff" => "falselogin.diff.gz", "source" => "falselogin.orig.tar.gz", "changes" => "falselogin.changes" ; $package -> output ( "resultTemplate" => "anotherTemplate.tmpl", "style" => "groovy-style.css", "charset" => "UTF-8", "doChecks" => "1", "dump" => "firstPackage.html" ); Well, throw the files generated by your compilations (dpkg-buildpackage, i.e.) in a /var/www/<my package> served by your webserver of choice and run a small program using Debian::Package::HTML and a nice CSS/Template. You will have a great webpage for all your Debian packages, really useful if you're not yet a Developer and need to handle several packages with your sponsors.

AUTHOR

Jose Parrella ([email protected]) wrote the original code, then modularized and OOed the code. Thanks go to Christian Sanchez ([email protected]) who helped with the original HTML::Template'ing

COPYRIGHT

Copyright 2006 Jose Parrella. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

RELATED TO Debian::Package::HTML…

perl\|(1), HTML::Template.