[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [ANNOUNCE] automatic perl module building from CPAN



> If your scripts were much better, why didn't you contribute them to
> the community? If you have feature suggestions or even patches, feel free

I don't mean to offend, but *my* scripts were a 3 hour scripting
binge, not a program.  The code was *embarrassing*.  When dh-make-perl
came out, it didn't do as good a job, but people *cared* about it, so
I figured it would evolve, and people would put more hours into it
over time because it had a sane base, plus I'd already made the 5 or 6
local packages I needed (and spent the time convincing the upstream
author of the package I *really* cared about to improve his packaging
instead, so there's a better chance it'll be packagable later...)

Automatic construction of the copyright file was certainly a key
thing; it is much better for the tool to guess, or say "based on
<this> I decided <that>, take a look <here> to confirm" -- it is a lot
faster for me to read two things and decide they're sane, than to go
do the conversion myself -- that's what the tool is *for* after all.
(In my tool, I just made sure to "less debian/*" before running
dpkg-buildpackage...)

The basic approach of "auto-libperl module::name" was:
	suck it down with use CPAN
	chew on $obj->cpan_file to get the name
	use $obj->cpan_version to get the version and chew it off of
	   the name
	massage the name to debian lib*-perl style
	untar it
	dh_make --single
	fill "packaged by auto-libperl from CPAN\n" in to README.Debian
	update changelog with "Initial Release from CPAN via auto-libperl."
	fix up the control file (arch all, section main, fill in the
	  module name in the description - and mention that it was
	  autopackaged and needs documentation)
	update the copyright file with CPAN download info; pull
	  license from the LICENSE file in the package
	bludgeon rules with something that works
	add a newline to debian/dirs (workaround dh_make bug)
	nuke ex.* and *.ex

And then tell the user (me) to check a handful of things manually
[this was of course more a reminder that I could maybe automate them
later.]

Embarassment aside, I'll email it to either of you if you want any of
the code snippets (it is only ~150 lines), but I hope you've gotten
further than that; I haven't touched this since 2000-11-19, and
reconstructed the above list by looking at it and trying not to cringe
too much :-)

Bear in mind one important thing: for *many* CPAN packages, you don't
want a featureful auto-installer -- you want one that looks and says
"ah, this bit is completely stylistic, I'll do the debian style
same-thing over here".  In otherwords, every case where you don't need
to think, *don't* think, make the tool do it.  If the tool throws up
its hands on some things, that's fine... but make the easy cases easy.

If it matters, the things I autopackaged were:
	CGI.pm
	DBIx-DBSchema DBIx-DataSource DBIx-SearchBuilder 
	FreezeThaw Log-Dispatch Text-Wrapper

I vaguely recall that by the final round I didn't need to do any of
the changes by hand, though I don't have time to go re-run it and diff
them just now to confirm.  I'd be very pleased (some time in the
future when I'm making another attempt at the package that needs all
of these) if at some point, *any* approach "just works" for
straightforward "real" packages like these.

			_Mark_ <eichin@thok.org>
			The Herd of Kittens
			Debian Package Maintainer



Reply to: