]> Sergey Matveev's repositories - public-inbox.git/blob - Makefile.PL
filter: use IPC::Run and improve lynx error handling
[public-inbox.git] / Makefile.PL
1 #!/usr/bin/perl -w
2 # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
3 # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
4 use strict;
5 use ExtUtils::MakeMaker;
6 WriteMakefile(
7         NAME => 'public-inbox',
8         VERSION => '0.0.0',
9         AUTHOR => 'Eric Wong <normalperson@yhbt.net>',
10         ABSTRACT => 'public-inbox server infrastructure',
11         EXE_FILES => [qw/public-inbox-mda public-inbox-cgi/],
12         PREREQ_PM => {
13                 # note: we use ssoma(1) and spamc(1), NOT the Perl modules
14                 # We also depend on git through ssoma.
15                 # Keep this sorted and synced to the INSTALL document
16                 'CGI' => 0,
17                 'Date::Parse' => 0,
18                 'Email::Address' => 0,
19                 'Email::Filter' => 0,
20                 'Email::MIME' => 0,
21                 'Email::MIME::ContentType' => 0,
22                 'Encode::MIME::Header' => 0,
23                 'File::Path::Expand' => 0,
24                 'IPC::Run' => 0,
25                 'Mail::Thread' => '2.5', # 2.5+ needed for Email::Simple compat
26                 'URI::Escape' => 0,
27                 'XML::Atom::SimpleFeed' => 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 RSYNC_DEST = public-inbox.org:/srv/public-inbox/
36 docs = README COPYING INSTALL $(shell git ls-files Documentation/ '*.txt')
37 gz_docs = $(addsuffix .gz, $(docs))
38 %.gz: %
39         gzip -9 --rsyncable < $< > $@+
40         touch -r $< $@+
41         mv $@+ $@
42
43 gz-docs: $(gz_docs)
44 rsync-docs:
45         git set-file-times $(docs)
46         $(MAKE) gz-docs
47         rsync --chmod=Fugo=r -av $(gz_docs) $(docs) $(RSYNC_DEST)
48
49 N = $(shell echo $$(( $$(nproc 2>/dev/null || echo 2) + 1)))
50 check:: pure_all
51         prove -lv -j$(N)
52
53 EOF
54 }