FreeBSD::Src - A object oriented interface to building FreeBSD from source.
Version 2.0.0
use FreeBSD::Src; #creates a new FreeBSD::Src object and build stuff in /tm[/obj and a kernel config #named whatever. my $src=FreeBSD::Src->new({obj=>"/tmp/obj", kernel=>"whatever"}); if($src->error){ warn('Error: '.$src->error); } #builds and installs the kernel and world $src->makeBuildKernel; if($src->error){ warn('Error: '.$src->error); } $src->makeInstallKernel; if($src->error){ warn('Error: '.$src->error); } $src->makeBuildWorld; if($src->error){ warn('Error: '.$src->error); } $src->makeInstallWorld; if($src->error){ warn('Error: '.$src->error); }
This creates the object that will be used. It takes arguement, which is a hash that contains various options that will be used.
This key contains the path to which contains the FreeBSD source. This this does not exist, it results in a permanent error.
The default is '/usr/src' if it is not defined.
This contains the path to the directory that will contain objects created by the compilation.
If not defined, the enviromental variable "MAKEOBJDIR" will be left as it is.
This is the kernel config that will be build.
If this is defined, it is left up to make to figure out which should be used. For more information, please see the man page make.conf(5).
This is the make.conf file to use for the build.
my $src=FreeBSD::Src->new({obj=>"/tmp/obj", kernel=>"whatever"}); if($src->error){ warn('Error: '.$src->error); }
Builds the world.
The return is a perl boolean value.
The returned integer from make can be found using the exitint method.
$src->makeBuildWorld; if($src->error){ warn('Error: '.$src->error); }
Installs the world.
$src->makeInstallWorld; if($src->error){ warn('Error: '.$src->error); }
Builds the kernel
The returned integer from make can be found using the exitinit method.
$src->makeBuildKernel; if($src->error){ warn('Error: '.$src->error); }
Install the kernel.
The returned integer from make can be reached in exitint method.
$src->makeInstallKernel; if($src->error){ warn('Error: '.$src->error); }
This cleans the build enviroment.
$src->makeClean; if($src->error){ warn('Error: '.$src->error); }
This gets the stdout from make from the previously called method.
my $output=$src->output;
This returns the current error code, if any.
my $error=$src->error; if($error){ warn('Error Code: '.$error); }
This is exit int from the make of the last called method.
This is a internal function and should not be called.
The source directory does not exist.
'make buildworld' failed.
'make installdworld' failed.
'make buildkernel KERNCONF=<kernel>' failed.
'make installkernel KERNCONF=<kernel>' failed.
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-freebsd-src at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=FreeBSD-Src. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-freebsd-src at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc FreeBSD::Src
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=FreeBSD-Src
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/FreeBSD-Src
CPAN Ratings
http://cpanratings.perl.org/d/FreeBSD-Src
Search CPAN
http://search.cpan.org/dist/FreeBSD-Src
Copyright 2011 Zane C. Bowers, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install FreeBSD::Src, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FreeBSD::Src
CPAN shell
perl -MCPAN -e shell install FreeBSD::Src
For more information on module installation, please visit the detailed CPAN module installation guide.