emacs: tweak more cperl indentation config to match existing style
[gnu-stow.git] / Build.PL
blobc21d767c3dd3312924458253150d159657124e2c
1 # This file is part of GNU Stow.
3 # GNU Stow is free software: you can redistribute it and/or modify it
4 # under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
8 # GNU Stow is distributed in the hope that it will be useful, but
9 # WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see https://www.gnu.org/licenses/.
16 use strict;
17 use warnings;
19 use Module::Build;
21 # These are required by the test suite.
22 use lib "t";
23 use lib "bin";
25 my $build = Module::Build->new(
26     module_name => 'Stow',
27     keywords    => [ qw/stow symlink software package management install/ ],
28     license     => 'gpl',
30     # Module::Build forces us to use v1.4 of the CPAN Meta Spec:
31     # https://rt.cpan.org/Ticket/Display.html?id=71502
32     # 'meta-spec' =>  {
33     #     version => '2.0',
34     #     url     => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
35     # },
36     meta_add => {
37         resources => {
38             license => 'http://www.gnu.org/licenses/gpl-2.0.html' ,
39             homepage => 'https://savannah.gnu.org/projects/stow',
41             # Module::Build forces us to use v1.4 of the CPAN Meta Spec:
42             # https://rt.cpan.org/Ticket/Display.html?id=71502
43             # bugtracker => {
44             #     web    => 'http://rt.cpan.org/Public/Dist/Display.html?Name=Stow',
45             #     mailto => 'stow-devel@gnu.org',
46             # },
47             #bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=Stow',
49             # Module::Build forces us to use v1.4 of the CPAN Meta Spec:
50             # https://rt.cpan.org/Ticket/Display.html?id=71502
51             # repository => {
52             #     url  => 'git://git.savannah.gnu.org/stow.git',
53             #     web  => 'https://savannah.gnu.org/git/?group=stow',
54             #     type => 'git',
55             # },
56             repository => 'git://git.savannah.gnu.org/stow.git',
57         },
58     },
59     requires => {
60         'perl'        => '5.006',
61         'Carp'        => 0,
62         'IO::File'    => 0,
63     },
64     script_files => [ 'bin/stow', 'bin/chkstow' ],
65     all_from => 'lib/Stow.pm.in',
66     configure_requires => {
67         'Module::Build' => 0,
68     },
69     build_requires => {
70         'Test::More'   => 0,
71         'Test::Output' => 0,
72         'IO::Scalar'   => 0,
73     },
76 if (system('grep', '-q', '^use lib ', 'bin/stow') >> 8 == 0) {
77   die <<'EOF';
79 ERROR: bin/stow contains 'use lib' line which could interfere
80 with CPAN-style installation via Module::Build.  To avoid this,
81 you should run ./configure with parameters which result in
82 --with-pmdir's value being in Perl's built-in @INC, and then run
83 'make' (NOT 'make install') to regenerate bin/stow, e.g.
85     eval `perl -V:siteprefix`
86     ./configure --prefix=$siteprefix && make
90     ./configure --with-pmdir=`PERL5LIB= perl -le 'print $INC[0]'` && make
92 Then re-run this script.
94 Note that these parameters are chosen purely to regenerate
95 bin/stow without a 'use lib' line, so don't run 'make install'
96 while Stow is configured in this way unless you really want an
97 installation using these parameters.
99 EOF
102 $build->create_build_script();