1Alien::Base::ModuleBuilUds(e3r)Contributed Perl DocumentAaltiieonn::Base::ModuleBuild(3)
2
3
4

NAME

6       Alien::Base::ModuleBuild - A Module::Build subclass for building
7       Alien:: modules and their libraries
8

VERSION

10       version 1.15
11

SYNOPSIS

13       In your Build.PL:
14
15        use Alien::Base::ModuleBuild;
16
17        my $builder = Alien::Base::ModuleBuild->new(
18          module_name => 'Alien::MyLibrary',
19
20          configure_requires => {
21            'Alien::Base::ModuleBuild' => '0.005',
22            'Module::Build' => '0.28'
23          },
24          requires => {
25            'Alien::Base' => '0.005',
26          },
27
28          alien_name => 'mylibrary', # the pkg-config name if you want
29                                     # to use pkg-config to discover
30                                     # system version of the mylibrary
31
32          alien_repository => {
33            protocol => 'http',
34            host     => 'myhost.org',
35            location => '/path/to/tarballs',
36            pattern  => qr{^mylibrary-([0-9\.]+)\.tar\.gz$},
37          },
38
39          # this is the default:
40          alien_build_commands => [
41            "%c --prefix=%s", # %c is a platform independent version of ./configure
42            "make",
43          ],
44
45          # this is the default for install:
46          alien_install_commands => [
47            "make install",
48          ],
49
50          alien_isolate_dynamic => 1,
51        );
52

DESCRIPTION

54       NOTE: Please consider for new development of Aliens that you use
55       Alien::Build and alienfile instead.  Like this module they work with
56       Alien::Base.  Unlike this module they are more easily customized and
57       handle a number of corner cases better.  For a good place to start,
58       please see Alien::Build::Manual::AlienAuthor.  Although the Alien-Base
59       / Alien-Build team will continue to maintain this module, (we will
60       continue to fix bugs where appropriate), we aren't adding any new
61       features to this module.
62
63       This is a subclass of Module::Build, that with Alien::Base allows for
64       easy creation of Alien distributions.  This module is used during the
65       build step of your distribution.  When properly configured it will
66
67       use pkg-config to find and use the system version of the library
68       download, build and install the library if the system does not provide
69       it
70

METHODS

72   alien_check_installed_version
73       [version 0.001]
74
75        my $version = $abmb->alien_check_installed_version;
76
77       This function determines if the library is already installed as part of
78       the operating system, and returns the version as a string.  If it can't
79       be detected then it should return empty list.
80
81       The default implementation relies on "pkg-config", but you will
82       probably want to override this with your own implementation if the
83       package you are building does not use "pkg-config".
84
85   alien_check_built_version
86       [version 0.006]
87
88        my $version = $amb->alien_check_built_version;
89
90       This function determines the version of the library after it has been
91       built from source.  This function only gets called if the operating
92       system version can not be found and the package is successfully built.
93       The version is returned on success.  If the version can't be detected
94       then it should return empty list.  Note that failing to detect a
95       version is considered a failure and the corresponding "./Build" action
96       will fail!
97
98       Any string is valid as a version as far as Alien::Base is concerned.
99       The most useful value would be a number or dotted decimal that most
100       software developers recognize and that software tools can
101       differentiate.  In some cases packages will not have a clear version
102       number, in which case the string "unknown" would be a reasonable
103       choice.
104
105       The default implementation relies on "pkg-config", and other
106       heuristics, but you will probably want to override this with your own
107       implementation if the package you are building does not use
108       "pkg-config".
109
110       When this method is called, the current working directory will be the
111       build root.
112
113       If you see an error message like this:
114
115        Library looks like it installed, but no version was determined
116
117       After the package is built from source code then you probably need to
118       provide an implementation for this method.
119
120   alien_extract_archive
121       [version 0.024]
122
123         my $dir = $amb->alien_extract_archive($filename);
124
125       This function unpacks the given archive and returns the directory
126       containing the unpacked files.
127
128       The default implementation relies on Archive::Extract that is able to
129       handle most common formats. In order to handle other formats or
130       archives requiring some special treatment you may want to override this
131       method.
132
133   alien_do_system
134       [version 0.024]
135
136         my %result = $amb->alien_do_system($cmd)
137
138       Similar to Module::Build::do_system, also sets the path and several
139       environment variables in accordance to the object configuration (i.e.
140       "alien_bin_requires") and performs the interpolation of the patterns
141       described in "COMMAND INTERPOLATION" in Alien::Base::ModuleBuild::API.
142
143       Returns a set of key value pairs including "stdout", "stderr",
144       "success" and "command".
145
146   alien_do_commands
147        $amb->alien_do_commands($phase);
148
149       Executes the commands for the given phase.
150
151   alien_interpolate
152        my $string = $amb->alien_interpolate($string);
153
154       Takes the input string and interpolates the results.
155

GUIDE TO DOCUMENTATION

157       The documentation for "Module::Build" is broken up into sections:
158
159       General Usage (Module::Build)
160           This is the landing document for Alien::Base::ModuleBuild's parent
161           class.  It describes basic usage and background information.  Its
162           main purpose is to assist the user who wants to learn how to invoke
163           and control "Module::Build" scripts at the command line.
164
165           It also lists the extra documentation for its use. Users and
166           authors of Alien:: modules should familiarize themselves with these
167           documents. Module::Build::API is of particular importance to
168           authors.
169
170       Alien-Specific Usage (Alien::Base::ModuleBuild)
171           This is the document you are currently reading.
172
173       Authoring Reference (Alien::Base::Authoring)
174           This document describes the structure and organization of
175           "Alien::Base" based projects, beyond that contained in
176           "Module::Build::Authoring", and the relevant concepts needed by
177           authors who are writing Build.PL scripts for a distribution or
178           controlling "Alien::Base::ModuleBuild" processes programmatically.
179
180           Note that as it contains information both for the build and use
181           phases of Alien::Base projects, it is located in the upper
182           namespace.
183
184       API Reference (Alien::Base::ModuleBuild::API)
185           This is a reference to the "Alien::Base::ModuleBuild" API beyond
186           that contained in "Module::Build::API".
187

ENVIRONMENT

189       ALIEN_VERBOSE
190           Enables verbose output from M::B::do_system.
191
192       ALIEN_FORCE
193           Skips checking for an installed version and forces reinstalling the
194           Alien target.
195
196       ALIEN_INSTALL_TYPE
197           Set to 'share' or 'system' to override the install type.  Set to
198           'default' or unset to restore the default.
199
200       ALIEN_ARCH
201           Set to a true value to install to an arch-specific directory.
202
203       ALIEN_${MODULENAME}_REPO_${PROTOCOL}_${KEY}
204           Overrides $KEY in the given module's repository configuration
205           matching $PROTOCOL.  For example,
206           "ALIEN_OPENSSL_REPO_FTP_HOST=ftp.example.com".
207

SEE ALSO

209       Alien::Build
210       alienfile
211       Alien::Build::Manual::AlienAuthor
212       Alien
213

THANKS

215       Thanks also to
216
217       Christian Walde (Mithaldu)
218           For productive conversations about component interoperability.
219
220       kmx For writing Alien::Tidyp from which I drew many of my initial
221           ideas.
222
223       David Mertens (run4flat)
224           For productive conversations about implementation.
225
226       Mark Nunberg (mordy, mnunberg)
227           For graciously teaching me about rpath and dynamic loading,
228

AUTHOR

230       Original author: Joel A Berger <joel.a.berger@gmail.com>
231
232       Current maintainer: Graham Ollis <plicease@cpan.org>
233
234       Contributors:
235
236       David Mertens (run4flat)
237
238       Mark Nunberg (mordy, mnunberg)
239
240       Christian Walde (Mithaldu)
241
242       Brian Wightman (MidLifeXis)
243
244       Graham Ollis (plicease)
245
246       Zaki Mughal (zmughal)
247
248       mohawk2
249
250       Vikas N Kumar (vikasnkumar)
251
252       Flavio Poletti (polettix)
253
254       Salvador Fandin~o (salva)
255
256       Gianni Ceccarelli (dakkar)
257
258       Pavel Shaydo (zwon, trinitum)
259
260       Kang-min Liu (XXX, gugod)
261
262       Nicholas Shipp (nshp)
263
264       Petr Pisar (ppisar)
265
266       Alberto Simo~es (ambs)
267
269       This software is copyright (c) 2012-2020 by Joel A Berger.
270
271       This is free software; you can redistribute it and/or modify it under
272       the same terms as the Perl 5 programming language system itself.
273
274
275
276perl v5.32.0                      2020-09-02       Alien::Base::ModuleBuild(3)
Impressum