3 use ExtUtils::MakeMaker;
4 $ExtUtils::MakeMaker::VERSION =~ s/_//g;
5 my @sign = (MM->can("signature_target") ? (SIGN => 1) : ());
6 my $version_diff = 0; # we'll have to die if this becomes true
7 $::version_from = 'lib/CPAN/Testers/ParseReport.pm';
8 my $mmgenereatedversionfrom = MM->parse_version($::version_from);
9 if ($ARGV[0] && $ARGV[0] eq "--setversion") {
10 die "Your perl is a bit dated[$]].\nDo not make a release with it\n" if $] < 5.008;
11 warn "Your MakeMaker is a bit dated[$ExtUtils::MakeMaker::VERSION].\nYou should get a new one\n"
12 if $ExtUtils::MakeMaker::VERSION < 6.4502;
13 eval { require $::version_from; }; die $@ if $@;
14 my $makefile = "Makefile";
15 unless (-f $makefile) {
16 $makefile = "Makefile.old";
18 unless (-f $makefile) {
19 die "no Makefile and no Makefile.old found";
21 my $dirty = ! system "git status -a > /dev/null";
23 system "git status -a";
24 die "Not everything checked in?";
26 open my $fh, "make -f $makefile the-release-name|" or die "Could not fork: $!";
28 my ($have_version) = <$fh> =~ /^version\s+([\d\._]+)/m;
29 close $fh or die "Could not close: $!";
30 my ($namespace) = $::version_from;
31 $namespace =~ s|^lib/(.+)\.pm$|$1|;
32 $namespace =~ s|/|::|g;
33 eval qq{ if (\$$namespace\::VERSION != \$have_version) {
34 warn "Not equal: CPAN::Testers::ParseReport::VERSION[\$$namespace\::VERSION] Makefile version[\$have_version]";
37 eval qq{ if (\$$namespace\::VERSION != \$mmgenereatedversionfrom) {
38 warn "Not equal: CPAN::Testers::ParseReport::VERSION[\$$namespace\::VERSION] MM generated version[\$mmgenereatedversionfrom]";
43 my %indirect_dependencies =
48 my %interesting_modules;
59 $interesting_modules{$m} = $m->VERSION;
65 'Config::Perl::V' => 0,
66 'DateTime::Format::Strptime' => 0,
69 'HTML::Entities' => 0,
72 'LWP::UserAgent' => 0,
74 'MIME::QuotedPrint' => 3.07,
76 'Statistics::Regression' => 0,
79 'Time::Local' => 1.11,
81 'XML::LibXML::XPathContext' => 0,
84 # intentionally avoiding any size comparisons, trying to catch
85 # interesting cases that happen during WriteMakefile, like
86 # http://www.cpantesters.org/cpan/report/e1942da8-5fcc-11e0-994f-224f8e2a057c
87 while (my($k,$v) = each %interesting_modules) {
88 $prereq_pm->{$k} ||= $v;
90 while (my($k,$v) = each %indirect_dependencies) {
91 $prereq_pm->{$k} ||= $v;
96 'NAME' => 'CPAN::Testers::ParseReport',
97 'VERSION_FROM' => $::version_from,
98 'PREREQ_PM' => $prereq_pm,
99 'INSTALLDIRS' => 'site',
104 ABSTRACT => "parse reports to www.cpantesters.org from various sources",
107 DIST_DEFAULT => join(" ", # note: order matters!
108 "verify-changes-date",
115 COMPRESS => 'bzip2 -9f',
118 ($ExtUtils::MakeMaker::VERSION >= 6.4502 ?
120 # write: git push git+ssh://repo.or.cz/srv/git/cpan-testers-parsereport.git master
121 repository => "git://repo.or.cz/cpan-testers-parsereport.git",
122 provides => { "CPAN::Testers::ParseReport" => { version => $mmgenereatedversionfrom, file => $::version_from }},
128 while (my($k,$v) = each %interesting_modules) {
129 warn "Found $k version $v\n";
136 ==> I had to update some \$VERSIONs <==
137 ==> Your Makefile has been rebuilt. <==
138 ==> Please rerun the make command. <==
146 # the subdirs on MY OWN BOX are allowed here (only used for make dist!)
147 OKDIRS=DIST|bin|blib|cover_db\
150 Makefile: }.$::version_from.q{
153 $(CP) $(DISTVNAME)/META.yml ./META.yml
156 $(PERL) Makefile.PL --setversion
159 @$(PERL) -ne 'BEGIN{my@t=(localtime)[5,4,3];$$t[0]+=1900;$$t[1]++;$$t=sprintf"%04d-%02d-%02d",@t}' \
160 -e '$$ok++,exit if /^$$t\s/; END{die "Alert: did not find <$$t> in Changes file" unless $$ok}' Changes
163 @$(PERL) -e 'my$$s=join",",grep{!/^($(OKDIRS))\z/x&&-d($$_)}glob"*";' \
164 -e 'die"unexpected dir:$$s"if$$s'
167 $(NOECHO) $(ECHO) 'version ' $(VERSION)
168 $(NOECHO) $(ECHO) 'release-name ' $(DISTVNAME).tar$(SUFFIX)
171 git tag -m 'This is $(VERSION)' $(VERSION)
172 ls -l $(DISTVNAME).tar$(SUFFIX)
183 # if we depend on $(DISTVNAME).tar$(SUFFIX), then the rest of the
184 # Makefile breaks our intent to NOT remake dist
187 tar xvjf $(DISTVNAME).tar$(SUFFIX)
188 cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL
189 cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
190 cd $(DISTVNAME) && $(MAKE) test $(PASTHRU)
193 touch $(DISTVNAME)/SIGNATURE && $(CP) $(DISTVNAME)/SIGNATURE ./SIGNATURE
194 $(CP) $(DISTVNAME)/META.yml ./META.yml
195 $(CP) $(DISTVNAME)/MANIFEST ./MANIFEST
202 my $out = $self->SUPER::distdir;
203 $out =~ s/distdir :/distdir ::/g;
207 # dist_dir was the name in very old MakeMaker as of 5.005_04
210 my $out = $self->SUPER::dist_dir;
211 $out =~ s/distdir :/distdir ::/g;