Module::Build::PM_Filter - Add a PM_Filter feature to Module::Build


Module-Build-PM_Filter documentation  | view source Contained in the Module-Build-PM_Filter distribution.

Index


NAME

Top

Module::Build::PM_Filter - Add a PM_Filter feature to Module::Build

VERSION

Top

This documentation refers to Module::Build::PM_Filter version 1.2

SYNOPSIS

Top

In a Build.PL file you must use this module in place of the Module::Build:

    use Module::Build::PM_Filter;

    my $build = Module::Build::PM_Filter->new(
                module_name         =>  'MyIkiWiki::Tools',
                license             =>  q(gpl),
                dist_version        =>  '0.2',
                dist_author         =>  'Victor Moral <victor@taquiones.net>',
                );

    $build->create_build_script();

In the package directory create a pm_filter file like this:

    #!/usr/bin/perl -pl

    s{##PACKAGE_LIB##}{use lib qw(/usr/share/myprogram);}g;

and change its permissions for user execution.

Then in a script from package insert a line like this:

    package MyPackage;
    use strict;
    use base;

    ...

    ##PACKAGE_LIB##

    ...

DESCRIPTION

Top

This module provides a Module::Build compatible class and adds a filter for .pm, .pl and script files. The filter could be used to replace Perl source from development environment to production, or to remove debug sentences.

In the debug phase we can play with the application and modules without mattering to us where the library are; when we build the package for distribution, the modules and the scripts will contain the correct path in the final location.

In addition the module makes sure that the archives pm_filter and debian/rules are copied in the distribution directory with the suitable permissions.

SUBROUTINES/METHODS

Top

process_pm_files( )

This method looks for a file named 'pm_filter' in the current work directory and executes it; his standard input is redirected to the source pm and his standard output is redirected to a temp file.

The temp file is finally installed on the blib/ tree.

process_script_files( )

This method finds, filters and install the executable files in the package.

ACTION_distdir( )

This method performs the 'distdir' action and change the permissions of the pm_filter and debian/rules files in the distribution to executable.

DIAGNOSTICS

Top

pm_filter failed ...

croak with this text when it could not run the pm_filter program.

pm_filter not executable ...

croak with this text when exists a pm_filter file and it not executable.

CONFIGURATION AND ENVIRONMENT

Top

The location of the pm_filter script must be the current work directory.

DEPENDENCIES

Top

Module::Build
File::Copy::Recursive

INCOMPATIBILITIES

Top

ExtUtils::MakeMaker

BUGS AND LIMITATIONS

Top

There are no known bugs in this module. Please report problems to the author. Patches are welcome.

AUTHOR

Top

Victor Moral <victor@taquiones.net>

LICENSE AND COPYRIGHT

Top


Module-Build-PM_Filter documentation  | view source Contained in the Module-Build-PM_Filter distribution.