NAME

Ado::Build - Custom routines for Ado installation

SYNOPSIS

#See Build.PL
use 5.014000;
use strict;
use warnings FATAL => 'all';
use FindBin;
use lib("$FindBin::Bin/lib");
use Ado::Build;
my $builder = Ado::Build->new(..);
$self->create_build_script();

DESCRIPTION

This is a subclass of Module::Build. We use Module::Build::API to add custom functionality so we can install Ado in a location chosen by the user.

This module and Ado::BuildPlugin exist just because of the additional install paths that we use beside c<lib> and <bin>. These modules also can serve as examples for your own builders if you have some custom things to do during build, test, install and even if you need to add a new ACTION_* to your setup.

METHODS

Ado::Build inherits all methods from Module::Build and implements the following ones.

create_build_script

This method is called in Build.PL. It checks if $ENV{ADO_HOME} is set and if Ado is installed there. If so suggests backup of the existing installation. in this method we also call c<add_build_element> for etc public and log folders. Also here is the functionality for prompting the user about the "install_base" in Module::Build directory this will be $ENV{ADO_HOME}. Finally we set all the c<install_path>s for the distro and we call $self->SUPER::create_build_script.

process_etc_files

Moves files found in Ado/etc to Ado/blib/etc. See "METHODS" in Module::Build::API Returns void.

process_log_files

Moves files found in Ado/log to Ado/blib/log. Returns void.

process_public_files

Moves files found in Ado/public to Ado/blib/public. Returns void.

process_templates_files

Moves files found in Ado/templates to Ado/blib/templates. Returns void.

ACTION_build

We will put here custom functionality executed around the $self->SUPER::ACTION_build.

ACTION_dist

We will put here custom functionality executed around the $self->SUPER::ACTION_dist.

ACTION_install

Changes file permissions to 0600 of some files like etc/ado.sqlite and to 0400 of some files like etc/ado.conf. Finally prompts the user to add $ENV{ADO_HOME} to ~/.bashrc. This is currently not implemented for Windows. The user will have to add $ENV{ADO_HOME} as environment variable him self.

You can put additional custom functionality here.

do_create_readme

Creates the README file. It will be called during ./Build dist if you set the property create_readme in Build.PL.

SEE ALSO

Ado::BuildPlugin, Module::Build::API, "ADVANCED_RECIPES" in Module::Build::Cookbook, Build.PL in Ado distribution directory.

AUTHOR

Красимир Беров (Krasimir Berov)

COPYRIGHT AND LICENSE

Copyright 2013 Красимир Беров (Krasimir Berov).

This program is free software, you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License v3 (LGPL-3.0). You may copy, distribute and modify the software provided that modifications are open source. However, software that includes the license may release under a different license.

See http://opensource.org/licenses/lgpl-3.0.html for more information.