Move stuff behind GITALIST_RELEASE_TESTING env
[catagits/Gitalist.git] / Makefile.PL
1 #!/usr/bin/env perl
2
3 use strict;
4 use warnings;
5
6 use inc::Module::Install 0.91;
7 if ($ENV{GITALIST_RELEASE_TESTING}) {
8     require Module::Install::AuthorRequires;
9     require Module::Install::AuthorTests;
10     require Module::Install::ReadmeFromPod;
11 }
12
13 name 'Gitalist';
14 all_from 'lib/Gitalist.pm';
15 readme_from 'lib/Gitalist.pm';
16
17 author 'Dan Brook <broq@cpan.org>';
18
19 license 'gpl2';
20
21 requires 'Catalyst::Runtime' => '5.8001402';
22 requires 'Catalyst::Plugin::ConfigLoader';
23 requires 'Catalyst::Plugin::StackTrace';
24 requires 'Catalyst::Plugin::Static::Simple';
25 requires 'Catalyst::Plugin::Unicode::Encoding';
26 requires 'Catalyst::Action::RenderView';
27 requires 'Catalyst::Component::InstancePerContext';
28 requires 'Catalyst::View::TT';
29
30 requires 'Template';
31 requires 'Template::Provider::Encoding';
32 requires 'Template::Plugin::Cycle';
33
34 requires 'Config::General';
35
36 requires 'Moose';
37 requires 'Moose::Autobox';
38 requires 'MooseX::Declare' => '0.32';
39 requires 'MooseX::Types::Common';
40 requires 'MooseX::Types::Path::Class';
41 requires 'MooseX::Types';
42 requires 'namespace::autoclean';
43
44 requires 'Git::PurePerl' => '0.43';
45
46 requires 'aliased';
47 requires 'CGI';
48 requires 'DateTime';
49 requires 'DateTime::Format::Mail';
50 requires 'File::Copy::Recursive';
51 requires 'File::Which';
52 requires 'HTML::Entities';
53 requires 'IPC::Run';
54 requires 'List::MoreUtils';
55 requires 'Path::Class' => '0.17';
56 requires 'Sub::Exporter';
57 requires 'Syntax::Highlight::Engine::Kate';
58 requires 'Sys::Hostname';
59 requires 'XML::Atom';
60 requires 'XML::RSS';
61 requires 'XML::OPML::SimpleGen';
62
63 test_requires 'Test::More' => '0.88';
64 test_requires 'Test::utf8' => '0.02';
65
66 resources bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=Gitalist';
67 resources repository => 'git://git.shadowcat.co.uk/catagits/Gitalist.git';
68
69 catalyst;
70
71 if ($ENV{GITALIST_RELEASE_TESTING}) {
72     author_tests 't/author';
73     author_requires 'Test::NoTabs';
74     author_requires 'Test::Pod' => '1.14';
75     author_requires 'Test::Pod::Coverage' => '1.04';
76 }
77
78 install_script glob('script/*.pl');
79 auto_install;
80
81 if ($Module::Install::AUTHOR && $ENV{GITALIST_RELEASE_TESTING}) {
82     # This is totally gross :)
83     # However, it is also much more effective than Module::Install::ProvidesClass
84     # which a) just does not work very well for us, b) totally won't install from
85     # cpan right now..
86     author_requires 'Module::Find';
87     author_requires 'B::Hooks::OP::Check::StashChange';
88     author_requires 'B::Compiling';
89     require Module::Find;
90     require B::Hooks::OP::Check::StashChange;
91     require B::Compiling;
92     require FindBin;
93     require lib;
94
95     my $libdir = "$FindBin::Bin/lib";
96     lib->import($libdir);
97
98     my %packages;
99
100     our $id = B::Hooks::OP::Check::StashChange::register(sub {
101         my ($new, $old) = @_;
102         my $file = B::Compiling::PL_compiling()->file;
103         return unless $file =~ s/^$libdir/lib/;
104         $packages{$new} ||= $file
105             if $new =~ /^Gitalist/;
106     });
107
108     require Gitalist;
109     Module::Find::useall(qw/Gitalist/);
110     undef $id;
111
112     no strict 'refs';
113     provides($_ => {
114         file => $packages{$_},
115         ${$_.'::VERSION'} ? ( version => $_->VERSION() ) : ()
116     }) for keys %packages;
117 }
118
119 WriteAll;
120