Debian...e::HTML(3pm)

πŸ’– Debian::Package::HTML β€” the manual, but make it cute πŸ’–

okay bestie, so this is Debian::Package::HTML(3pm), from the User Contributed Perl Documentation, and honestly? she's giving "sponsor my package, I'll make it a website" energy and I'm obsessed. 🌸


✨ NAME ✨

Debian::Package::HTML β€” she generates a webpage with all the info (plus Linda/Lintian checks, no cap) about a Debian binary or source package, using HTML::Template. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

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

look at her go ✨


πŸŽ€ REQUIRES πŸŽ€

  • HTML::Template

that's the whole list. she's low maintenance. πŸ‘‘


🫢 EXPORTS 🫢

Nothing. literally nothing. she keeps her stuff to herself and honestly? respect. πŸ’œ


🌈 DESCRIPTION 🌈

So here's the vibe: this module outputs a webpage using HTML::Template templates, and that webpage resumes the information of a normal build environment for a package in Debian β€” think source files, binary packages and changelogs β€” and it runs Linda/Lintian for sanity checks. πŸ”

It's useful for making unified presentation webpages for those packages which are being sponsorized by someone in Debian. (Sponsor era. We love to see it. 🫢)


πŸ’… METHODS πŸ’…

🌟 Constructor 🌟

  • $object->new(%packageHash) β€” 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:

"binary", "control", "source", "diff", "changes" β€” each one of them specifying one of the five possible files generated by a package building process in Debian. πŸ“¦

⚠️ "control" is mandatory. like, you cannot skip it. she will not be okay.

✨ Output ✨

  • $object->output(%contextHash) β€” does the actual XHTML output. πŸ“ Possible elements for the hash are:
    • "briefing" (boolean) β€” if TRUE, 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 HTML. Defaults to FALSE. πŸ—’οΈ
    • "charset" β€” determines the output charset. Defaults to "ISO-8859-1".
    • "resultTemplate" β€” specifies the location of an HTML::Template style template for output. This is mandatory, and defaults to "result.tmpl".
    • "pageStyle" β€” specifies the location of a CSS file which might be included. πŸ’„
    • "doChecks" (boolean) β€” if TRUE, 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 FALSE.
    • "dump" β€” determines where to put the resulting HTML output. Defaults to index.html.

😭 DIAGNOSTICS 😭

🚨 No DSC could be found/open 🚨

You need to specify a DSC control file using the "control" parameter for the new() method. If you don't, WebInfo can't do much. πŸ’€ The package will inform if the file could not be FOUND or could not be OPEN.

Please report the bugs, I'd love to work on them. πŸ₯Ί (they literally said that. precious.)


🎨 CUSTOMIZATION 🎨

🧡 Template 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 "+" separated name/surname for the maintainer (useful for URL searching) πŸ”Ž
  • pageCharset β€” the page charset (customizable in the output() method)
  • pageStyle β€” the CSS file (customizable in the output() method)
  • packagef β€” the available package files as an array reference, so HTML::Template should iterate over the "packagefile" 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

🌸 EXAMPLES 🌸

πŸ“ Only a control file πŸ“

#!/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" );

minimal. clean. iconic. ✨

πŸ’– A complete building environment πŸ’–

#!/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"
);

okay she ATE with "groovy-style.css" honestly. πŸ’…

🧚 Some ideas 🧚

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. 🫢 main character energy fr fr.


πŸ‘‘ AUTHOR πŸ‘‘

Jose Parrella (joseparrella@cantv.net) wrote the original code, then modularized and OOed the code.

Thanks go to Christian Sanchez (csanchez@unplug.org.ve) who helped with the original HTML::Template'ing. πŸ™


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. πŸͺ


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page bestie, you're SO ready πŸ’–βœ¨

cute lil sign-off: this one's from perl v5.32.1, dated 2022-01-06, and yeah β€” it's Debian::Package::HTML(3pm) all the way down. mwah. πŸ’‹πŸŽ€

πŸ“¦ where this page comes from