]> git.ipfire.org Git - thirdparty/git.git/blob - perl/Makefile.PL
Merge branch 'kk/maint-for-each-ref-multi-sort' into maint-1.7.11
[thirdparty/git.git] / perl / Makefile.PL
1 use strict;
2 use warnings;
3 use ExtUtils::MakeMaker;
4 use Getopt::Long;
5
6 # Sanity: die at first unknown option
7 Getopt::Long::Configure qw/ pass_through /;
8
9 GetOptions("localedir=s" => \my $localedir);
10
11 sub MY::postamble {
12 return <<'MAKE_FRAG';
13 instlibdir:
14 @echo '$(INSTALLSITELIB)'
15
16 ifneq (,$(DESTDIR))
17 ifeq (0,$(shell expr '$(MM_VERSION)' '>' 6.10))
18 $(error ExtUtils::MakeMaker version "$(MM_VERSION)" is older than 6.11 and so \
19 is likely incompatible with the DESTDIR mechanism. Try setting \
20 NO_PERL_MAKEMAKER=1 instead)
21 endif
22 endif
23
24 MAKE_FRAG
25 }
26
27 # XXX. When editing this list:
28 #
29 # * Please update perl/Makefile, too.
30 # * Don't forget to test with NO_PERL_MAKEMAKER=YesPlease
31 my %pm = (
32 'Git.pm' => '$(INST_LIBDIR)/Git.pm',
33 'Git/I18N.pm' => '$(INST_LIBDIR)/Git/I18N.pm',
34 'Git/SVN/Memoize/YAML.pm' => '$(INST_LIBDIR)/Git/SVN/Memoize/YAML.pm',
35 'Git/SVN/Fetcher.pm' => '$(INST_LIBDIR)/Git/SVN/Fetcher.pm',
36 'Git/SVN/Editor.pm' => '$(INST_LIBDIR)/Git/SVN/Editor.pm',
37 'Git/SVN/Prompt.pm' => '$(INST_LIBDIR)/Git/SVN/Prompt.pm',
38 'Git/SVN/Ra.pm' => '$(INST_LIBDIR)/Git/SVN/Ra.pm',
39 );
40
41 # We come with our own bundled Error.pm. It's not in the set of default
42 # Perl modules so install it if it's not available on the system yet.
43 eval { require Error };
44 if ($@ || $Error::VERSION < 0.15009) {
45 $pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';
46 }
47
48 # redirect stdout, otherwise the message "Writing perl.mak for Git"
49 # disrupts the output for the target 'instlibdir'
50 open STDOUT, ">&STDERR";
51
52 WriteMakefile(
53 NAME => 'Git',
54 VERSION_FROM => 'Git.pm',
55 PM => \%pm,
56 PM_FILTER => qq[\$(PERL) -pe "s<\\Q++LOCALEDIR++\\E><$localedir>"],
57 MAKEFILE => 'perl.mak',
58 INSTALLSITEMAN3DIR => '$(SITEPREFIX)/share/man/man3'
59 );