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.48;
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 = `git status --porcelain --untracked-files=no`;
22 die "Not everything checked in or out?\n====\n$dirty====\n" if $dirty;
23 open my $fh, "make -f $makefile the-release-name|" or die "Could not fork: $!";
25 my ($have_version) = <$fh> =~ /^version\s+([\d\._]+)/m;
26 close $fh or die "Could not close: $!";
27 my ($namespace) = $::version_from;
28 $namespace =~ s|^lib/(.+)\.pm$|$1|;
29 $namespace =~ s|/|::|g;
30 eval qq{ if (\$$namespace\::VERSION != \$have_version) {
31 warn "Not equal: CPAN::Testers::ParseReport::VERSION[\$$namespace\::VERSION] Makefile version[\$have_version]";
34 eval qq{ if (\$$namespace\::VERSION != \$mmgenereatedversionfrom) {
35 warn "Not equal: CPAN::Testers::ParseReport::VERSION[\$$namespace\::VERSION] MM generated version[\$mmgenereatedversionfrom]";
40 my %indirect_dependencies =
44 'CPAN::Meta::Converter' => '2.110440',
46 my %interesting_modules;
55 if (eval "require $m; 1") {
56 $interesting_modules{$m} = $m->VERSION;
62 'Compress::Zlib' => 0,
63 'DateTime::Format::Strptime' => 0,
64 'ExtUtils::MakeMaker' => 6.48,
65 'File::Path' => '1.08',
67 'HTML::Entities' => 0,
71 'LWP::UserAgent' => 0,
72 'List::AllUtils' => 0,
73 'MIME::QuotedPrint' => '3.07',
74 'Pod::Usage' => '1.33',
75 'Statistics::Regression' => 0,
78 'Time::Local' => '1.11',
81 # intentionally avoiding any size comparisons, trying to catch
82 # interesting cases that happen during WriteMakefile, like
83 # http://www.cpantesters.org/cpan/report/e1942da8-5fcc-11e0-994f-224f8e2a057c
84 while (my($k,$v) = each %interesting_modules) {
85 $prereq_pm->{$k} ||= $v;
87 while (my($k,$v) = each %indirect_dependencies) {
88 $prereq_pm->{$k} ||= $v;
93 'NAME' => 'CPAN::Testers::ParseReport',
94 'VERSION_FROM' => $::version_from,
95 'PREREQ_PM' => $prereq_pm,
96 'INSTALLDIRS' => 'site',
101 ABSTRACT => "parse reports to www.cpantesters.org from various sources",
104 DIST_DEFAULT => join(" ", # note: order matters!
105 "verify-changes-date",
112 COMPRESS => 'bzip2 -9f',
116 # write: git push git+ssh://repo.or.cz/srv/git/cpan-testers-parsereport.git master
117 resources => { repository => "https://repo.or.cz/cpan-testers-parsereport.git" },
118 provides => { "CPAN::Testers::ParseReport" => { version => $mmgenereatedversionfrom, file => $::version_from }},
120 MIN_PERL_VERSION => '5.008', # Rule: _pragma_utf8
125 while (my($k,$v) = each %interesting_modules) {
126 warn "Found $k version $v\n";
133 ==> I had to update some \$VERSIONs <==
134 ==> Your Makefile has been rebuilt. <==
135 ==> Please rerun the make command. <==
142 my $ret = $self->SUPER::distsignature_target(@_);
143 $ret =~ s|cpansign|\$(PERL) \`dirname \$(PERL)\`/cpansign|g;
149 # the subdirs on MY OWN BOX are allowed here (only used for make dist!)
150 OKDIRS=DIST|bin|blib|cover_db\
153 Makefile: }.$::version_from.q{
156 $(CP) $(DISTVNAME)/META.yml ./META.yml
159 $(PERL) Makefile.PL --setversion
162 @$(PERL) -ne 'BEGIN{my@t=(localtime)[5,4,3];$$t[0]+=1900;$$t[1]++;$$t=sprintf"%04d-%02d-%02d",@t}' \
163 -e '$$ok++,exit if /^[\d\.]+\s+$$t\s/ && $$.<12; END{die "Alert: did not find <$$t> in the first 12 lines of the Changes file" unless $$ok}' Changes
166 @$(PERL) -e 'my$$s=join",",grep{!/^($(OKDIRS))\z/x&&-d($$_)}glob"*";' \
167 -e 'die"unexpected dir:$$s"if$$s'
170 $(NOECHO) $(ECHO) 'version ' $(VERSION)
171 $(NOECHO) $(ECHO) 'release-name ' $(DISTVNAME).tar$(SUFFIX)
174 git tag -m 'This is $(VERSION)' $(VERSION)
175 ls -l $(DISTVNAME).tar$(SUFFIX)
179 $(PERL) `dirname $(PERL)`/cpansign -s
186 # if we depend on $(DISTVNAME).tar$(SUFFIX), then the rest of the
187 # Makefile breaks our intent to NOT remake dist
190 tar xvjf $(DISTVNAME).tar$(SUFFIX)
191 cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL
192 cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
193 cd $(DISTVNAME) && $(MAKE) test $(PASTHRU)
196 touch $(DISTVNAME)/SIGNATURE && $(CP) $(DISTVNAME)/SIGNATURE ./SIGNATURE
197 $(CP) $(DISTVNAME)/META.yml ./META.yml
198 $(CP) $(DISTVNAME)/MANIFEST ./MANIFEST
205 my $out = $self->SUPER::distdir;
206 $out =~ s/distdir :/distdir ::/g;
210 # dist_dir was the name in very old MakeMaker as of 5.005_04
213 my $out = $self->SUPER::dist_dir;
214 $out =~ s/distdir :/distdir ::/g;