ExtUtils-InstallPaths-0.015 000755 001750 001750 0 15065562753 15347 5 ustar 00leont leont 000000 000000 README 100644 001750 001750 615 15065562753 16272 0 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015 This archive contains the distribution ExtUtils-InstallPaths,
version 0.015:
Build.PL install path logic made easy
This software is copyright (c) 2011 by Ken Williams, Leon Timmermans.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
This README file was generated by Dist::Zilla::Plugin::Readme v6.033.
Changes 100644 001750 001750 3531 15065562753 16725 0 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015 Revision history for ExtUtils-InstallPaths
0.015 2025-09-26 21:13:44+02:00 Europe/Brussels
- Restore installing non-standard types
0.014 2024-09-10 18:20:50+02:00 Europe/Brussels
- Drop 5.006 support
- Compensate for perls without installsitescript
0.013 2024-04-25 12:28:37+02:00 Europe/Brussels
- Try to install any installable paths
0.012 2018-05-10 21:03:33+02:00 Europe/Amsterdam
- Allow a argument to install_map with source dirs
- Make tests prove and 5.6 friendly
0.011 2015-02-16 00:47:54+01:00 Europe/Amsterdam
Make EU::IP compatible with perl 5.6
Declare dependency on File::Spec 0.83 for case_sensitive
0.010 2013-10-29 12:17:18 Europe/Amsterdam
Deprecated usage of legacy configuration variables
Generate default paths more dynamically
0.009 2012-12-07 00:04:52 Europe/Amsterdam
Add relative path checkers to relpaths arguments
Rewrote merging algorithm
0.008 2012-11-29 21:13:50 Europe/Amsterdam
Don't require ExtUtils::Config object
Fix portability issues in test paths
0.007 2012-11-22 21:00:18 Europe/Amsterdam
Refactor everything into sanity
0.006 2012-08-05 20:28:27 Europe/Bucharest
Add original_prefix and install_sets
Various documentation improvements
0.005 2012-01-09 23:34:16 Europe/Amsterdam
Don't return references to internal state
0.004 2011-10-29 00:49:21 Europe/Amsterdam
Sanatized the config method
0.003 2011-08-22 16:23:30 Europe/Amsterdam
Reinstated the module_name parameter
0.002 2011-05-08 11:59:59 Europe/Amsterdam
Fixed case insensitive file matching in test
Fixed attribution
0.001 2011-04-04 15:32:56 Europe/Amsterdam
- Initial version
LICENSE 100644 001750 001750 46364 15065562753 16472 0 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015 This software is copyright (c) 2011 by Ken Williams, Leon Timmermans.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
Terms of the Perl programming language system itself
a) the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any
later version, or
b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
This software is Copyright (c) 2011 by Ken Williams, Leon Timmermans.
This is free software, licensed under:
The GNU General Public License, Version 1, February 1989
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.
When we speak of free software, we are referring to freedom, not
price. Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must tell them their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License. The
"Program", below, refers to any such program or work, and a "work based
on the Program" means either the Program or any work containing the
Program or a portion of it, either verbatim or with modifications. Each
licensee is addressed as "you".
1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program. You may charge a fee for the physical act of
transferring a copy.
2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:
a) cause the modified files to carry prominent notices stating that
you changed the files and the date of any change; and
b) cause the whole of any work that you distribute or publish, that
in whole or in part contains the Program or any part thereof, either
with or without modifications, to be licensed at no charge to all
third parties under the terms of this General Public License (except
that you may choose to grant warranty protection to some or all
third parties, at your option).
c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the simplest and most usual way, to print or display an
announcement including an appropriate copyright notice and a notice
that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these
conditions, and telling the user how to view a copy of this General
Public License.
d) You may charge a fee for the physical act of transferring a
copy, and you may at your option offer warranty protection in
exchange for a fee.
Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.
3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:
a) accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of
Paragraphs 1 and 2 above; or,
b) accompany it with a written offer, valid for at least three
years, to give any third party free (except for a nominal charge
for the cost of distribution) a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of
Paragraphs 1 and 2 above; or,
c) accompany it with the information you received as to where the
corresponding source code may be obtained. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form alone.)
Source code for a work means the preferred form of the work for making
modifications to it. For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.
4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License. However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.
5. By copying, distributing or modifying the Program (or any work based
on the Program) you indicate your acceptance of this license to do so,
and all its terms and conditions.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions. You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.
7. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of the license which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
the license, you may choose any version ever published by the Free Software
Foundation.
8. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
Copyright (C) 19yy
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see .
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19xx name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License. Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your
program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (a program to direct compilers to make passes
at assemblers) written by James Hacker.
, 1 April 1989
Moe Ghoul, President of Vice
That's all there is to it!
--- The Perl Artistic License 1.0 ---
This software is Copyright (c) 2011 by Ken Williams, Leon Timmermans.
This is free software, licensed under:
The Perl Artistic License 1.0
The "Artistic License"
Preamble
The intent of this document is to state the conditions under which a
Package may be copied, such that the Copyright Holder maintains some
semblance of artistic control over the development of the package,
while giving the users of the package the right to use and distribute
the Package in a more-or-less customary fashion, plus the right to make
reasonable modifications.
Definitions:
"Package" refers to the collection of files distributed by the
Copyright Holder, and derivatives of that collection of files
created through textual modification.
"Standard Version" refers to such a Package if it has not been
modified, or has been modified in accordance with the wishes
of the Copyright Holder as specified below.
"Copyright Holder" is whoever is named in the copyright or
copyrights for the package.
"You" is you, if you're thinking about copying or distributing
this Package.
"Reasonable copying fee" is whatever you can justify on the
basis of media cost, duplication charges, time of people involved,
and so on. (You will not be required to justify it to the
Copyright Holder, but only to the computing community at large
as a market that must bear the fee.)
"Freely Available" means that no fee is charged for the item
itself, though there may be fees involved in handling the item.
It also means that recipients of the item may redistribute it
under the same conditions they received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications
derived from the Public Domain or from the Copyright Holder. A Package
modified in such a way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided
that you insert a prominent notice in each changed file stating how and
when you changed that file, and provided that you do at least ONE of the
following:
a) place your modifications in the Public Domain or otherwise make them
Freely Available, such as by posting said modifications to Usenet or
an equivalent medium, or placing the modifications on a major archive
site such as uunet.uu.net, or by allowing the Copyright Holder to include
your modifications in the Standard Version of the Package.
b) use the modified Package only within your corporation or organization.
c) rename any non-standard executables so the names do not conflict
with standard executables, which must also be provided, and provide
a separate manual page for each non-standard executable that clearly
documents how it differs from the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
4. You may distribute the programs of this Package in object code or
executable form, provided that you do at least ONE of the following:
a) distribute a Standard Version of the executables and library files,
together with instructions (in the manual page or equivalent) on where
to get the Standard Version.
b) accompany the distribution with the machine-readable source of
the Package with your modifications.
c) give non-standard executables non-standard names, and clearly
document the differences in manual pages (or equivalent), together
with instructions on where to get the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
5. You may charge a reasonable copying fee for any distribution of this
Package. You may charge any fee you choose for support of this
Package. You may not charge a fee for this Package itself. However,
you may distribute this Package in aggregate with other (possibly
commercial) programs as part of a larger (possibly commercial) software
distribution provided that you do not advertise this Package as a
product of your own. You may embed this Package's interpreter within
an executable of yours (by linking); this shall be construed as a mere
form of aggregation, provided that the complete Standard Version of the
interpreter is so embedded.
6. The scripts and library files supplied as input to or produced as
output from the programs of this Package do not automatically fall
under the copyright of this Package, but belong to whoever generated
them, and may be sold commercially, and may be aggregated with this
Package. If such scripts or library files are aggregated with this
Package via the so-called "undump" or "unexec" methods of producing a
binary executable image, then distribution of such an image shall
neither be construed as a distribution of this Package nor shall it
fall under the restrictions of Paragraphs 3 and 4, provided that you do
not represent such an executable image as a Standard Version of this
Package.
7. C subroutines (or comparably compiled subroutines in other
languages) supplied by you and linked into this Package in order to
emulate subroutines and variables of the language defined by this
Package shall not be considered part of this Package, but are the
equivalent of input as in Paragraph 6, provided these subroutines do
not change the language in any way that would cause it to fail the
regression tests for the language.
8. Aggregation of this Package with a commercial distribution is always
permitted provided that the use of this Package is embedded; that is,
when no overt attempt is made to make this Package's interfaces visible
to the end user of the commercial distribution. Such use shall not be
construed as a distribution of this Package.
9. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.
10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The End
INSTALL 100644 001750 001750 4652 15065562753 16470 0 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015 This is the Perl distribution ExtUtils-InstallPaths.
Installing ExtUtils-InstallPaths is straightforward.
## Installation with cpanm
If you have cpanm, you only need one line:
% cpanm ExtUtils::InstallPaths
If it does not have permission to install modules to the current perl, cpanm
will automatically set up and install to a local::lib in your home directory.
See the local::lib documentation (https://metacpan.org/pod/local::lib) for
details on enabling it in your environment.
## Installing with the CPAN shell
Alternatively, if your CPAN shell is set up, you should just be able to do:
% cpan ExtUtils::InstallPaths
## Manual installation
As a last resort, you can manually install it. If you have not already
downloaded the release tarball, you can find the download link on the module's
MetaCPAN page: https://metacpan.org/pod/ExtUtils::InstallPaths
Untar the tarball, install configure prerequisites (see below), then build it:
% perl Makefile.PL
% make && make test
Then install it:
% make install
On Windows platforms, you should use `dmake` or `nmake`, instead of `make`.
If your perl is system-managed, you can create a local::lib in your home
directory to install modules to. For details, see the local::lib documentation:
https://metacpan.org/pod/local::lib
The prerequisites of this distribution will also have to be installed manually. The
prerequisites are listed in one of the files: `MYMETA.yml` or `MYMETA.json` generated
by running the manual build process described above.
## Configure Prerequisites
This distribution requires other modules to be installed before this
distribution's installer can be run. They can be found under the
"configure_requires" key of META.yml or the
"{prereqs}{configure}{requires}" key of META.json.
## Other Prerequisites
This distribution may require additional modules to be installed after running
Makefile.PL.
Look for prerequisites in the following phases:
* to run make, PHASE = build
* to use the module code itself, PHASE = runtime
* to run tests, PHASE = test
They can all be found in the "PHASE_requires" key of MYMETA.yml or the
"{prereqs}{PHASE}{requires}" key of MYMETA.json.
## Documentation
ExtUtils-InstallPaths documentation is available as POD.
You can run `perldoc` from a shell to read the documentation:
% perldoc ExtUtils::InstallPaths
For more information on installing Perl modules via CPAN, please see:
https://www.cpan.org/modules/INSTALL.html
dist.ini 100644 001750 001750 1171 15065562753 17074 0 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015 name = ExtUtils-InstallPaths
author = Ken Williams
author = Leon Timmermans
license = Perl_5
copyright_holder = Ken Williams, Leon Timmermans
copyright_year = 2011
[Git::GatherDir]
[PruneCruft]
[MetaYAML]
[License]
[Manifest]
[Readme]
[AutoPrereqs]
skip = VMS::Filespec
[MetaJSON]
[GitHub::Meta]
[Git::NextVersion]
[MetaProvides::Package]
[MakeMaker]
[PodSyntaxTests]
[PodCoverageTests]
[InstallGuide]
[PodWeaver]
[PkgVersion]
[NextRelease]
[CheckChangesHasContent]
[Git::Check]
[RunExtraTests]
[TestRelease]
[ConfirmRelease]
[UploadToCPAN]
[Git::Commit]
[Git::Tag]
[Git::Push]
META.yml 100644 001750 001750 2023 15065562753 16676 0 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015 ---
abstract: 'Build.PL install path logic made easy'
author:
- 'Ken Williams '
- 'Leon Timmermans '
build_requires:
File::Spec::Functions: '0.83'
File::Temp: '0'
Test::More: '0'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.033, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: ExtUtils-InstallPaths
provides:
ExtUtils::InstallPaths:
file: lib/ExtUtils/InstallPaths.pm
version: '0.015'
requires:
Carp: '0'
ExtUtils::Config: '0.009'
File::Spec: '0'
perl: '5.008'
strict: '0'
warnings: '0'
resources:
bugtracker: https://github.com/Perl-Toolchain-Gang/extutils-installpaths/issues
repository: git://github.com/Perl-Toolchain-Gang/extutils-installpaths.git
version: '0.015'
x_generated_by_perl: v5.42.0
x_serialization_backend: 'YAML::Tiny version 1.76'
x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later'
MANIFEST 100644 001750 001750 377 15065562753 16550 0 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.033.
Changes
INSTALL
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README
dist.ini
lib/ExtUtils/InstallPaths.pm
t/destinations.t
xt/author/pod-coverage.t
xt/author/pod-syntax.t
META.json 100644 001750 001750 3660 15065562753 17056 0 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015 {
"abstract" : "Build.PL install path logic made easy",
"author" : [
"Ken Williams ",
"Leon Timmermans "
],
"dynamic_config" : 0,
"generated_by" : "Dist::Zilla version 6.033, CPAN::Meta::Converter version 2.150010",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : 2
},
"name" : "ExtUtils-InstallPaths",
"prereqs" : {
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "0"
}
},
"develop" : {
"requires" : {
"Pod::Coverage::TrustPod" : "0",
"Test::More" : "0",
"Test::Pod" : "1.41",
"Test::Pod::Coverage" : "1.08"
}
},
"runtime" : {
"requires" : {
"Carp" : "0",
"ExtUtils::Config" : "0.009",
"File::Spec" : "0",
"perl" : "5.008",
"strict" : "0",
"warnings" : "0"
}
},
"test" : {
"requires" : {
"File::Spec::Functions" : "0.83",
"File::Temp" : "0",
"Test::More" : "0"
}
}
},
"provides" : {
"ExtUtils::InstallPaths" : {
"file" : "lib/ExtUtils/InstallPaths.pm",
"version" : "0.015"
}
},
"release_status" : "stable",
"resources" : {
"bugtracker" : {
"web" : "https://github.com/Perl-Toolchain-Gang/extutils-installpaths/issues"
},
"repository" : {
"type" : "git",
"url" : "git://github.com/Perl-Toolchain-Gang/extutils-installpaths.git",
"web" : "https://github.com/Perl-Toolchain-Gang/extutils-installpaths"
}
},
"version" : "0.015",
"x_generated_by_perl" : "v5.42.0",
"x_serialization_backend" : "Cpanel::JSON::XS version 4.39",
"x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later"
}
Makefile.PL 100644 001750 001750 2557 15065562753 17413 0 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.033.
use strict;
use warnings;
use 5.008;
use ExtUtils::MakeMaker;
my %WriteMakefileArgs = (
"ABSTRACT" => "Build.PL install path logic made easy",
"AUTHOR" => "Ken Williams , Leon Timmermans ",
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => 0
},
"DISTNAME" => "ExtUtils-InstallPaths",
"LICENSE" => "perl",
"MIN_PERL_VERSION" => "5.008",
"NAME" => "ExtUtils::InstallPaths",
"PREREQ_PM" => {
"Carp" => 0,
"ExtUtils::Config" => "0.009",
"File::Spec" => 0,
"strict" => 0,
"warnings" => 0
},
"TEST_REQUIRES" => {
"File::Spec::Functions" => "0.83",
"File::Temp" => 0,
"Test::More" => 0
},
"VERSION" => "0.015",
"test" => {
"TESTS" => "t/*.t"
}
);
my %FallbackPrereqs = (
"Carp" => 0,
"ExtUtils::Config" => "0.009",
"File::Spec" => 0,
"File::Spec::Functions" => "0.83",
"File::Temp" => 0,
"Test::More" => 0,
"strict" => 0,
"warnings" => 0
);
unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
delete $WriteMakefileArgs{TEST_REQUIRES};
delete $WriteMakefileArgs{BUILD_REQUIRES};
$WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs);
t 000755 001750 001750 0 15065562753 15533 5 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015 destinations.t 100644 001750 001750 23550 15065562753 20611 0 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015/t #!/usr/bin/perl
use strict;
use warnings FATAL => 'all';
use Test::More tests => 111;
use Config;
use File::Temp 'tempdir';
use File::Spec::Functions 0.83 ':ALL';
my $tmp = tempdir('EIP-XXXXXXXX', CLEANUP => 1, DIR => tmpdir);
my $source = tempdir('EIP-XXXXXXXX', CLEANUP => 1, DIR => tmpdir);
chdir $source;
mkdir 'blib';
for my $subdir (qw/lib arch bin script man1 man3/) {
mkdir catdir('blib', $subdir);
}
use ExtUtils::Config;
use ExtUtils::InstallPaths;
#########################
# We need to create a well defined environment to test install paths.
# We do this by setting up appropriate Config entries.
my @installstyle = qw(lib perl5);
my $config = ExtUtils::Config->new({
installstyle => catdir(@installstyle),
installprivlib => catdir($tmp, @installstyle),
installarchlib => catdir($tmp, @installstyle, $Config{version}, $Config{archname}),
installbin => catdir($tmp, 'bin'),
installscript => catdir($tmp, 'bin'),
installman1dir => catdir($tmp, 'man', 'man1'),
installman3dir => catdir($tmp, 'man', 'man3'),
installhtml1dir => catdir($tmp, 'html'),
installhtml3dir => catdir($tmp, 'html'),
installsitelib => catdir($tmp, 'site', @installstyle, 'site_perl'),
installsitearch => catdir($tmp, 'site', @installstyle, 'site_perl', $Config{version}, $Config{archname}),
installsitebin => catdir($tmp, 'site', 'bin'),
installsitescript => catdir($tmp, 'site', 'bin'),
installsiteman1dir => catdir($tmp, 'site', 'man', 'man1'),
installsiteman3dir => catdir($tmp, 'site', 'man', 'man3'),
installsitehtml1dir => catdir($tmp, 'site', 'html'),
installsitehtml3dir => catdir($tmp, 'site', 'html'),
});
sub get_ei {
my %args = @_;
return ExtUtils::InstallPaths->new(installdirs => 'site', config => $config, dist_name => 'ExtUtils-InstallPaths', %args);
}
isa_ok(get_ei, 'ExtUtils::InstallPaths');
{
my $elem = catdir(rootdir, qw/foo bar/);
my $ei = get_ei(install_path => { elem => $elem});
is($ei->install_path('elem'), $elem, ' can read stored path');
}
{
my $ei = get_ei(install_base => catdir(rootdir, 'bar'), install_base_relpaths => { 'elem' => catdir(qw/foo bar/) });
is($ei->install_base_relpaths('elem'), catdir(qw/foo bar/), ' can read stored path');
is($ei->install_destination('lib'), catdir(rootdir, qw/bar lib perl5/), 'destination of other items is not affected');
}
{
my $ei = eval { get_ei(prefix_relpaths => { 'site' => { 'elem' => catdir(rootdir, qw/foo bar/)} }) };
is ($ei, undef, '$ei undefined');
like($@, qr/Value must be a relative path/, ' emits error if path not relative');
}
{
my $ei = get_ei(prefix_relpaths => { site => { elem => catdir(qw/foo bar/) } });
my $path = $ei->prefix_relpaths('site', 'elem');
is($path, catdir(qw(foo bar)), ' can read stored path');
}
# Check that we install into the proper default locations.
{
my $ei = get_ei();
test_install_destinations($ei, {
lib => catdir($tmp, 'site', @installstyle, 'site_perl'),
arch => catdir($tmp, 'site', @installstyle, 'site_perl', $Config{version}, $Config{archname}),
bin => catdir($tmp, 'site', 'bin'),
script => catdir($tmp, 'site', 'bin'),
bindoc => catdir($tmp, 'site', 'man', 'man1'),
libdoc => catdir($tmp, 'site', 'man', 'man3'),
binhtml => catdir($tmp, 'site', 'html'),
libhtml => catdir($tmp, 'site', 'html'),
}, 'installdirs=site');
test_install_map($ei, {
read => '',
write => catfile($ei->install_destination('arch'), qw/auto ExtUtils InstallPaths .packlist/),
catdir('blib', 'lib') => catdir($tmp, 'site', @installstyle, 'site_perl'),
catdir('blib', 'arch') => catdir($tmp, 'site', @installstyle, 'site_perl', $Config{version}, $Config{archname}),
catdir('blib', 'bin') => catdir($tmp, 'site', 'bin'),
catdir('blib', 'script') => catdir($tmp, 'site', 'bin'),
}, 'installdirs=site');
}
# Is installdirs honored?
{
my $ei = get_ei(installdirs => 'core');
is($ei->installdirs, 'core');
test_install_destinations($ei, {
lib => catdir($tmp, @installstyle),
arch => catdir($tmp, @installstyle, $Config{version}, $Config{archname}),
bin => catdir($tmp, 'bin'),
script => catdir($tmp, 'bin'),
bindoc => catdir($tmp, 'man', 'man1'),
libdoc => catdir($tmp, 'man', 'man3'),
binhtml => catdir($tmp, 'html'),
libhtml => catdir($tmp, 'html'),
});
}
# Check install_base()
{
my $install_base = catdir('foo', 'bar');
my $ei = get_ei(install_base => $install_base);
is($ei->prefix, undef);
is($ei->install_base, $install_base);
test_install_destinations($ei, {
lib => catdir($install_base, 'lib', 'perl5'),
arch => catdir($install_base, 'lib', 'perl5', $Config{archname}),
bin => catdir($install_base, 'bin'),
script => catdir($install_base, 'bin'),
bindoc => catdir($install_base, 'man', 'man1'),
libdoc => catdir($install_base, 'man', 'man3'),
binhtml => catdir($install_base, 'html'),
libhtml => catdir($install_base, 'html'),
});
test_install_map($ei, {
read => '',
write => catfile($ei->install_destination('arch'), qw/auto ExtUtils InstallPaths .packlist/),
catdir('blib', 'lib') => catdir($install_base, 'lib', 'perl5'),
catdir('blib', 'arch') => catdir($install_base, 'lib', 'perl5', $Config{archname}),
catdir('blib', 'bin') => catdir($install_base, 'bin'),
catdir('blib', 'script') => catdir($install_base, 'bin'),
}, 'install_base');
test_install_map($ei, {
read => '',
write => catfile($ei->install_destination('arch'), qw/auto ExtUtils InstallPaths .packlist/),
catdir('blib', 'lib') => catdir($install_base, 'lib', 'perl5'),
catdir('blib', 'arch') => catdir($install_base, 'lib', 'perl5', $Config{archname}),
catdir('blib', 'bin') => catdir($install_base, 'bin'),
catdir('blib', 'script') => catdir($install_base, 'bin'),
}, 'install_base', {
lib => catdir(qw/blib lib/),
arch => catdir(qw/blib arch/),
bin => catdir(qw/blib bin/),
script => catdir(qw/blib script/),
});
}
# Basic prefix test. Ensure everything is under the prefix.
{
my $prefix = catdir(qw/some prefix/);
my $ei = get_ei(prefix => $prefix);
ok(!defined $ei->install_base, 'install_base is not defined');
is($ei->prefix, $prefix, "The prefix is $prefix");
test_prefix($ei, $prefix);
# test_prefix($ei, $prefix, $ei->install_sets('site'));
}
# And now that prefix honors installdirs.
{
my $prefix = catdir(qw/some prefix/);
my $ei = get_ei(prefix => $prefix, installdirs => 'core');
is($ei->installdirs, 'core');
test_prefix($ei, $prefix);
}
{
my $ei = get_ei;
# Try a config setting which would result in installation locations outside
# the prefix. Ensure it doesn't.
# Get the prefix defaults
my @types = $ei->install_types;
# Create a configuration involving weird paths that are outside of
# the configured prefix.
my @prefixes = ([qw(foo bar)], [qw(biz)], []);
my %test_config;
foreach my $type (@types) {
my $prefix = shift @prefixes || [qw(foo bar)];
$test_config{$type} = catdir(rootdir, @$prefix, @{$ei->prefix_relpaths('site', $type)});
}
# Poke at the innards of E::IP to change the default install locations.
my $prefix = catdir('another', 'prefix');
my $config = ExtUtils::Config->new({ siteprefixexp => catdir(rootdir, 'wierd', 'prefix')});
$ei = get_ei(install_sets => { site => \%test_config }, config => $config, prefix => $prefix);
test_prefix($ei, $prefix, \%test_config);
}
# Check that we can use install_base after setting prefix.
{
my $install_base = catdir('foo', 'bar');
my $ei = get_ei(install_base => $install_base, prefix => 'whatever');
test_install_destinations($ei, {
lib => catdir($install_base, 'lib', 'perl5'),
arch => catdir($install_base, 'lib', 'perl5', $Config{archname}),
bin => catdir($install_base, 'bin'),
script => catdir($install_base, 'bin'),
bindoc => catdir($install_base, 'man', 'man1'),
libdoc => catdir($install_base, 'man', 'man3'),
binhtml => catdir($install_base, 'html'),
libhtml => catdir($install_base, 'html'),
});
}
sub dir_contains {
my ($first, $second) = @_;
# File::Spec doesn't have an easy way to check whether one directory
# is inside another, unfortunately.
($first, $second) = map { canonpath($_) } ($first, $second);
my @first_dirs = splitdir($first);
my @second_dirs = splitdir($second);
return 0 if @second_dirs < @first_dirs;
my $is_same = ( case_tolerant() ? sub { lc(shift()) eq lc(shift()) } : sub { shift() eq shift() });
while (@first_dirs) {
return 0 unless $is_same->(shift @first_dirs, shift @second_dirs);
}
return 1;
}
sub test_prefix {
my ($ei, $prefix, $test_config) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
foreach my $type (qw/lib arch bin script bindoc libdoc binhtml libhtml/) {
my $dest = $ei->install_destination($type);
ok dir_contains($prefix, $dest), "$type prefixed";
SKIP: {
skip("'$type' not configured", 1) unless $test_config && $test_config->{$type};
have_same_ending($dest, $test_config->{$type}, " suffix correctish ($test_config->{$type} + $prefix = $dest)");
}
}
}
sub have_same_ending {
my ($dir1, $dir2, $message) = @_;
$dir1 =~ s{/$}{} if $^O eq 'cygwin'; # remove any trailing slash
my (undef, $dirs1, undef) = splitpath $dir1;
my @dir1 = splitdir $dirs1;
$dir2 =~ s{/$}{} if $^O eq 'cygwin'; # remove any trailing slash
my (undef, $dirs2, undef) = splitpath $dir2;
my @dir2 = splitdir $dirs2;
is $dir1[-1], $dir2[-1], $message;
}
sub test_install_destinations {
my ($build, $expect) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
while(my ($type, $expect) = each %$expect) {
is($build->install_destination($type), $expect, "$type destination");
}
}
sub test_install_map {
my ($paths, $expect, $case, @args) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
my $map = $paths->install_map(@args);
while(my ($type, $expect) = each %$expect) {
is($map->{$type}, $expect, "$type destination for $case");
}
}
author 000755 001750 001750 0 15065562753 17225 5 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015/xt pod-syntax.t 100644 001750 001750 252 15065562753 21637 0 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015/xt/author #!perl
# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
use strict; use warnings;
use Test::More;
use Test::Pod 1.41;
all_pod_files_ok();
pod-coverage.t 100644 001750 001750 365 15065562753 22111 0 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015/xt/author #!perl
# This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests.
use strict;
use warnings;
use Test::Pod::Coverage 1.08;
use Pod::Coverage::TrustPod;
all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
ExtUtils 000755 001750 001750 0 15065562753 17617 5 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015/lib InstallPaths.pm 100644 001750 001750 47125 15065562753 22754 0 ustar 00leont leont 000000 000000 ExtUtils-InstallPaths-0.015/lib/ExtUtils package ExtUtils::InstallPaths;
$ExtUtils::InstallPaths::VERSION = '0.015';
use 5.008;
use strict;
use warnings;
use File::Spec ();
use Carp ();
use ExtUtils::Config 0.009;
my %complex_accessors = map { $_ => 1 } qw/prefix_relpaths install_sets/;
my %hash_accessors = map { $_ => 1 } qw/install_path install_base_relpaths original_prefix /;
my %defaults = (
installdirs => 'site',
install_base => undef,
prefix => undef,
verbose => 0,
create_packlist => 1,
dist_name => undef,
module_name => undef,
destdir => undef,
install_path => sub { {} },
install_sets => \&_default_install_sets,
original_prefix => \&_default_original_prefix,
install_base_relpaths => \&_default_base_relpaths,
prefix_relpaths => \&_default_prefix_relpaths,
);
sub _merge_shallow {
my ($name, $filter) = @_;
return sub {
my ($override, $config) = @_;
my $defaults = $defaults{$name}->($config);
$filter->($_) for grep $filter, values %$override;
return { %$defaults, %$override };
}
}
sub _merge_deep {
my ($name, $filter) = @_;
return sub {
my ($override, $config) = @_;
my $defaults = $defaults{$name}->($config);
my $pair_for = sub {
my $key = shift;
my %override = %{ $override->{$key} || {} };
$filter && $filter->($_) for values %override;
return $key => { %{ $defaults->{$key} }, %override };
};
return { map { $pair_for->($_) } keys %$defaults };
}
}
my %allowed_installdir = map { $_ => 1 } qw/core site vendor/;
my $must_be_relative = sub { Carp::croak('Value must be a relative path') if File::Spec->file_name_is_absolute($_[0]) };
my %deep_filter = map { $_ => $must_be_relative } qw/install_base_relpaths prefix_relpaths/;
my %filter = (
installdirs => sub {
my $value = shift;
$value = 'core', Carp::carp('Perhaps you meant installdirs to be "core" rather than "perl"?') if $value eq 'perl';
Carp::croak('installdirs must be one of "core", "site", or "vendor"') if not $allowed_installdir{$value};
return $value;
},
(map { $_ => _merge_shallow($_, $deep_filter{$_}) } qw/original_prefix install_base_relpaths/),
(map { $_ => _merge_deep($_, $deep_filter{$_}) } qw/install_sets prefix_relpaths/),
);
sub new {
my ($class, %args) = @_;
my $config = $args{config} || ExtUtils::Config->new;
if ($config->get('installsitescript') eq '') {
$config = $config->but({ installsitescript => $config->get('installsitebin') });
}
my %self = (
config => $config,
map { $_ => exists $args{$_} ? $filter{$_} ? $filter{$_}->($args{$_}, $config) : $args{$_} : ref $defaults{$_} ? $defaults{$_}->($config) : $defaults{$_} } keys %defaults,
);
$self{module_name} ||= do { my $module_name = $self{dist_name}; $module_name =~ s/-/::/g; $module_name } if defined $self{dist_name};
return bless \%self, $class;
}
for my $attribute (keys %defaults) {
no strict qw/refs/;
*{$attribute} = $hash_accessors{$attribute} ?
sub {
my ($self, $key) = @_;
Carp::confess("$attribute needs key") if not defined $key;
return $self->{$attribute}{$key};
} :
$complex_accessors{$attribute} ?
sub {
my ($self, $installdirs, $key) = @_;
Carp::confess("$attribute needs installdir") if not defined $installdirs;
Carp::confess("$attribute needs key") if not defined $key;
return $self->{$attribute}{$installdirs}{$key};
} :
sub {
my $self = shift;
return $self->{$attribute};
};
}
my @install_sets_keys = qw/lib arch bin script bindoc libdoc binhtml libhtml/;
my @install_sets_tail = qw/bin script man1dir man3dir html1dir html3dir/;
my %install_sets_values = (
core => [ qw/privlib archlib/, @install_sets_tail ],
site => [ map { "site$_" } qw/lib arch/, @install_sets_tail ],
vendor => [ map { "vendor$_" } qw/lib arch/, @install_sets_tail ],
);
sub _default_install_sets {
my $c = shift;
my %ret;
for my $installdir (qw/core site vendor/) {
@{$ret{$installdir}}{@install_sets_keys} = map { $c->get("install$_") } @{ $install_sets_values{$installdir} };
}
return \%ret;
}
sub _default_base_relpaths {
my $config = shift;
return {
lib => ['lib', 'perl5'],
arch => ['lib', 'perl5', $config->get('archname')],
bin => ['bin'],
script => ['bin'],
bindoc => ['man', 'man1'],
libdoc => ['man', 'man3'],
binhtml => ['html'],
libhtml => ['html'],
};
}
my %common_prefix_relpaths = (
bin => ['bin'],
script => ['bin'],
bindoc => ['man', 'man1'],
libdoc => ['man', 'man3'],
binhtml => ['html'],
libhtml => ['html'],
);
sub _default_prefix_relpaths {
my $c = shift;
my @libstyle = $c->get('installstyle') ? File::Spec->splitdir($c->get('installstyle')) : qw(lib perl5);
my $arch = $c->get('archname');
my $version = $c->get('version');
return {
core => {
lib => [@libstyle],
arch => [@libstyle, $version, $arch],
%common_prefix_relpaths,
},
vendor => {
lib => [@libstyle],
arch => [@libstyle, $version, $arch],
%common_prefix_relpaths,
},
site => {
lib => [@libstyle, 'site_perl'],
arch => [@libstyle, 'site_perl', $version, $arch],
%common_prefix_relpaths,
},
};
}
sub _default_original_prefix {
my $c = shift;
my %ret = (
core => $c->get('installprefixexp'),
site => $c->get('siteprefixexp'),
vendor => $c->get('usevendorprefix') ? $c->get('vendorprefixexp') : '',
);
return \%ret;
}
sub _log_verbose {
my $self = shift;
print @_ if $self->verbose;
return;
}
# Given a file type, will return true if the file type would normally
# be installed when neither install-base nor prefix has been set.
# I.e. it will be true only if the path is set from Config.pm or
# set explicitly by the user via install-path.
sub is_default_installable {
my $self = shift;
my $type = shift;
my $installable = $self->install_destination($type) && ( $self->install_path($type) || $self->install_sets($self->installdirs, $type));
return $installable ? 1 : 0;
}
sub _prefixify_default {
my $self = shift;
my $type = shift;
my $rprefix = shift;
my $default = $self->prefix_relpaths($self->installdirs, $type);
if( !$default ) {
$self->_log_verbose(" no default install location for type '$type', using prefix '$rprefix'.\n");
return $rprefix;
} else {
return File::Spec->catdir(@{$default});
}
}
# Translated from ExtUtils::MM_Unix::prefixify()
sub _prefixify_novms {
my($self, $path, $sprefix, $type) = @_;
my $rprefix = $self->prefix;
$rprefix .= '/' if $sprefix =~ m{/$};
$self->_log_verbose(" prefixify $path from $sprefix to $rprefix\n") if defined $path && length $path;
if (not defined $path or length $path == 0 ) {
$self->_log_verbose(" no path to prefixify, falling back to default.\n");
return $self->_prefixify_default( $type, $rprefix );
} elsif( !File::Spec->file_name_is_absolute($path) ) {
$self->_log_verbose(" path is relative, not prefixifying.\n");
} elsif( $path !~ s{^\Q$sprefix\E\b}{}s ) {
$self->_log_verbose(" cannot prefixify, falling back to default.\n");
return $self->_prefixify_default( $type, $rprefix );
}
$self->_log_verbose(" now $path in $rprefix\n");
return $path;
}
sub _catprefix_vms {
my ($self, $rprefix, $default) = @_;
my ($rvol, $rdirs) = File::Spec->splitpath($rprefix);
if ($rvol) {
return File::Spec->catpath($rvol, File::Spec->catdir($rdirs, $default), '');
}
else {
return File::Spec->catdir($rdirs, $default);
}
}
sub _prefixify_vms {
my($self, $path, $sprefix, $type) = @_;
my $rprefix = $self->prefix;
return '' unless defined $path;
$self->_log_verbose(" prefixify $path from $sprefix to $rprefix\n");
require VMS::Filespec;
# Translate $(PERLPREFIX) to a real path.
$rprefix = VMS::Filespec::vmspath($rprefix) if $rprefix;
$sprefix = VMS::Filespec::vmspath($sprefix) if $sprefix;
$self->_log_verbose(" rprefix translated to $rprefix\n sprefix translated to $sprefix\n");
if (length($path) == 0 ) {
$self->_log_verbose(" no path to prefixify.\n")
}
elsif (!File::Spec->file_name_is_absolute($path)) {
$self->_log_verbose(" path is relative, not prefixifying.\n");
}
elsif ($sprefix eq $rprefix) {
$self->_log_verbose(" no new prefix.\n");
}
else {
my ($path_vol, $path_dirs) = File::Spec->splitpath( $path );
my $vms_prefix = $self->config->get('vms_prefix');
if ($path_vol eq $vms_prefix.':') {
$self->_log_verbose(" $vms_prefix: seen\n");
$path_dirs =~ s{^\[}{\[.} unless $path_dirs =~ m{^\[\.};
$path = $self->_catprefix_vms($rprefix, $path_dirs);
}
else {
$self->_log_verbose(" cannot prefixify.\n");
return File::Spec->catdir($self->prefix_relpaths($self->installdirs, $type));
}
}
$self->_log_verbose(" now $path\n");
return $path;
}
BEGIN { *_prefixify = $^O eq 'VMS' ? \&_prefixify_vms : \&_prefixify_novms }
# Translated from ExtUtils::MM_Any::init_INSTALL_from_PREFIX
sub prefix_relative {
my ($self, $installdirs, $type) = @_;
my $relpath = $self->install_sets($installdirs, $type);
return $self->_prefixify($relpath, $self->original_prefix($installdirs), $type);
}
sub install_destination {
my ($self, $type) = @_;
return $self->install_path($type) if $self->install_path($type);
if ( $self->install_base ) {
my $relpath = $self->install_base_relpaths($type);
return $relpath ? File::Spec->catdir($self->install_base, @{$relpath}) : undef;
}
if ( $self->prefix ) {
my $relpath = $self->prefix_relative($self->installdirs, $type);
return $relpath ? File::Spec->catdir($self->prefix, $relpath) : undef;
}
return $self->install_sets($self->installdirs, $type);
}
sub install_types {
my $self = shift;
my %types = ( %{ $self->{install_path} },
$self->install_base ? %{ $self->{install_base_relpaths} }
: $self->prefix ? %{ $self->{prefix_relpaths}{ $self->installdirs } }
: %{ $self->{install_sets}{ $self->installdirs } });
return sort keys %types;
}
sub install_map {
my ($self, $dirs) = @_;
my %localdir_for;
if ($dirs && %$dirs) {
%localdir_for = %$dirs;
}
else {
foreach my $type ($self->install_types) {
$localdir_for{$type} = File::Spec->catdir('blib', $type);
}
}
my (%map, @skipping);
foreach my $type (keys %localdir_for) {
next if not -e $localdir_for{$type} and not $self->is_default_installable($type);
if (my $dest = $self->install_destination($type)) {
$map{$localdir_for{$type}} = $dest;
} else {
push @skipping, $type;
}
}
warn "WARNING: Can't figure out install path for types: @skipping\nFiles will not be installed.\n" if @skipping;
# Write the packlist into the same place as ExtUtils::MakeMaker.
if ($self->create_packlist and my $module_name = $self->module_name) {
my $archdir = $self->install_destination('arch');
my @ext = split /::/, $module_name;
$map{write} = File::Spec->catfile($archdir, 'auto', @ext, '.packlist');
}
# Handle destdir
if (length(my $destdir = $self->destdir || '')) {
foreach (keys %map) {
# Need to remove volume from $map{$_} using splitpath, or else
# we'll create something crazy like C:\Foo\Bar\E:\Baz\Quux
# VMS will always have the file separate than the path.
my ($volume, $path, $file) = File::Spec->splitpath( $map{$_}, 0 );
# catdir needs a list of directories, or it will create something
# crazy like volume:[Foo.Bar.volume.Baz.Quux]
my @dirs = File::Spec->splitdir($path);
# First merge the directories
$path = File::Spec->catdir($destdir, @dirs);
# Then put the file back on if there is one.
if ($file ne '') {
$map{$_} = File::Spec->catfile($path, $file)
} else {
$map{$_} = $path;
}
}
}
$map{read} = ''; # To keep ExtUtils::Install quiet
return \%map;
}
1;
# ABSTRACT: Build.PL install path logic made easy
__END__
=pod
=encoding UTF-8
=head1 NAME
ExtUtils::InstallPaths - Build.PL install path logic made easy
=head1 VERSION
version 0.015
=head1 SYNOPSIS
use ExtUtils::InstallPaths;
use ExtUtils::Install 'install';
GetOptions(\my %opt, 'install_base=s', 'install_path=s%', 'installdirs=s', 'destdir=s', 'prefix=s', 'uninst:1', 'verbose:1');
my $paths = ExtUtils::InstallPaths->new(%opt, dist_name => $dist_name);
install($paths->install_map, $opt{verbose}, 0, $opt{uninst});
=head1 DESCRIPTION
This module tries to make install path resolution as easy as possible.
When you want to install a module, it needs to figure out where to install things. The nutshell version of how this works is that default installation locations are determined from L, and they may be individually overridden by using the C attribute. An C attribute lets you specify an alternative installation root like F and C does something similar in a rather different (and more complicated) way. C lets you specify a temporary installation directory like F in case you want to create bundled-up installable packages.
The following types are supported by default.
=over 4
=item * lib
Usually pure-Perl module files ending in F<.pm> or F<.pod>.
=item * arch
"Architecture-dependent" module files, usually produced by compiling XS, L, or similar code.
=item * script
Programs written in pure Perl. In order to improve reuse, you may want to make these as small as possible - put the code into modules whenever possible.
=item * bin
"Architecture-dependent" executable programs, i.e. compiled C code or something. Pretty rare to see this in a perl distribution, but it happens.
=item * bindoc
Documentation for the stuff in C