]> Sergey Matveev's repositories - public-inbox.git/blob - Makefile.PL
Merge remote-tracking branch 'origin/viewvcs' into master
[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
27                 # TODO: these should really be made optional...
28                 'Plack' => 0,
29                 'URI::Escape' => 0,
30
31                 # We have more test dependencies, but do not force
32                 # users to install them.  See INSTALL
33         },
34 );
35
36 sub MY::postamble {
37   <<EOF;
38 # support using eatmydata to speed up tests (apt-get install eatmydata):
39 # https://www.flamingspork.com/projects/libeatmydata/
40 EATMYDATA =
41 -include config.mak
42 -include Documentation/include.mk
43 N ?= \$(shell echo \$\$(( \$\$(nproc 2>/dev/null || echo 2) + 1)))
44 SCRIPTS := scripts/ssoma-replay
45 my_syntax := \$(addsuffix .syntax, $PM_FILES \$(EXE_FILES) \$(SCRIPTS))
46
47
48 %.syntax ::
49         @\$(PERL) -I lib -c \$(subst .syntax,,\$@)
50
51 syntax:: \$(my_syntax)
52
53 check-manifest :: MANIFEST
54         if git ls-files >\$<.gen 2>&1; then diff -u \$< \$<.gen; fi
55
56 check:: pure_all check-manifest
57         \$(EATMYDATA) prove -lv -j\$(N)
58
59 lib/PublicInbox/UserContent.pm :: contrib/css/216dark.css
60         @\$(PERL) -I lib \$@ \$<
61
62 EOF
63 }