# -*- perl -*- # # Test::AutoBuild::Platform # # Daniel Berrange # Dennis Gregorovic # # Copyright (C) 2005 Daniel Berrange # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # $Id$ =pod =head1 NAME Test::AutoBuild::Platform - represents a build host's environment =head1 SYNOPSIS use Test::AutoBuild::Platform; # Create a new platform based on the host machine's native # environment my $platform = Test::AutoBuild::Platform->new(name => "host"); # Or create a platform describing a chroot environment which # has a differing OS, but same architecture my $platform = Test::AutoBuild::Platform->new(name => "host", label => "Fedora Core 3"); # Or create a platform describing an emulated OS my $platform = Test::AutoBuild::Platform->new(name => "host", label => "Free BSD", operating_system => "bsd", architecture => "x86_64"); # Create a platform describing the host, with some 'interesting' # extra metadata about the toolchain my $platform = Test::AutoBuild::Platform->new(name => "host", options => { 'compiler.cc' => "GCC 3.2.3", 'compiler.c++' => "G++ 3.2.3", 'linker' => "GNU LD 2.15", }); =head1 METHODS =over 4 =cut package Test::AutoBuild::Platform; use warnings; use strict; use Log::Log4perl; use File::Spec::Functions qw(catfile rootdir); use POSIX qw(uname); use Class::MethodMaker get_set => [qw( name label architecture operating_system )]; =item my $stage = Test::AutoBuild::Platform->new(name => $name, [label => $label,]); [architecture => $arch,]); [operating_system => $os,] [options => \%options]); Creates a new platform object describing a build root environment. The C parameter is a short tag for the platform. The optional C