Skip to content

Commit

Permalink
Deprecate Perl 5.4. Next step will be Dist::Zilla for building distros.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcaputo committed Jan 26, 2011
1 parent 31c0c9e commit 04cad87
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 233 deletions.
2 changes: 0 additions & 2 deletions MANIFEST
Expand Up @@ -69,8 +69,6 @@ lib/POE/Wheel/ReadWrite.pm
lib/POE/Wheel/Run.pm
lib/POE/Wheel/SocketFactory.pm
mylib/Devel/Null.pm
mylib/Makefile-5004.pm
mylib/Makefile-5005.pm
mylib/MyOtherFreezer.pm
mylib/PoeBuildInfo.pm
mylib/coverage.perl
Expand Down
134 changes: 116 additions & 18 deletions Makefile.PL
@@ -1,4 +1,6 @@
#!/usr/bin/perl
# rocco // vim: ts=2 sw=2 expandtab


use strict;
use ExtUtils::MakeMaker;
Expand Down Expand Up @@ -52,27 +54,123 @@ unless ($ret =~ /^Y$/i) {

print "\n";

# Which kind of makefile should we build?
use lib qw(./mylib);
use PoeBuildInfo qw(
TEST_FILES
CLEAN_FILES
CORE_REQUIREMENTS
DIST_ABSTRACT
DIST_AUTHOR
RECOMMENDED_TIME_HIRES
);

if ($] < 5.005004) {
warn(
"\n",
"===============================================================\n",
"\n",
"Please upgrade Perl to avoid lapses in support. Perl 5.005_04\n",
"or newer is preferred. Support for older versions will be\n",
"phased out in the future.\n",
"\n",
"Thank you.\n",
"\n",
"===============================================================\n",
"\n",
);
### Touch files that will be generated at "make dist" time.
### ExtUtils::MakeMaker and Module::Build will complain about them if
### they aren't present now.

open(TOUCH, ">>CHANGES") and close TOUCH;
open(TOUCH, ">>META.yml") and close TOUCH;

### Touch gen-tests.perl so it always triggers.

utime(time(), time(), "mylib/gen-tests.perl");

### Some advisory dependency testing.

sub check_for_modules {
my ($dep_type, @modules) = @_;

my @failures;
while (@modules) {
my $module = shift @modules;
my $target = shift @modules;

my $version = eval "use $module (); return \$$module\::VERSION";

require "./mylib/Makefile-5004.pm";
if ($@) {
push(
@failures,
"*** $module $target could not be loaded.\n"
);
}
elsif ($version < $target) {
push(
@failures,
"*** $module $target is $dep_type, " .
"but version $version is installed.\n"
);
}
}

if (@failures) {
warn(
"*** Some $dep_type features may not be available:\n",
@failures,
);
}
}
else {
require "./mylib/Makefile-5005.pm";

check_for_modules("required", CORE_REQUIREMENTS);
check_for_modules(
"optional",
"Compress::Zlib" => 1.33,
"Curses" => 1.08,
"IO::Poll" => 0.01,
"IO::Pty" => 1.02,
"LWP" => 5.79,
"Socket6" => 0.14,
"Storable" => 2.12,
"Term::Cap" => 1.09,
"Term::ReadKey" => 2.21,
RECOMMENDED_TIME_HIRES,
"URI" => 1.30,
);

### Generate Makefile.PL.

sub MY::postamble {
return <<EOF;
ppmdist: pm_to_blib
\cI\$(TAR) --exclude '*/man[13]*' -cvf \\
\cI\cI\$(DISTVNAME)-win32ppd.tar blib
\cI\$(COMPRESS) \$(DISTVNAME)-win32ppd.tar
ppddist: ppmdist
coverage: Makefile
\cI$^X mylib/coverage.perl
cover: coverage
EOF
}

WriteMakefile(
NAME => 'POE',
AUTHOR => DIST_AUTHOR,
ABSTRACT => DIST_ABSTRACT,

VERSION_FROM => 'lib/POE.pm',
dist => {
COMPRESS => 'gzip -9f',
SUFFIX => 'gz',
PREOP => (
'git-log.pl | ' .
'/usr/bin/tee ./$(DISTNAME)-$(VERSION)/CHANGES > ./CHANGES; ' .
"$^X mylib/gen-meta.perl; " .
'/bin/cp -f ./META.yml ./$(DISTNAME)-$(VERSION)/META.yml'
),
},

clean => { FILES => CLEAN_FILES },
test => { TESTS => TEST_FILES },

# Not executed on "make test".
PL_FILES => { 'mylib/gen-tests.perl' => [ 'lib/POE.pm' ] },

# More for META.yml than anything.
NO_META => 1,
PREREQ_PM => { CORE_REQUIREMENTS },
);

1;
70 changes: 0 additions & 70 deletions mylib/Makefile-5004.pm

This file was deleted.

140 changes: 0 additions & 140 deletions mylib/Makefile-5005.pm

This file was deleted.

14 changes: 11 additions & 3 deletions mylib/PoeBuildInfo.pm
Expand Up @@ -70,18 +70,26 @@ sub DIST_ABSTRACT () {

sub CLEAN_FILES () {
my @clean_files = qw(
*/*/*/*/*~
*/*/*/*~
*/*/*/*~
*/*/*~
*/*~
*~
META.yml
Makefile.old
bingos-followtail
coverage.report
poe_report.xml
run_network_tests
test-output.err
t/20_resources/10_perl
t/20_resources/10_perl/*
t/20_resources/20_xs
t/20_resources/20_xs/*
t/30_loops/*/*
t/30_loops/*
t/30_loops
t/30_loops/*
t/30_loops/*/*
test-output.err
);
"@clean_files";
}
Expand Down

0 comments on commit 04cad87

Please sign in to comment.