NAME

Perl::Dist::WiX::Asset::Library - "C Library" asset for a Win32 Perl

VERSION

This document describes Perl::Dist::WiX::Asset::Library version 1.250_100.

SYNOPSIS

my $library = Perl::Dist::Asset::Library->new(
    name       => 'zlib',
    url        => 'http://strawberryperl.com/packages/zlib-1.2.3.win32.zip',
    unpack_to  => 'zlib',
    build_a    => {
        'dll'    => 'zlib-1.2.3.win32/bin/zlib1.dll',
        'def'    => 'zlib-1.2.3.win32/bin/zlib1.def',
        'a'      => 'zlib-1.2.3.win32/lib/zlib1.a',
    },
    install_to => {
        'zlib-1.2.3.win32/bin'     => 'c/bin',
        'zlib-1.2.3.win32/lib'     => 'c/lib',
        'zlib-1.2.3.win32/include' => 'c/include',
    },
);

DESCRIPTION

Perl::Dist::WiX::Asset::Library is a data class that provides encapsulation and error checking for a "C library" to be installed in a Perl::Dist::WiX-based Perl distribution.

It is normally created on the fly by the <Perl::Dist::WiX> install_library method (and other things that call it).

Perl::Dist::WiX::Asset::Library is similar to Perl::Dist::WiX::Asset::Binary, in that it captures a name, source URL, and paths for where to install files.

It also takes a few more pieces of information to support certain more esoteric functions unique to C library builds.

The specification of the location to retrieve the package is done via the standard mechanism implemented in Perl::Dist::WiX::Role::Asset.

new

The new constructor takes a series of parameters, validates then and returns a new Perl::Dist::WiX::Asset::Library object.

It inherits all the parameters described in the Perl::Dist::WiX::Role::Asset->new() method documentation, and adds the additional parameters described below.

name

The required name parameter is the name of the package for the purposes of identification in messages.

unpack_to

The optional unpack_to parameter allows you to specify in which subdirectory of the build directory the tarball or zip file that was downloaded gets unpacked to.

It defaults to the display name.

license

The license parameter allows you to specify which files get copied to the license directory of the distribution.

The keys are the files to copy, as relative filenames from the subdirectory named in unpack_to. If the tarball is properly made, the filenames will include the name and version of the library.

The values are the locations to copy them to, relative to the license directory of the distribution.

install_to

The required install_to parameter allows you to specify which directories get installed in which subdirectories of the image directory of the distribution.

The keys are the directories to copy, relative to the subdirectory named in unpack_to. The directory names may include the name and version of the library.

The values are the locations to copy the directories to, relative to the image directory of the distribution.

build_a

The build_a parameter allows you to specify that the library needs to have its import library created.

A hash reference with 3 keys is passed in: either a 'dll' or 'source' key, and 'def' and 'a' keys.

The file referred to in the value of the source key is copied to the directory named in unpack_to.

The value of the dll key, if that is used, is the dll that needs its import library created.

The value of the def key is where to write the .def file, and the value of the a key is where to write the final import library.

All files are relative to the directory named in unpack_to. The directory names may include the name and version of the library.

install

The install method installs the Perl library by the Perl::Dist::WiX::Asset::Library object and returns true or throws an exception.

SUPPORT

Bugs should be reported via the CPAN bug tracker at

http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Perl-Dist-WiX

For other issues, contact the author.

AUTHOR

Curtis Jewell <csjewell@cpan.org>

SEE ALSO

Perl::Dist::WiX, Perl::Dist::WiX::Role::Asset

COPYRIGHT AND LICENSE

Copyright 2009 - 2010 Curtis Jewell.

Copyright 2007 - 2009 Adam Kennedy.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.