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 = `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 'File::Path' => '1.08',
66 'HTML::Entities' => 0,
70 'LWP::UserAgent' => 0,
72 'MIME::QuotedPrint' => '3.07',
73 'Pod::Usage' => '1.33',
74 'Statistics::Regression' => 0,
77 'Time::Local' => '1.11',
80 # intentionally avoiding any size comparisons, trying to catch
81 # interesting cases that happen during WriteMakefile, like
82 # http://www.cpantesters.org/cpan/report/e1942da8-5fcc-11e0-994f-224f8e2a057c
83 while (my($k,$v) = each %interesting_modules) {
84 $prereq_pm->{$k} ||= $v;
86 while (my($k,$v) = each %indirect_dependencies) {
87 $prereq_pm->{$k} ||= $v;
92 'NAME' => 'CPAN::Testers::ParseReport',
93 'VERSION_FROM' => $::version_from,
94 'PREREQ_PM' => $prereq_pm,
95 'INSTALLDIRS' => 'site',
100 ABSTRACT => "parse reports to www.cpantesters.org from various sources",
103 DIST_DEFAULT => join(" ", # note: order matters!
104 "verify-changes-date",
111 COMPRESS => 'bzip2 -9f',
114 ($ExtUtils::MakeMaker::VERSION >= 6.4502 ?
116 # write: git push git+ssh://repo.or.cz/srv/git/cpan-testers-parsereport.git master
117 resources => { repository => "git://repo.or.cz/cpan-testers-parsereport.git" },
118 provides => { "CPAN::Testers::ParseReport" => { version => $mmgenereatedversionfrom, file => $::version_from }},
124 while (my($k,$v) = each %interesting_modules) {
125 warn "Found $k version $v\n";
132 ==> I had to update some \$VERSIONs <==
133 ==> Your Makefile has been rebuilt. <==
134 ==> Please rerun the make command. <==
141 my $ret = $self->SUPER::distsignature_target(@_);
142 $ret =~ s|cpansign|\$(PERL) \`dirname \$(PERL)\`/cpansign|g;
148 # the subdirs on MY OWN BOX are allowed here (only used for make dist!)
149 OKDIRS=DIST|bin|blib|cover_db\
152 Makefile: }.$::version_from.q{
155 $(CP) $(DISTVNAME)/META.yml ./META.yml
158 $(PERL) Makefile.PL --setversion
161 @$(PERL) -ne 'BEGIN{my@t=(localtime)[5,4,3];$$t[0]+=1900;$$t[1]++;$$t=sprintf"%04d-%02d-%02d",@t}' \
162 -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
165 @$(PERL) -e 'my$$s=join",",grep{!/^($(OKDIRS))\z/x&&-d($$_)}glob"*";' \
166 -e 'die"unexpected dir:$$s"if$$s'
169 $(NOECHO) $(ECHO) 'version ' $(VERSION)
170 $(NOECHO) $(ECHO) 'release-name ' $(DISTVNAME).tar$(SUFFIX)
173 git tag -m 'This is $(VERSION)' $(VERSION)
174 ls -l $(DISTVNAME).tar$(SUFFIX)
178 $(PERL) `dirname $(PERL)`/cpansign -s
185 # if we depend on $(DISTVNAME).tar$(SUFFIX), then the rest of the
186 # Makefile breaks our intent to NOT remake dist
189 tar xvjf $(DISTVNAME).tar$(SUFFIX)
190 cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL
191 cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
192 cd $(DISTVNAME) && $(MAKE) test $(PASTHRU)
195 touch $(DISTVNAME)/SIGNATURE && $(CP) $(DISTVNAME)/SIGNATURE ./SIGNATURE
196 $(CP) $(DISTVNAME)/META.yml ./META.yml
197 $(CP) $(DISTVNAME)/MANIFEST ./MANIFEST
204 my $out = $self->SUPER::distdir;
205 $out =~ s/distdir :/distdir ::/g;
209 # dist_dir was the name in very old MakeMaker as of 5.005_04
212 my $out = $self->SUPER::dist_dir;
213 $out =~ s/distdir :/distdir ::/g;