root/trunk/plagger/Makefile.PL

Revision 2060 (checked in by miyagawa, 12 years ago)

apply RT 42542

Line 
1 use strict;
2 use inc::Module::Install;
3
4 {
5     no warnings 'redefine';
6     *recommends_hack = $Module::Install::VERSION > 0.70 ?
7         sub { recommends(@_); $_[0] } :
8         \&recommends;
9 }
10
11 name('Plagger');
12 all_from('lib/Plagger.pm');
13
14 requires('Class::Accessor::Fast');
15 requires('File::Find::Rule');
16 requires('UNIVERSAL::require' => 0.10);
17 requires('Template', 2.13);
18 requires('Template::Provider::Encoding' => 0.04);
19 requires('YAML' => 0.39);
20 requires('Text::Tags');
21 requires('DateTime' => 0.35);
22 requires('DateTime::TimeZone' => 0.56);
23 requires('DateTime::Locale' => 0.32);
24 requires('DateTime::Format::Mail');
25 requires('DateTime::Format::W3CDTF');
26 requires('DateTime::Format::Strptime');
27 requires('Digest::MD5');
28 requires('LWP');
29 requires('HTML::Parser' => 3.51);
30 requires('URI::Fetch' => 0.071);
31 requires('Cache::Cache' => 1.04);
32 requires('Module::Pluggable::Fast');
33 requires('HTML::ResolveLink');
34 requires('Date::Parse');
35 requires('MIME::Types', 1.16);
36 requires('Net::DNS');
37
38 requires('XML::Feed', 0.41);
39 requires('XML::LibXML');
40 requires('XML::Atom', 0.23);
41 requires('XML::RSS::LibXML', 0.3002);
42 requires('Encode', 2.10);
43 requires('Term::Encoding');
44 requires('File::HomeDir');
45
46 build_requires('YAML');
47 build_requires('YAML::Loader');
48 include_deps('YAML');
49
50 build_requires('Test::More', 0.42);
51 build_requires('Test::Base', 0.52);
52
53 features(
54     'Better Encoding detection' => [
55         -default => 0,
56         recommends_hack('Encode::Detect', 1.0),
57     ],
58     'POD Testing' => [
59         -default => 0,
60         recommends_hack('Test::Pod'),
61         recommends_hack('Test::Pod::Coverage'),
62     ],
63     'Cookie sharing with Firefox' => [
64         -default => 0,
65         recommends_hack('HTTP::Cookies::Mozilla'),
66     ],
67     'Liberal XML parsing' => [
68         -default => 1,
69         recommends_hack('XML::Liberal', 0.14),
70         recommends_hack('XML::RSS::Liberal'),
71     ],
72     'XPath support in Subscription and Feed Upgrader' => [
73         -default => 1,
74         recommends_hack('HTML::TreeBuilder::XPath'),
75     ],
76     'Better html to text formatter' => [
77         -default => 1,
78         recommends_hack('HTML::TreeBuilder'),
79         recommends_hack('HTML::FormatText'),
80     ],
81     'Parse Japanese datetime format' => [
82         -default => 0,
83         recommends_hack('DateTime::Format::Japanese'),
84     ],
85 );
86
87 require YAML;
88 require DirHandle;
89 require File::Spec;
90
91 my $dh = DirHandle->new("deps");
92 my @plugins;
93 while (my $f = $dh->read) {
94     next unless $f =~ /\.yaml$/;
95     my $meta = eval { YAML::LoadFile( File::Spec->catfile("deps", $f) ) };
96     if ($@) {
97         warn "Loading deps/$f failed: $@";
98         next;
99     }
100     push @plugins, $meta if !$meta->{platform} || $meta->{platform} eq $^O;
101 }
102
103 for my $meta (sort { $b->{default} <=> $a->{default} || $a->{name} cmp $b->{name} } @plugins) {
104     features(
105         $meta->{name}, [
106             -default => $meta->{default},
107             map recommends_hack($_ => $meta->{depends}->{$_}), keys %{$meta->{depends} || {}},
108         ],
109     );
110 }
111
112 tests 't/*.t t/*/*.t t/*/*/*.t';
113
114 use_test_base;
115
116 auto_include;
117 auto_install;
118
119 install_script('plagger');
120 install_script('bin/plagger-ircbot');
121 WriteAll;
Note: See TracBrowser for help on using the browser.