The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

module_builder.pl - A simple demo that unpacks, builds and tests perl module tarballs.

SYNOPSIS

        $ module_builder.pl My-Module-0.01.tar.gz Verby-0.01.tar.gz

DESCRIPTION

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.

Verby::Action::MkPath

First the context variable untar_dir is created. This is where all the tarballs will be unpacked to. Because we're so silly, untar_dir is actually set by "cwd" in Cwd, so this is basically a no-op.

It has provide_cxt, meaning that all it's dependant steps and it share a common Verby::Context, separate from other steps.

Verby::Action::Untar

The next step is to unpack the tarball. The before handler in Verby::Step::Closure will set the tarball context variable to the argument being processed, and the dest context variable to the untar_dir context variable.

The after handler sets the workdir variable to the value of the src_dir variable, and exports workdir so that it's accessible to subsequent steps.

Verby::Action::BuildTool

The next thing to do is run the Makefile.PL file. We set workdir to src_dir in the previous step, and that's all we need.

Verby::Action::Make

After we've finished running Makefile.PL we can run make(1) with no arguments. This is exactly what this step does. It is also affected by the previously exported workdir.

Verby::Action::Make

Now we run make(1) again, but this time with the test target.

ASYNC BEHAVIOR

Since most actions are asynchroneous, modules will be built in parallel. Isn't that cool?

AUTHOR

Yuval Kogman, <nothingmuch@woobling.org>

COPYRIGHT AND LICENSE

Copyright 2005, 2006 by Infinity Interactive, Inc.

http://www.iinteractive.com

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.