[Pdx-pm] Want good examples of perl application installs
Michael G Schwern
schwern at pobox.com
Mon Dec 13 14:42:40 CST 2004
On Mon, Dec 13, 2004 at 10:24:22AM -0800, Keith Lofstrom wrote:
> I am managing "dirvish", a perl wrapper around a rsync for disk-to-disk
> backup ( see http://www.samag.com/documents/s=9464/sam0501b/ and
> http://www.dirvish.org ) Some of my developers are getting fiesty
> about changing the "install.sh" install process to something involving
> "make" (using Automake and Libtool) , which fixes some things (but does
> not address other important install issues).
> Can someone suggest some examples of small ( 2000 line ), highly
> configurable stand-alone perl applications that have exemplary install
> procedures? I will probably tell the developers to go ahead with
> whatever they want to do, but I would like to know what the alternatives
> are; if there is something clearly superior, I would like to suggest it
> to my developers.
I don't think this is what you're looking for, but I never miss a chance
to advertise PAR. Basically create stand-alone Perl archives/executables.
With PAR you can, for example, ship a single file Windows executable that
contains the perl interpreter, your program and any Perl modules your
program needs. It can also create cross-platform executables which is
just your program and all its dependencies (umm, provided they don't need
XS) in a single file to avoid module installation hell.
Otherwise... having a look at your tarball... its very straight forward.
Here's my initial notes.
* A tarball named dirvish_1.2.orig.tar.gz should unpack into a directory
named dirvish_1.2.orig/ or dirvish_1.2/ not Dirvish-1.2/. Its a little
thing but try to make the tarball name and directory match. It saves a
moment of "I just unpacked it, where the hell is it?" and it gives the
impression of amaturism.
* Having a Perl program install itself using a shell program is kinda
silly. If nothing else, write install.pl.
So there's nothing off the top of my head that is as user friendly as
your install.sh, but there's ways to normalize the way you've got things
set up there.
* move the programs into a bin/ directory just to clean things up
a bit. Move loadconfig.pl into lib/. I was initially very confused
about that file.
* Write the docs as POD instead of (possibly hand written??) nroff and
attach them to the programs they're documenting. The man pages
will be generated.
* Use a basic Makefile.PL or Build.PL to handle the installation. Now
you're normalized with the rest of the Perl world. EXE_FILES is what
you're looking for.
* Rewrite install.sh as a thin wrapper around the Makefile.PL to preserve
that nice question/answer session.
This unfortunately creates a dependency on A) make or B) Module::Build.
I was "typing out loud" so I hope some of this is helpful.
Michael G Schwern schwern at pobox.com http://www.pobox.com/~schwern/
Me? A robot? That's rediculous! For one thing, that doesn't compute at all!
More information about the Pdx-pm-list