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 my $version_from = 'lib/File/Rsync/Mirror/Recent.pm';
8 my $version = MM->parse_version($version_from);
10 if ($ARGV[0] eq "--setversion") {
11 die "Your perl is a bit dated[$]].\nDo not make a release with it\n" if $] < 5.008;
12 die "Your MakeMaker is a bit dated[$ExtUtils::MakeMaker::VERSION].\nDo not make a release with it\n"
13 if $ExtUtils::MakeMaker::VERSION < 6.4502;
14 local $ENV{LANG} = "C";
15 my $dirty = `git status --porcelain --untracked-files=no`;
16 die "Not everything checked in or out?\n====\n$dirty====\n" if $dirty;
18 eval { require $version_from; }; die $@ if $@;
19 my $makefile = "Makefile";
20 unless (-f $makefile) {
21 $makefile = "Makefile.old";
23 unless (-f $makefile) {
24 die "no Makefile and no Makefile.old found";
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 != \$version) {
34 warn "Not equal: $namespace\\::VERSION[\$$namespace\::VERSION] MM generated version[\$version]";
37 } elsif ($ARGV[0] eq "--trial") {
38 die "FIXME: --trial does not seem to work";
42 # $version .= "-TRIAL";
45 "File::Rsync::Mirror::Recent" =>
48 file => $version_from,
51 for my $m (qw(Recentfile Recentfile::Done Recentfile::FakeBigFloat )) {
52 my $fullm = "File::Rsync::Mirror::$m";
55 $file = "lib/$file.pm";
56 my $v = MM->parse_version($file);
57 $provides->{$fullm} = {
63 my $preferzip = "bzip2"; # bzip2 | gzip
66 NAME => 'File::Rsync::Mirror::Recent',
68 AUTHOR => 'Andreas König <andreas.koenig.7os6VVqR@franz.ak.mind.de>',
72 # 'Data::Serializer' => 0.46, # restricted to YAML without it
77 'File::Basename' => 0,
78 'File::Find::Rule' => 0,
81 'File::Temp' => 0.21, # removes bogus test on parent directory
82 'List::MoreUtils' => 0,
83 'List::Pairwise' => 0,
85 'Data::Serializer' => 0,
92 grep { !/~/ } glob("bin/rrr bin/rrr-*")
95 DIST_DEFAULT => join(" ", # note: order matters!
96 "verify-changes-date",
97 "verify-changes-version",
103 "memo-howto-release",
105 $preferzip eq "bzip2" ?
106 (COMPRESS => 'bzip2 -9f',
108 (COMPRESS => 'gzip -9f',
111 ($ExtUtils::MakeMaker::VERSION >= 6.4502 ?
113 # write: git push git+ssh://repo.or.cz/srv/git/rersyncrecent.git master
115 repository => "git://repo.or.cz/rersyncrecent.git",
117 provides => $provides,
120 clean => { FILES => 'File-Rsync-Mirror-Recent-*' },
125 ==> I had to update some \$VERSIONs <==
126 ==> Your Makefile has been rebuilt. <==
127 ==> Please rerun the make command. <==
134 my $ret = $self->SUPER::distsignature_target(@_);
135 $ret =~ s|cpansign|\$(PERL) \`dirname \$(PERL)\`/cpansign|g;
141 Makefile: }.$version_from.q{
144 $(CP) $(DISTVNAME)/META.yml ./META.yml
147 $(PERL) Makefile.PL --setversion
150 @$(PERL) -ne 'BEGIN{my@t=(localtime)[5,4,3];$$t[0]+=1900;$$t[1]++;$$t=sprintf"%04d-%02d-%02d",@t}' \
151 -e '$$ok++,exit if /^$$t\s/; END{die "Alert: did not find <$$t> in Changes file" unless $$ok}' Changes
153 verify-changes-version:
154 @$(PERL) -ne '$$ok++,exit if /\b$(VERSION)\b/; END{die "Alert: did not find <$(VERSION)> in Changes file" unless $$ok}' Changes
157 @$(PERL) -e 'my$$s=join",",grep{!/^($(OKDIRS))\z/x&&-d($$_)}glob"*";' \
158 -e 'die"unexpected dir:$$s"if$$s'
161 $(NOECHO) $(ECHO) 'version ' $(VERSION)
162 $(NOECHO) $(ECHO) 'release-name ' $(DISTVNAME).tar$(SUFFIX)
165 $(NOECHO) $(ECHO) 'after successful make dist and upload do not forget to'
166 $(NOECHO) $(ECHO) ' make tag'
167 $(NOECHO) $(ECHO) ' git push --tags'
168 $(NOECHO) $(ECHO) 'before writing Changes do not forget to'
169 $(NOECHO) $(ECHO) ' git --no-pager log --no-merges --pretty=format:" %x20%x20 - %s (%an)" | less'
172 git tag -m 'This is $(VERSION)' "$(VERSION)"
175 $(PERL) `dirname $(PERL)`/cpansign -s
178 $(PERL) bin/rrr-init --force t/testserver
179 $(PERL) bin/rrr-server t/testserver/RECENT-1h.yaml &
180 $(PERL) bin/rrr-init --force t/testserver
187 # if we depend on $(DISTVNAME).tar$(SUFFIX), then the rest of the
188 # Makefile breaks our intent to NOT remake dist
191 tar xvjf $(DISTVNAME).tar$(SUFFIX)
192 cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL
193 cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
194 cd $(DISTVNAME) && $(MAKE) test $(PASTHRU)
197 touch $(DISTVNAME)/SIGNATURE && $(CP) $(DISTVNAME)/SIGNATURE ./SIGNATURE
198 $(CP) $(DISTVNAME)/META.yml ./META.yml
199 $(CP) $(DISTVNAME)/MANIFEST ./MANIFEST
206 my $out = $self->SUPER::distdir;
207 $out =~ s/distdir :/distdir ::/g;
211 # dist_dir was the name in very old MakeMaker as of 5.005_04
214 my $out = $self->SUPER::dist_dir;
215 $out =~ s/distdir :/distdir ::/g;