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

NAME

PkgForge::BuildCommand::Builder - A Moose role to be used by PkgForge builders.

VERSION

     This documentation refers to PkgForge::Builder version 1.1.10

SYNOPSIS

     package PkgForge::BuildCommand::Builder::Foo;

     use Moose;

     with 'PkgForge::BuildCommand::Builder';

     sub verify_environment { ... }

     sub build { ... }

DESCRIPTION

This is a role which gathers common functionality and sets some requirements on how a Package Forge builder class must be implemented.

ATTRIBUTES

The following attributes will be part of any class which implements this role:

tmpdir

This is a secure location which can be used for generating temporary files during the build process. If nothing is specified then the File::Temp module will be used to generate a randomly named directory which will be cleaned up at the end of the process.

platform

This is the name of the platform for which the builder is being used, for example, f13 or sl5. This is a required attribute.

architecture

This is the name of the architecture for which the builder is being used, for example, i386 or x86_64. This does have any significance on some platforms so it is an optional attribute.

name

This is the name of the builder process. Normally you do not need to set this attribute, the default is the combination of the platform and architecture (if set) joined with a hyphen, e.g. platform f13 and architecture x86_64 gives a name of f13-x86_64.

timeout

This is the maximum time (in seconds) that the build process is allowed to take. Any process still running after this time should be killed.

error_policy

This is a string used to record the required response to any source package build errors. The currently supported values are retry and immediate. In immediate-mode the builder will stop as soon as any source package in the job fails to build. The default is retry-mode in which the builder will keep attempting to build more packages for the job as long as more build each time. This is very useful as it is often the situation that a job contains a set of packages where some of them have build-dependencies on others. Ordering them manually might be difficult so in the retry-mode although the job might take a bit longer to build there is an improved chance of complete success.

SUBROUTINES/METHODS

The following methods are available to all classes which implement this role:

run( $job, $buildinfo )

This method takes a PkgForge::Job object and a PkgForge::BuildInfo object. The run method registers the builder information into the BuildInfo object (using register_info) and filters the sources (using filter_sources). The Job and BuildInfo objects are then passed into the build method (which must be implemented by each class).

filter_sources($job)

This method takes the PkgForge::Job object and filters the source packages to find those which are suitable for this builder. For example, if the builder only accepts SRPMs then a list of only those packages which are in the PkgForge::Source::SRPM class will be returned.

register_info( $job, $buildinfo )

This role requires that any implementing class provides the following methods:

verify_environment()

This method should validate the build environment and return 1 if everything is correct. If a problem is found the method should die with a useful message.

build( $job, $buildinfo )

This is the main method which does the work of building the packages from source. It receives a PkgForge::Job object and a PkgForge::BuildInfo object which contains the list of sources to be built. On completion the method is expected to register successful and failed packages, and also all the products and log files generated by the build with the BuildInfo object. See the PkgForge::BuildInfo documentation for API information.

CONFIGURATION AND ENVIRONMENT

This module does not use any configuration files. You will need to install the correct build tools for the target platform (see the information in the documentation for the specific module you require).

DEPENDENCIES

This module is powered by Moose and uses MooseX::Types.

SEE ALSO

PkgForge, PkgForge::Job, PkgForge::Builder::RPM, PkgForge::BuildInfo

PLATFORMS

This is the list of platforms on which we have tested this software. We expect this software to work on any Unix-like platform which is supported by Perl.

ScientificLinux5, Fedora13

BUGS AND LIMITATIONS

Please report any bugs or problems (or praise!) to bugs@lcfg.org, feedback and patches are also always very welcome.

AUTHOR

    Stephen Quinney <squinney@inf.ed.ac.uk>

LICENSE AND COPYRIGHT

    Copyright (C) 2010-2011 University of Edinburgh. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GPL, version 2 or later.