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