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);
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 die "Your MakeMaker is a bit dated[$ExtUtils::MakeMaker::VERSION].\nYou should get a new one\n"
12 if $ExtUtils::MakeMaker::VERSION < 6.4502;
14 eval { require $version_from; }; die $@ if $@;
15 my $makefile = "Makefile";
16 unless (-f $makefile) {
17 $makefile = "Makefile.old";
19 unless (-f $makefile) {
20 die "no Makefile and no Makefile.old found";
22 open my $fh, "make -f $makefile the-release-name|" or die "Could not fork: $!";
24 my ($have_version) = <$fh> =~ /^version\s+([\d\._]+)/m;
25 close $fh or die "Could not close: $!";
26 my ($namespace) = $version_from;
27 $namespace =~ s|^lib/(.+)\.pm$|$1|;
28 $namespace =~ s|/|::|g;
29 eval qq{ if (\$$namespace\::VERSION != \$version) {
30 warn "Not equal: $namespace\\::VERSION[\$$namespace\::VERSION] MM generated version[\$version]";
36 "File::Rsync::Mirror::Recent" =>
39 file => $version_from,
42 for my $m (qw(Recentfile Recentfile::Done Recentfile::FakeBigFloat )) {
43 my $fullm = "File::Rsync::Mirror::$m";
46 $file = "lib/$file.pm";
47 my $v = MM->parse_version($file);
48 $provides->{$fullm} = {
54 my $preferzip = "bzip2"; # bzip2 | gzip
55 warn "Current zip variant: $preferzip\n";
59 NAME => 'File::Rsync::Mirror::Recent',
61 AUTHOR => 'Andreas König <andreas.koenig.7os6VVqR@franz.ak.mind.de>',
65 # 'Data::Serializer' => 0.46, # restricted to YAML without it
70 'File::Basename' => 0,
72 'File::Temp' => 0.21, # removes bogus test on parent directory
73 'List::MoreUtils' => 0,
74 'List::Pairwise' => 0,
76 'Data::Serializer' => 0,
82 grep {-x $_} grep { !/~/ } glob("bin/rrr*")
85 DIST_DEFAULT => join(" ", # note: order matters!
86 "verify-changes-date",
94 $preferzip eq "bzip2" ?
95 (COMPRESS => 'bzip2 -9f',
97 (COMPRESS => 'gzip -9f',
100 ($ExtUtils::MakeMaker::VERSION >= 6.4502 ?
102 # write: git push git+ssh://repo.or.cz/srv/git/rersyncrecent.git master
103 repository => "git://repo.or.cz/rersyncrecent.git",
104 provides => $provides,
107 clean => { FILES => 'File-Rsync-Mirror-Recent-*' },
112 ==> I had to update some \$VERSIONs <==
113 ==> Your Makefile has been rebuilt. <==
114 ==> Please rerun the make command. <==
122 Makefile: }.$version_from.q{
125 $(CP) $(DISTVNAME)/META.yml ./META.yml
128 $(PERL) Makefile.PL --setversion
131 @$(PERL) -ne 'BEGIN{my@t=(localtime)[5,4,3];$$t[0]+=1900;$$t[1]++;$$t=sprintf"%04d-%02d-%02d",@t}' \
132 -e '$$ok++,exit if /^$$t\s/; END{die "Alert: did not find <$$t> in Changes file" unless $$ok}' Changes
135 @$(PERL) -e 'my$$s=join",",grep{!/^($(OKDIRS))\z/x&&-d($$_)}glob"*";' \
136 -e 'die"unexpected dir:$$s"if$$s'
139 $(NOECHO) $(ECHO) 'version ' $(VERSION)
140 $(NOECHO) $(ECHO) 'release-name ' $(DISTVNAME).tar$(SUFFIX)
143 $(NOECHO) $(ECHO) 'after successful make dist and upload do not forget to'
144 $(NOECHO) $(ECHO) ' make tag'
145 $(NOECHO) $(ECHO) ' git push --tags'
146 $(NOECHO) $(ECHO) 'before writing Changes do not forget to'
147 $(NOECHO) $(ECHO) ' git --no-pager log --no-merges --pretty=format:" %x20%x20 - %s (%an)" | less'
150 git tag -m 'This is $(VERSION)' "$(VERSION)"
160 # if we depend on $(DISTVNAME).tar$(SUFFIX), then the rest of the
161 # Makefile breaks our intent to NOT remake dist
164 tar xvjf $(DISTVNAME).tar$(SUFFIX)
165 cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL
166 cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
167 cd $(DISTVNAME) && $(MAKE) test $(PASTHRU)
170 touch $(DISTVNAME)/SIGNATURE && $(CP) $(DISTVNAME)/SIGNATURE ./SIGNATURE
171 $(CP) $(DISTVNAME)/META.yml ./META.yml
172 $(CP) $(DISTVNAME)/MANIFEST ./MANIFEST
179 my $out = $self->SUPER::distdir;
180 $out =~ s/distdir :/distdir ::/g;
184 # dist_dir was the name in very old MakeMaker as of 5.005_04
187 my $out = $self->SUPER::dist_dir;
188 $out =~ s/distdir :/distdir ::/g;