Krang::Platform - base class for platform build modules
package Redhat9::Platform; use base 'Krang::Platform';
This module serves as a base class for the platform build modules which build help Krang binary distributions. See docs/build_tech_spec.pod for details about how the build system works.
This module is meant to be used as a base class, so the interface consists of methods which may be overridden. All these methods have a reasonable default behavior.
All methods are called as class methods. Platform modules are free to use package variables to hold information between calls.
verify_dependencies(mode = $mode)>mode parameter will
be either ``build'' or ``install'' depending on when the method is called.
This method should either succeed or die() with a message for the
user.
By default, shared object (.so) files are searched for in $Config{libpth}. header files (.h) are search for in $Config{usrinc}, /include and /usr/local/include
The default implementation runs the following default checks (which are all overrideable):
check_perl()We also verify that Perl is the right version and compiled for the right architecture (skipped in build mode).
check_mysql()mysql shell is available and MySQL is v4.0.13 or higher.
check_libperl(lib_files => \@libs, includes => \@incs, mode => $mode)check_libmysqlclient(lib_files => \@libs, includes => \@incs, mode => $mode)check_expat(lib_files => \@libs, includes => \@incs, mode => $mode)check_libjpeg(lib_files => \@libs, includes => \@incs, mode => $mode)check_libgif(lib_files => \@libs, includes => \@incs, mode => $mode)check_libpng(lib_files => \@libs, includes => \@incs, mode => $mode)$bin = find_bin(bin => $bin_name)If $ENV{PATH} does not contain /sbin or /usr/sbin, it will search those as well.
will die() with error if it cannot find the desired executable.
check_ip(ip => $ip)$gid = create_krang_group(options => \%options)The default version of this sub works for GNU/Linux. Other platforms (e.g. BSD-like) will need to override this method to work with their platforms' requirements for user creation.
The sub will check to see if --KrangGroup exists, and create it if it does not. It will return the group ID (gid) in either case.
This sub will die with an error if it cannot create --KrangGroup.
$uid = create_krang_user(group_id => $gid, options => \%options)The default version of this sub works for GNU/Linux. Other platforms (e.g. BSD-like) will need to override this method to work with their platforms' requirements for user creation.
The sub will check to see if --KrangUser exists, and create it if it does not. If the user is created, the default group will be --KrangGroup. If the user already exists, it will be made a member of the --KrangGroup group.
The sub will return the user ID (uid) if successful.
This sub will die with an error if it cannot create --KrangUser.
krang_usermod(options => \%options)The default version of this sub works for GNU/Linux. Other platforms (e.g. BSD-like) will need to override this method to work with their platforms' requirements for user creation.
This sub will die with an error if it cannot make --KrangUser a member of --KrangGroup.
build_perl_module(name => $name)$name in
the current directory. The result of calling this method should be
one or more compiled Perl modules in Krang's lib/ directory.
The default implementation includes code to answer questions asked by some of the modules (using Expect) and special build procedures for others.
The optional 'dest_dir' parameter specifies the location to put the results of the build. The default is KRANG_ROOT/lib.
build_mm(mm_dir => $mm_dir, mm_bin => $mm_bin)build_mm(build_dir => $dir, mod_ssl_dir => $dir, apache_dir => $dir)build_apache_modperl(apache_dir => $dir, modperl_dir => $dir)apache_build_parameters() and modperl_build_parameters()
which may be easier to override. The result should be a working
Apache installation in apache/.
apache_build_parameters(apache_dir => $dir, modperl_dir => $dir)configure script by build_apache_modperl().
mod_perl_build_parameters(apache_dir = $dir, modperl_dir => $dir)>Makefile.PL script by build_apache_modperl().
finish_installation(options = \%options)>krang_install (ex: InstallPath).
finish_upgrade()post_install_message(options => \%options)post_upgrade_message(options = \%options)>guess_platform()krang_build when the user doesn't
specify a platform. This method should return true if the module
wants to handle the platform.
The default implementation returns false all the time. When implementing this module, err on the side of caution since the user can always specify their platform explicitely.
build_params()krang_build and returns
a hash of the values available (Platform, Perl, Arch, SSL).