]> Sergey Matveev's repositories - public-inbox.git/blob - Makefile.PL
Makefile.PL: do not depend on git
[public-inbox.git] / Makefile.PL
1 #!/usr/bin/perl -w
2 # Copyright (C) 2013-2018 all contributors <meta@public-inbox.org>
3 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 use strict;
5 use ExtUtils::MakeMaker;
6 open my $m, '<', 'MANIFEST' or die "open(MANIFEST): $!\n";
7 chomp(my @manifest = (<$m>));
8 my @EXE_FILES = grep(m!^script/!, @manifest);
9 my $PM_FILES = join(' ', grep(m!^lib/.*\.pm$!, @manifest));
10
11 WriteMakefile(
12         NAME => 'PublicInbox',
13         VERSION => '1.1.0-pre1',
14         AUTHOR => 'Eric Wong <e@80x24.org>',
15         ABSTRACT => 'public-inbox server infrastructure',
16         EXE_FILES => \@EXE_FILES,
17         PREREQ_PM => {
18                 # note: we use spamc(1), NOT the Perl modules
19                 # We also depend on git.
20                 # Keep this sorted and synced to the INSTALL document
21                 'Date::Parse' => 0,
22                 'Email::MIME' => 0,
23                 'Email::MIME::ContentType' => 0,
24                 'Email::Simple' => 0,
25                 'Encode::MIME::Header' => 0,
26                 'Plack' => 0,
27                 'URI::Escape' => 0,
28                 # We have more test dependencies, but do not force
29                 # users to install them
30         },
31 );
32
33 sub MY::postamble {
34   <<EOF;
35 # support using eatmydata to speed up tests (apt-get install eatmydata):
36 # https://www.flamingspork.com/projects/libeatmydata/
37 EATMYDATA =
38 -include config.mak
39 -include Documentation/include.mk
40 N ?= \$(shell echo \$\$(( \$\$(nproc 2>/dev/null || echo 2) + 1)))
41 SCRIPTS := scripts/ssoma-replay
42 my_syntax := \$(addsuffix .syntax, $PM_FILES \$(EXE_FILES) \$(SCRIPTS))
43
44
45 %.syntax ::
46         @\$(PERL) -I lib -c \$(subst .syntax,,\$@)
47
48 syntax:: \$(my_syntax)
49
50 check-manifest :: MANIFEST
51         if git ls-files >\$<.gen 2>&1; then diff -u \$< \$<.gen; fi
52
53 check:: pure_all check-manifest
54         \$(EATMYDATA) prove -lv -j\$(N)
55
56 EOF
57 }