Re: Packaging a CGI with modules?
MJ Ray dijo [Fri, Jul 06, 2007 at 08:54:52AM +0100]:
> Perl sages,
> What is the recommended way to package a CGI with its own modules?
> This seems not very well-documented: not just for debian, but
> generally. I'm using MakeMaker because it seems to be halfway
Umh... Are the modules only useful for your CGI application? Don't you
think they _might_ be useful for something else?
I think I would prefer having several quite-usual packages than just a
strange one. If you split your stuff in, say, libkoha-perl (which is
just a standard lib.*-perl package, like all the hundreds you have
seen here and there) and the CGI app itself in koha (which would fit
IMHO better in /usr/share/koha - Rationale a bit later on), any person
trying to figure out what you did or why you did it that way would be
Now, why /usr/share/koha? Because that way, you can also drop a config
snippet under /etc/apache2/conf.d/koha (and/or possibly similar
locations, if you like other webservers - or just documenting what's
needed for that). I feel having CGIs under /usr/lib/cgi-bin is almost
as dirty and 1995-ish as publishing them under
http://www.my-site.org/cgi-bin/koha.pl - Just make them take
http://www.my-site.org/koha or http://koha.my-site.com!
> As well as having ITP'd koha, I am an upstream developer of it.
> Upstream, I am setting WriteMakefile()'s PM to move the files into
> good locations - for example, I'm currently putting the CGIs in
> $(INST_LIB)/koha/cgi-bin - and I intend to mv them with debian/rules
> to meet policy. Is that the best MakeMaker-definable location for
> them to start in?
Ummm.. Here it also makes sense to stop it :) Some years ago, I
started walking this same path with Comas - I had a nonstandard CVS
structure (and I used CVS, so moving it was a major PITA), so in order
to package and publish my stuff I had a MakeMakerMaker. For your
amusement, you can peek at it:
Yes, I can hear you all laughing at me. MJ, please spare yourself from
such an ordeal. If you can, split your development as well. Package a
Perl module, and package a simple webapp that just depends on it.
In the end, I have to wholeheartedly agree with Martín Ferrari: Perl's
MakeMaker and similar tools (Module::Build, Module::Install, etc.) are
great for modules, but suck for complex setups. But that's where you
use debian/rules ;-)
Gunnar Wolf - email@example.com - (+52-55)5623-0154 / 1451-2244
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF