1 #!/usr/bin/perl -w -*- mode: cperl -*-
3 use vars
qw( $VERSION @ST_PREFS );
4 BEGIN {$CPAN::Config_loaded=1}
5 BEGIN {$CPAN::Config_loaded=1} # keep old perls with -w quiet
6 use ExtUtils::MakeMaker qw(:DEFAULT);
8 eval { require File
::Spec
; };
9 my $HAVE_FILE_SPEC = !$@
;
10 eval { require YAML
::Syck
; };
11 my $HAVE_YAML_SYCK = !$@
;
12 use File
::Basename
qw(basename);
14 my $HAVE_MAKE = basename
($Config::Config
{make
}) eq "make"; # file-scoped!
20 my $Id = q
$Id: Makefile
.PL
146 2005-08-09 04:25:21Z k
$;
21 $VERSION = sprintf "%.3f", 1 + substr(q
$Rev: 146 $,4)/1000;
23 my $version_diff = 0; # we'll have to die if this becomes true
26 $ExtUtils::MakeMaker
::VERSION
= eval $ExtUtils::MakeMaker
::VERSION
;
28 $main::SVN_RELEASE
= 0;
30 $main::SVN_RELEASE
= 1;
31 } elsif ($ARGV[0] && $ARGV[0] =~ /setversion/) {
32 warn "!!!making release without .svn??? Take care!!!";
36 if ($HAVE_FILE_SPEC) {
37 my $version_set_manually = 1; # not by SVN
39 if ($ARGV[0] && $ARGV[0] eq "--setversion") {
40 die "Your perl is a bit dated[$]].\nDo not make a release with it\n" if $] < 5.008;
41 die "Your MakeMaker is a bit dated[$ExtUtils::MakeMaker::VERSION].\nDo not make a release with it\n"
42 if $ExtUtils::MakeMaker
::VERSION
< 6.4502;
43 die "Your MakeMaker doesn't do the sign woodoo" unless
44 MM
->can("signature_target");
47 local $ENV{LANG
} = "C";
48 open $st, "svn st -u|" or die;
52 next if /^Head revision:/;
53 next if /^Status against revision:/;
58 die "Not everything checked in or out?" if $dirty;
60 # $re parses the upper boundary of the output of svnversion
62 eval q{ $re = qr/(?:\d+:)?(\d+)[SM]*$/; };
63 die $@ if $@; # old perl
64 exit unless $version_diff;
68 # for 5.004_05 I installed all of them manually despite errors;
69 # version hints as of 2006-02
71 'File::Spec' => 0, # KWILLIAMS; requires
73 # PathTools-3.16.tar.gz
74 'File::Temp' => 0, # TJENNESS; requires Test::More;
75 'Scalar::Util' => 0, # GBARR;
76 # Scalar-List-Utils-1.18.tar.gz;
77 'Test::Harness' => 2.62,
78 'Test::More' => 0, # MSCHWERN;
79 # Test-Simple-0.62.tar.gz;
81 if ($^O eq "darwin") {
82 $prereq_pm->{'File::HomeDir'} = 0.69;
85 my @sign = (MM->can("signature_target") ? (SIGN => 1) : ());
88 INSTALLDIRS => 'perl', # as it is coming with perl
91 EXE_FILES => [qw(scripts/cpan)],
92 PREREQ_PM
=> $prereq_pm,
93 ($ExtUtils::MakeMaker
::VERSION
>= 6.3002 ?
94 (LICENSE
=> "perl") : (),
97 FILES
=> "lib/CPAN/Config.pm t/dot-cpan/FTPstats.yml",
102 # ABSTRACT_FROM => 'lib/CPAN.pm', # retrieve abstract from module
103 AUTHOR
=> 'Andreas Koenig <andreas.koenig.gmwojprw@franz.ak.mind.de>') : (),
106 DIST_DEFAULT
=> join(" ", # note: order matters!
108 "verify-changes-date",
109 "verify-changes-version",
110 "kwalify-distroprefs",
122 COMPRESS
=> 'gzip -9',
124 # I took it from RT-CPAN ticket 30098:
125 ($ExtUtils::MakeMaker
::VERSION
>= 6.4502 ?
127 repository
=> "git://github.com/andk/cpanpm.git",
133 ==> I had to update some \$VERSIONs <==
134 ==> Your Makefile has been rebuilt. <==
135 ==> Please rerun the make command. <==
144 LC_ALL_noexport=en_GB.utf8
146 ALL_PERLS = /usr/bin/perl \
147 /usr/local/bin/perl \
148 /usr/local/perl-5.004_05/bin/perl \
149 /usr/local/perl-5.005_04/bin/perl \
150 /usr/local/perl-5.6.2/bin/perl \
151 /usr/local/perl-5.8.0/bin/perl \
152 /usr/local/perl-5.8.4/bin/perl \
155 # not sorted because order matters
161 /home/src/perl/tk/SVN/. \
162 /home/src/graphics/magick/ImageMagick-6.3.5/PerlMagick/. \
165 # define a random one
166 MEGA_XML=logs/megainstall.20070412T1450.d/RJRAY!RPC-XML-0.59.xml
168 YAML_MODULE=YAML::Syck
171 my %map = map {($_ => 1)} qw(en_US.utf8 en_US.UTF-8);
172 open my $fh, "locale -a|" or die;
175 if (exists $map{$_}){
188 return "" unless $HAVE_MAKE; # dmake has unknown issues with my Makefile
194 trang -I rnc -O rng $*.rnc $*.rng
196 Makefile: Makefile.PL
201 update: svn-update dd-prefs
203 mega-validate: bin/colorout-to-dir.rng
204 xmllint -relaxng bin/colorout-to-dir.rng -noout $(MEGA_XML)
206 # the subdirs on MY OWN BOX are allowed here (only used for make dist!)
207 OKDIRS=CPAN|DIST|bin|blib|cover_db|\
208 distroprefs|eg|inc|lib|logs|patches|perlbug|\
209 protocols|related|release-lib|scripts|t|talks
212 @$(PERL) -e 'my$$s=join",",grep{!/^($(OKDIRS))\z/x&&-d($$_)}glob"*";' \
213 -e 'die"unexpected dir:$$s"if$$s'
216 @$(PERL) -ne 'BEGIN{my@t=(localtime)[5,4,3];$$t[0]+=1900;$$t[1]++;$$t=sprintf"%04d-%02d-%02d",@t}' \
217 -e '$$ok++,exit if /^$$t\s/; END{die "Alert: did not find <$$t> in Changes file" unless $$ok}' Changes
219 verify-changes-version:
220 @$(PERL) -ne '$$ok++,exit if /\b$(VERSION)\b/; END{die "Alert: did not find <$(VERSION)> in Changes file" unless $$ok}' Changes
223 `echo $(PERL) | sed -e 's/perl$$/slaymake/'` validate
226 $(PERL) Makefile.PL --setversion
228 # http://ch.tudelft.nl/~arthur/svn2cl/
229 chlog-trad : ChangeLogTrad.svn
230 ChangeLogTrad.svn : Makefile lib/CPAN.pm MANIFEST
231 -/home/src/devel/svn/svn2cl/svn2cl-current/svn2cl.sh --strip-prefix trunk --group-by-day --stdout -r HEAD:2000 https://pause.perl.org:5460/svn/cpanpm/trunk > $@
235 svn log --xml --verbose > ChangeLog.xml
238 $(NOECHO) $(ECHO) 'version ' $(VERSION)
239 $(NOECHO) $(ECHO) 'release-name ' $(DISTVNAME).tar$(SUFFIX)
242 /usr/bin/perl -Irelease-lib -S release $(DISTVNAME).tar$(SUFFIX)
244 svn cp -m 'This is $(VERSION)' https://pause.perl.org:5460/svn/cpanpm/trunk https://pause.perl.org:5460/svn/cpanpm/tags/$(VERSION)
249 # 16=Distribution; 1024=Shell; 32768=Queue
250 # $$CPAN::DEBUG|=16;$$CPAN::DEBUG|=1024;$$CPAN::DEBUG|=32768;
251 megainstall: logs/.exists
252 for DATE in `date +%Y%m%dT%H%M`; do \
253 nohup $(PERL) -Ilib -MCPAN -e 'install(qw(Term::ReadKey))' < /dev/null > logs/megainstall.$$DATE.out 2>&1; \
254 LANG=$(MYLANG) $(PERL) -Ilib -MCPAN -MPOSIX -e 'sub intime
{POSIX
::strftime
("%FT%T",localtime()) lt "2008-09-30T23:59:59"}; \
255 CPAN
::HandleConfig
->load; \
256 open FH
, "megainstall.txt" or die; chomp(@MEGA = grep {!/^#/} <FH
>); \
257 install
(grep {!m
[/]||-e
$$_} qw($(MEGA_BASE))); \
258 CPAN
::Shell
->reload("cpan"); \
259 install
(map {$$_->[0]} sort {$$a->[1]<=>$$b->[1]} map {[$$_,rand(1)]} @MEGA); \
260 CPAN
::Shell
->failed' >> logs/megainstall.$$DATE.out 2>&1; \
261 $(PERL) bin/colorout-to-dir-2.pl logs/megainstall.$$DATE.out; \
262 `pwd`/bin/dir-to-jifty.pl logs; \
265 # 16=Distribution; 32=Bundle; 32768=Queue
267 $(PERL) -Ilib -MCPAN -e 'CPAN
::HandleConfig
->load;$$CPAN::DEBUG
|=16;$$CPAN::DEBUG
|=32;$$CPAN::DEBUG
|=32768;install
(qw(CPAN::Test::Dummy::Perl5::Build::DepeFails));'
274 $(PERL) -MCPAN -eshell
277 $(PERL) -Ilib -It -MCPAN::MyConfig -MCPAN -deshell
280 $(PERL) -Ilib -MCPAN -e '$$CPAN::Suppress_readline
=$$CPAN::Echo_readline
=1;shell
' | tee ttt.out
283 $(PERL) -I$$HOME/.cpan -Ilib -MCPAN::SQLite -MCPAN::MyConfig -MCPAN -e '$$CPAN::Config
->{use_sqlite
}++; $$CPAN::Config
->{sqlite_dbname
}="cpandb-sqlite"; shell
'
285 testrun_very_offline : rm_mirrored_by run_emu_offline
287 testrun_emu_offline :
288 $(PERL) -I$$HOME/.cpan -Ilib -MCPAN::MyConfig -MCPAN -e '@CPAN::Defaultsites
= qw(file:///dev/null); $$CPAN::Config
->{urllist
} = []; shell
'
291 rm -f $$HOME/.cpan/sources/MIRRORED.BY*
294 $(PERL) -I$$HOME/.cpan -Ilib -MCPAN::MyConfig -MCPAN -e '$$CPAN::Config
->{urllist
} = [qw(http://www.planet-elektronik.de/CPAN/)]; shell
'
297 $(PERL) -Ilib -MCPAN -MCPAN::FirstTime -e 'CPAN
::FirstTime
::init
("$$ENV{HOME}/.cpan/CPAN/MyConfig", args
=> [qw(urllist)])'
300 $(PERL) -Ilib -MCPAN::Admin -eshell
303 $(PERL) -Ilib -MCPAN -deshell
308 show-batch-signing-keys:
309 for f in PAUSE*.pub; do echo "++++$$f++++"; gpg --verbose --with-colons $$f; done
312 gpg --list-sigs --with-colons 450F89EC
314 # seems to need at least gnupg 1.4.2:
315 upload-batch-signing-key:
316 gpg --send-key 450F89EC
325 @$(ECHO) make ci dist \&\& make release
328 $(CP) $(DISTVNAME)/META.yml ./META.yml
330 install-devel-cover-unless-uptodate:
331 $(PERL) -Ilib -MCPAN -e 'CPAN
::Shell
->install("/home/src/perl/devel-cover/SVN/.") unless CPAN
::Shell
->expand("Module","Devel::Cover")->uptodate'
333 install-devel-cover-unconditionally:
334 $(PERL) -Ilib -MCPAN -e 'CPAN
::Shell
->install("/home/src/perl/devel-cover/SVN/.")'
336 testcover: testdistros install-devel-cover-unless-uptodate
338 $(PERL) -MDevel::Cover -e 0
339 `dirname $(PERL)`/cover -delete
340 HARNESS_PERL_SWITCHES=-MDevel::Cover $(MAKE) test
341 `dirname $(PERL)`/cover
344 $(PERL)doc -F lib/CPAN.pm
348 for p in $(ALL_PERLS); do $$p -v && $$p Makefile.PL && $(MAKE) test; done
351 $(RM) t/CPAN/authors/id/A/AN/ANDK/*/Build \
352 t/CPAN/authors/id/A/AN/ANDK/*/Makefile.old
353 $(RM_RF) t/CPAN/authors/id/A/AN/ANDK/*/_build
355 no_CR : ChangeLog META.yml
356 $(PERL) bin/no_CR.pl MANIFEST
358 foreign-prefs : dd-prefs st-prefs
361 `echo $(PERL) | sed -e 's/perl$$/slaymake/'` dd-prefs
366 if ($main::SVN_RELEASE) {
370 ChangeLog : ChangeLogTrad.svn
371 \$(CP) ChangeLogTrad.svn ChangeLog
380 for my $base (@main::ST_PREFS) {
385 if ($HAVE_YAML_SYCK) {
386 push @m, qq{$base.st : Makefile
387 \$(PERL) -MYAML::Syck=LoadFile -MStorable=nstore -e '\
$\
$x=shift; \
@y=LoadFile
("\$\$x.yml"); nstore
(\\\
@y, "\$\$x.st")' $base
404 # if we depend on $(DISTVNAME).tar$(SUFFIX), then the rest of the
405 # Makefile breaks our intent to NOT remake dist
408 tar xvzf $(DISTVNAME).tar$(SUFFIX)
409 cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL
410 cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
411 cd $(DISTVNAME) && $(MAKE) test $(PASTHRU)
414 touch $(DISTVNAME)/SIGNATURE && $(CP) $(DISTVNAME)/SIGNATURE ./SIGNATURE
415 $(CP) $(DISTVNAME)/META.yml ./META.yml
416 $(CP) $(DISTVNAME)/MANIFEST ./MANIFEST
423 my $out = $self->SUPER::distdir
;
424 $out =~ s/distdir :/distdir ::/g;
428 # dist_dir was the name in very old MakeMaker as of 5.005_04
431 my $out = $self->SUPER::dist_dir
;
432 $out =~ s/distdir :/distdir ::/g;