module_builder.pl - A simple demo that unpacks, builds and tests perl module tarballs.
$ module_builder.pl My-Module-0.01.tar.gz Verby-0.01.tar.gz
As this is not really a useful program, we'll look at how it's written, not how it's used.
Foreach tarball given on the command line, several steps are created, all of them Verby::Step::Closure objects. Each step depends on the step before it.
First the context variable
untar_diris created. This is where all the tarballs will be unpacked to. Because we're so silly,
untar_diris actually set by "cwd" in Cwd, so this is basically a no-op.
provide_cxt, meaning that all it's dependant steps and it share a common Verby::Context, separate from other steps.
The next step is to unpack the tarball. The
beforehandler in Verby::Step::Closure will set the
tarballcontext variable to the argument being processed, and the
destcontext variable to the
afterhandler sets the
workdirvariable to the value of the
src_dirvariable, and exports
workdirso that it's accessible to subsequent steps.
The next thing to do is run the
Makefile.PLfile. We set
src_dirin the previous step, and that's all we need.
After we've finished running
Makefile.PLwe can run make(1) with no arguments. This is exactly what this step does. It is also affected by the previously exported
Now we run make(1) again, but this time with the
Since most actions are asynchroneous, modules will be built in parallel. Isn't that cool?
Yuval Kogman, <email@example.com>
Copyright 2005-2008 by Infinity Interactive, Inc.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.