.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Alien::Base::ModuleBuild 3pm" .TH Alien::Base::ModuleBuild 3pm 2023-07-25 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Alien::Base::ModuleBuild \- A Module::Build subclass for building Alien:: modules and their libraries .SH VERSION .IX Header "VERSION" version 1.17 .SH SYNOPSIS .IX Header "SYNOPSIS" In your Build.PL: .PP .Vb 1 \& use Alien::Base::ModuleBuild; \& \& my $builder = Alien::Base::ModuleBuild\->new( \& module_name => \*(AqAlien::MyLibrary\*(Aq, \& \& configure_requires => { \& \*(AqAlien::Base::ModuleBuild\*(Aq => \*(Aq0.005\*(Aq, \& \*(AqModule::Build\*(Aq => \*(Aq0.28\*(Aq \& }, \& requires => { \& \*(AqAlien::Base\*(Aq => \*(Aq0.005\*(Aq, \& }, \& \& alien_name => \*(Aqmylibrary\*(Aq, # the pkg\-config name if you want \& # to use pkg\-config to discover \& # system version of the mylibrary \& \& alien_repository => { \& protocol => \*(Aqhttps\*(Aq, \& host => \*(Aqmyhost.org\*(Aq, \& location => \*(Aq/path/to/tarballs\*(Aq, \& pattern => qr{^mylibrary\-([0\-9\e.]+)\e.tar\e.gz$}, \& }, \& \& # this is the default: \& alien_build_commands => [ \& "%c \-\-prefix=%s", # %c is a platform independent version of ./configure \& "make", \& ], \& \& # this is the default for install: \& alien_install_commands => [ \& "make install", \& ], \& \& alien_isolate_dynamic => 1, \& ); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBNOTE\fR: Please consider for new development of Aliens that you use Alien::Build and alienfile instead. Like this module they work with Alien::Base. Unlike this module they are more easily customized and handle a number of corner cases better. For a good place to start, please see Alien::Build::Manual::AlienAuthor. Although the Alien-Base / Alien-Build team will continue to maintain this module, (we will continue to fix bugs where appropriate), we aren't adding any new features to this module. .PP This is a subclass of Module::Build, that with Alien::Base allows for easy creation of Alien distributions. This module is used during the build step of your distribution. When properly configured it will .IP "use pkg-config to find and use the system version of the library" 4 .IX Item "use pkg-config to find and use the system version of the library" .PD 0 .IP "download, build and install the library if the system does not provide it" 4 .IX Item "download, build and install the library if the system does not provide it" .PD .SH METHODS .IX Header "METHODS" .SS alien_check_installed_version .IX Subsection "alien_check_installed_version" [version 0.001] .PP .Vb 1 \& my $version = $abmb\->alien_check_installed_version; .Ve .PP This function determines if the library is already installed as part of the operating system, and returns the version as a string. If it can't be detected then it should return empty list. .PP The default implementation relies on \f(CW\*(C`pkg\-config\*(C'\fR, but you will probably want to override this with your own implementation if the package you are building does not use \f(CW\*(C`pkg\-config\*(C'\fR. .SS alien_check_built_version .IX Subsection "alien_check_built_version" [version 0.006] .PP .Vb 1 \& my $version = $amb\->alien_check_built_version; .Ve .PP This function determines the version of the library after it has been built from source. This function only gets called if the operating system version can not be found and the package is successfully built. The version is returned on success. If the version can't be detected then it should return empty list. Note that failing to detect a version is considered a failure and the corresponding \f(CW\*(C`./Build\*(C'\fR action will fail! .PP Any string is valid as a version as far as Alien::Base is concerned. The most useful value would be a number or dotted decimal that most software developers recognize and that software tools can differentiate. In some cases packages will not have a clear version number, in which case the string \f(CW\*(C`unknown\*(C'\fR would be a reasonable choice. .PP The default implementation relies on \f(CW\*(C`pkg\-config\*(C'\fR, and other heuristics, but you will probably want to override this with your own implementation if the package you are building does not use \f(CW\*(C`pkg\-config\*(C'\fR. .PP When this method is called, the current working directory will be the build root. .PP If you see an error message like this: .PP .Vb 1 \& Library looks like it installed, but no version was determined .Ve .PP After the package is built from source code then you probably need to provide an implementation for this method. .SS alien_extract_archive .IX Subsection "alien_extract_archive" [version 0.024] .PP .Vb 1 \& my $dir = $amb\->alien_extract_archive($filename); .Ve .PP This function unpacks the given archive and returns the directory containing the unpacked files. .PP The default implementation relies on Archive::Extract that is able to handle most common formats. In order to handle other formats or archives requiring some special treatment you may want to override this method. .SS alien_do_system .IX Subsection "alien_do_system" [version 0.024] .PP .Vb 1 \& my %result = $amb\->alien_do_system($cmd) .Ve .PP Similar to Module::Build's do_system, also sets the path and several environment variables in accordance to the object configuration (i.e. \f(CW\*(C`alien_bin_requires\*(C'\fR) and performs the interpolation of the patterns described in "COMMAND INTERPOLATION" in Alien::Base::ModuleBuild::API. .PP Returns a set of key value pairs including \f(CW\*(C`stdout\*(C'\fR, \f(CW\*(C`stderr\*(C'\fR, \&\f(CW\*(C`success\*(C'\fR and \f(CW\*(C`command\*(C'\fR. .SS alien_do_commands .IX Subsection "alien_do_commands" .Vb 1 \& $amb\->alien_do_commands($phase); .Ve .PP Executes the commands for the given phase. .SS alien_interpolate .IX Subsection "alien_interpolate" .Vb 1 \& my $string = $amb\->alien_interpolate($string); .Ve .PP Takes the input string and interpolates the results. .SS alien_install_network .IX Subsection "alien_install_network" [version 1.16] .PP .Vb 1 \& my $bool = $amb\->alien_install_network; .Ve .PP Returns true if downloading source from the internet is allowed. This is true unless \f(CW\*(C`ALIEN_INSTALL_NETWORK\*(C'\fR is defined and false. .SS alien_download_rule .IX Subsection "alien_download_rule" [version 1.16] .PP .Vb 1 \& my $rule = $amb\->alien_download_rule; .Ve .PP This will return one of \f(CW\*(C`warn\*(C'\fR, \f(CW\*(C`digest\*(C'\fR, \f(CW\*(C`encrypt\*(C'\fR, \f(CW\*(C`digest_or_encrypt\*(C'\fR or \f(CW\*(C`digest_and_encrypt\*(C'\fR. This is based on the \f(CW\*(C`ALIEN_DOWNLOAD_RULE\*(C'\fR environment variable. .SH "GUIDE TO DOCUMENTATION" .IX Header "GUIDE TO DOCUMENTATION" The documentation for \f(CW\*(C`Module::Build\*(C'\fR is broken up into sections: .IP "General Usage (Module::Build)" 4 .IX Item "General Usage (Module::Build)" This is the landing document for Alien::Base::ModuleBuild's parent class. It describes basic usage and background information. Its main purpose is to assist the user who wants to learn how to invoke and control \f(CW\*(C`Module::Build\*(C'\fR scripts at the command line. .Sp It also lists the extra documentation for its use. Users and authors of Alien:: modules should familiarize themselves with these documents. Module::Build::API is of particular importance to authors. .IP "Alien-Specific Usage (Alien::Base::ModuleBuild)" 4 .IX Item "Alien-Specific Usage (Alien::Base::ModuleBuild)" This is the document you are currently reading. .IP "Authoring Reference (Alien::Base::Authoring)" 4 .IX Item "Authoring Reference (Alien::Base::Authoring)" This document describes the structure and organization of \&\f(CW\*(C`Alien::Base\*(C'\fR based projects, beyond that contained in \&\f(CW\*(C`Module::Build::Authoring\*(C'\fR, and the relevant concepts needed by authors who are writing \fIBuild.PL\fR scripts for a distribution or controlling \&\f(CW\*(C`Alien::Base::ModuleBuild\*(C'\fR processes programmatically. .Sp Note that as it contains information both for the build and use phases of Alien::Base projects, it is located in the upper namespace. .IP "API Reference (Alien::Base::ModuleBuild::API)" 4 .IX Item "API Reference (Alien::Base::ModuleBuild::API)" This is a reference to the \f(CW\*(C`Alien::Base::ModuleBuild\*(C'\fR API beyond that contained in \f(CW\*(C`Module::Build::API\*(C'\fR. .IP "Using the resulting Alien (Alien::Build::Manual::AlienUser)" 4 .IX Item "Using the resulting Alien (Alien::Build::Manual::AlienUser)" Once you have an Alien you or your users can review this manual for how to use it. Generally speaking you should have some useful usage information in your Alien's POD, but some authors choose to direct their users to this manual instead. .IP "Using Alien::Build instead (Alien::Build::Manual)" 4 .IX Item "Using Alien::Build instead (Alien::Build::Manual)" As mentioned at the top, you are encouraged to use the Alien::Build and alienfile system instead. This manual is a starting point for the other Alien::Build documentation. .SH ENVIRONMENT .IX Header "ENVIRONMENT" .IP \fBALIEN_ARCH\fR 4 .IX Item "ALIEN_ARCH" Set to a true value to install to an arch-specific directory. .IP \fBALIEN_DOWNLOAD_RULE\fR 4 .IX Item "ALIEN_DOWNLOAD_RULE" This controls security options for fetching alienized packages over the internet. The legal values are: .RS 4 .ie n .IP """warn""" 4 .el .IP \f(CWwarn\fR 4 .IX Item "warn" Warn if the package is either unencrypted or lacks a digest. This is currently the default, but will change in the near future. .ie n .IP """digest""" 4 .el .IP \f(CWdigest\fR 4 .IX Item "digest" Fetch will not happen unless there is a digest for the alienized package. .ie n .IP """encrypt""" 4 .el .IP \f(CWencrypt\fR 4 .IX Item "encrypt" Fetch will not happen unless via an encrypted protocol like \f(CW\*(C`https\*(C'\fR, or if the package is bundled with the Alien. .ie n .IP """digest_or_encrypt""" 4 .el .IP \f(CWdigest_or_encrypt\fR 4 .IX Item "digest_or_encrypt" Fetch will only happen if the alienized package has a cryptographic signature digest, or if an encrypted protocol like \f(CW\*(C`https\*(C'\fR is used, or if the package is bundled with the Alien. This will be the default in the near future. .ie n .IP """digest_and_encrypt""" 4 .el .IP \f(CWdigest_and_encrypt\fR 4 .IX Item "digest_and_encrypt" Fetch will only happen if the alienized package has a cryptographic signature digest, and is fetched via a secure protocol (like \f(CW\*(C`https\*(C'\fR). Bundled packages are also considered fetch via a secure protocol, but will still require a digest. .RE .RS 4 .RE .IP \fBALIEN_FORCE\fR 4 .IX Item "ALIEN_FORCE" Skips checking for an installed version and forces reinstalling the Alien target. .IP \fBALIEN_INSTALL_NETWORK\fR 4 .IX Item "ALIEN_INSTALL_NETWORK" If true (the default if not defined), then network installs will be allowed. Set to \f(CW0\fR or another false value to turn off network installs. .IP \fBALIEN_INSTALL_TYPE\fR 4 .IX Item "ALIEN_INSTALL_TYPE" Set to \f(CW\*(C`share\*(C'\fR or \f(CW\*(C`system\*(C'\fR to override the install type. Set to \f(CW\*(C`default\*(C'\fR or unset to restore the default. .IP \fBALIEN_VERBOSE\fR 4 .IX Item "ALIEN_VERBOSE" Enables verbose output from M::B::do_system. .IP \fBALIEN_${MODULENAME}_REPO_${PROTOCOL}_${KEY}\fR 4 .IX Item "ALIEN_${MODULENAME}_REPO_${PROTOCOL}_${KEY}" Overrides \f(CW$KEY\fR in the given module's repository configuration matching \f(CW$PROTOCOL\fR. For example, \f(CW\*(C`ALIEN_OPENSSL_REPO_FTP_HOST=ftp.example.com\*(C'\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP Alien::Build 4 .IX Item "Alien::Build" .PD 0 .IP alienfile 4 .IX Item "alienfile" .IP Alien::Build::Manual::AlienAuthor 4 .IX Item "Alien::Build::Manual::AlienAuthor" .IP Alien 4 .IX Item "Alien" .PD .SH THANKS .IX Header "THANKS" Thanks also to .IP "Christian Walde (Mithaldu)" 4 .IX Item "Christian Walde (Mithaldu)" For productive conversations about component interoperability. .IP kmx 4 .IX Item "kmx" For writing Alien::Tidyp from which I drew many of my initial ideas. .IP "David Mertens (run4flat)" 4 .IX Item "David Mertens (run4flat)" For productive conversations about implementation. .IP "Mark Nunberg (mordy, mnunberg)" 4 .IX Item "Mark Nunberg (mordy, mnunberg)" For graciously teaching me about rpath and dynamic loading, .SH AUTHOR .IX Header "AUTHOR" Original author: Joel A Berger .PP Current maintainer: Graham Ollis .PP Contributors: .PP David Mertens (run4flat) .PP Mark Nunberg (mordy, mnunberg) .PP Christian Walde (Mithaldu) .PP Brian Wightman (MidLifeXis) .PP Graham Ollis (plicease) .PP Zaki Mughal (zmughal) .PP mohawk2 .PP Vikas N Kumar (vikasnkumar) .PP Flavio Poletti (polettix) .PP Salvador Fandiño (salva) .PP Gianni Ceccarelli (dakkar) .PP Pavel Shaydo (zwon, trinitum) .PP Kang-min Liu (劉康民, gugod) .PP Nicholas Shipp (nshp) .PP Petr Písař (ppisar) .PP Alberto Simões (ambs) .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2012\-2022 by Joel A Berger. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.