root/perl/SWISH-Prog/trunk/Makefile.PL

Revision 2182, 2.2 kB (checked in by karpet, 1 month ago)
  • change to JSON::XS and make json default format in Aggregator::Object
  • add perl_to_xml() in Utils
Line 
1 use ExtUtils::MakeMaker;
2
3 my %required = (
4     'Search::Tools'         => '0.16',    # important version
5     'File::Basename'        => 0,
6     'MIME::Types'           => 0,
7     'Path::Class'           => 0,
8     'SWISH::Filter'         => '0.09',
9     'Class::Accessor::Fast' => 0,
10     'File::Temp'            => 0,
11     'Data::Dump'            => 0,
12     'Config::General'       => '2.31',
13     'Scalar::Util'          => 0,
14     'Test::More'            => 0,
15     'File::Slurp'           => 0,         # Search::Tools also requires this
16
17 );
18
19 my %recommended = (
20
21     'File::Find'     => 0,    # should be part of base install just like Carp
22     'WWW::Mechanize' => 0,
23     'URI'            => 0,
24
25 );
26
27 my %optional = (
28     'YAML::Syck'     => '0.72',
29     'JSON::XS'       => 2.2222,
30     'Mail::Box'      => 0,
31     'DBI'            => 0,
32 );
33
34 my %extra;
35
36 # ask which of the optional modules should be installed
37 for my $class ( sort keys %recommended ) {
38     my $vers = $recommended{$class};
39     if ($vers) {
40         eval "use $class $vers";
41     }
42     else {
43         eval "use $class";
44     }
45     if ($@) {
46         my $reply
47             = prompt( "$class is recommended. Add it to CPAN install list?",
48             'yes' );
49         if ( $reply =~ m/^y/i ) {
50             $extra{$class} = $vers;
51         }
52     }
53 }
54 for my $class ( sort keys %optional ) {
55     my $vers = $optional{$class};
56     if ($vers) {
57         eval "use $class $vers";
58     }
59     else {
60         eval "use $class";
61     }
62     if ($@) {
63         my $reply
64             = prompt( "$class is optional. Add it to CPAN install list?",
65             'no' );
66         if ( $reply =~ m/^y/i ) {
67             $extra{$class} = $vers;
68         }
69     }
70 }
71
72 WriteMakefile(
73     NAME         => 'SWISH::Prog',
74     VERSION_FROM => 'lib/SWISH/Prog.pm',
75     PREREQ_PM    => { %required, %extra, },
76     (   $] >= 5.006
77         ?    ## Add these new keywords supported since 5.005
78             (
79             ABSTRACT_FROM =>
80                 'lib/SWISH/Prog.pm',    # retrieve abstract from module
81             AUTHOR => 'Peter Karman <karman@cpan.org>'
82             )
83         : ()
84     ),
85     clean => {
86         FILES =>
87             't/dbi_index t/swishobjects t/testindex index.swish t/xapian_index'
88     },
89
90 );
Note: See TracBrowser for help on using the browser.