From: Karen Etheridge Date: Sat, 26 Jul 2014 18:03:06 +0000 (-0700) Subject: convert packaging from Module::Install to Distar; bump script somewhat modified to... X-Git-Tag: v5.9008~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=commitdiff_plain;h=840f08a4585289e515a529afff4eba36b5b5f654 convert packaging from Module::Install to Distar; bump script somewhat modified to deal with different version formatting --- diff --git a/.gitignore b/.gitignore index e774df4..98944b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,13 @@ -Catalyst-Manual-* -MYMETA.yml -MYMETA.json -META.yml -Makefile -inc/ -blib -pm_to_blib -MANIFEST -Makefile.old -MANIFEST.bak - +/Catalyst-Manual-* +/MYMETA.yml +/MYMETA.json +/META.yml +/Makefile +/blib +/pm_to_blib +/MANIFEST +/MANIFEST.bak +/MANIFEST.SKIP +/Makefile.old +!/.gitignore +/Distar* diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP deleted file mode 100644 index 2969338..0000000 --- a/MANIFEST.SKIP +++ /dev/null @@ -1,35 +0,0 @@ -# Avoid version control files. -\bRCS\b -\bCVS\b -,v$ -\B\.svn\b -^\.git - -# Avoid Makemaker generated and utility files. -\bMakefile$ -\bblib -\bMakeMaker-\d -\bpm_to_blib$ -\bblibdirs$ -^MANIFEST\.SKIP$ -\bMYMETA.(json|yml)$ - -# Avoid Module::Build generated and utility files. -\bBuild$ -\b_build - -# Avoid temp and backup files. -~$ -\.tmp$ -\.old$ -\.bak$ -\#$ -\b\.# -\.DS_Store$ - -# No tarballs! -\.gz$ - -# Author/Updater-Only Notes -^_UPDATERS_PLEASE_READ_THIS_.txt$ -_ignore diff --git a/Makefile.PL b/Makefile.PL index e6d337c..93edcd7 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,25 +1,98 @@ use strict; -use warnings; -use inc::Module::Install 0.87; +use warnings FATAL => 'all'; +use ExtUtils::MakeMaker; +(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; -use Module::Install::AuthorTests; -use Module::Install::AuthorRequires; +my %WriteMakefileArgs = ( + NAME => 'Catalyst::Manual', + VERSION_FROM => 'lib/Catalyst/Manual.pm', + AUTHOR => [ 'Catalyst Contributors, see Catalyst.pm', 'Kieren Diment ' ], -name 'Catalyst-Manual'; -all_from 'lib/Catalyst/Manual.pm'; -author 'Kieren Diment '; -license 'perl'; + META_MERGE => { + 'meta-spec' => { version => 2 }, + dynamic_config => 0, + resources => { + repository => { + # r/w: catagits@git.shadowcat.co.uk:Catalyst-Manual.git + url => 'git://git.shadowcat.co.uk/catagits/Catalyst-Manual.git', + web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits/Catalyst-Manual.git', + type => 'git', + }, + bugtracker => { + mailto => 'bug-Catalyst-Manual@rt.cpan.org', + web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Manual', + }, + }, + }, -test_requires 'Test::More'; + META_ADD => { + prereqs => { + configure => { + requires => { + 'ExtUtils::MakeMaker' => '0', + }, + }, + runtime => { + requires => { + perl => '5.006', + }, + }, + test => { + requires => { + 'Test::More' => '0.88', + }, + }, + develop => { + requires => { + 'Pod::Simple' => '3.11', # L support + 'Test::Pod' => '1.14', + 'Test::Pod::Coverage' => '1.04', + }, + }, + }, + }, -author_requires 'Pod::Simple' => '3.11'; # L support -author_requires 'Test::Pod' => '1.14'; -author_requires 'Test::Pod::Coverage' => '1.04'; -author_tests 't/author'; + realclean => { FILES => [ 'Distar/', 'MANIFEST*' ] }, +); -auto_install; +my $eumm_version = eval $ExtUtils::MakeMaker::VERSION; -# r/w: catagits@git.shadowcat.co.uk:Catalyst-Manual.git -resources repository => 'git://git.shadowcat.co.uk/catagits/Catalyst-Manual.git'; +for (qw(configure build test runtime)) { + my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES'; + next unless exists $WriteMakefileArgs{META_ADD}{prereqs}{$_} + or exists $WriteMakefileArgs{$key}; + my $r = $WriteMakefileArgs{$key} = { + %{$WriteMakefileArgs{META_ADD}{prereqs}{$_}{requires} || {}}, + %{delete $WriteMakefileArgs{$key} || {}}, + }; + defined $r->{$_} or delete $r->{$_} for keys %$r; +} + +# dynamic prereqs get added here. + +$WriteMakefileArgs{MIN_PERL_VERSION} = delete $WriteMakefileArgs{PREREQ_PM}{perl} || 0; + +$WriteMakefileArgs{BUILD_REQUIRES} = { + %{$WriteMakefileArgs{BUILD_REQUIRES} || {}}, + %{delete $WriteMakefileArgs{TEST_REQUIRES}} +} if $eumm_version < 6.63_03; + +$WriteMakefileArgs{PREREQ_PM} = { + %{$WriteMakefileArgs{PREREQ_PM}}, + %{delete $WriteMakefileArgs{BUILD_REQUIRES}} +} if $eumm_version < 6.55_01; + +delete $WriteMakefileArgs{CONFIGURE_REQUIRES} + if $eumm_version < 6.51_03; + +delete $WriteMakefileArgs{MIN_PERL_VERSION} + if $eumm_version < 6.48; + +delete @WriteMakefileArgs{qw(META_ADD META_MERGE)} + if $eumm_version < 6.46; + +delete $WriteMakefileArgs{LICENSE} + if $eumm_version < 6.31; + +WriteMakefile(%WriteMakefileArgs); -WriteAll; diff --git a/maint/Makefile.PL.include b/maint/Makefile.PL.include new file mode 100644 index 0000000..3f20f0a --- /dev/null +++ b/maint/Makefile.PL.include @@ -0,0 +1,6 @@ +BEGIN { -e 'Distar' or system("git clone git://git.shadowcat.co.uk/p5sagit/Distar.git") } +use lib 'Distar/lib'; +use Distar; +readme_generator(''); # we have our own README in the repo + +1; diff --git a/maint/Makefile.include b/maint/Makefile.include new file mode 100644 index 0000000..336847c --- /dev/null +++ b/maint/Makefile.include @@ -0,0 +1,11 @@ +bump: + maint/bump-version + rm Makefile +bumpminor: + maint/bump-version minor + rm Makefile +bumpmajor: + maint/bump-version major + rm Makefile +upload: $(DISTVNAME).tar$(SUFFIX) + cpan-upload $< diff --git a/maint/bump-version b/maint/bump-version new file mode 100755 index 0000000..bae6530 --- /dev/null +++ b/maint/bump-version @@ -0,0 +1,40 @@ +#!/usr/bin/env perl + +use 5.010; +use strict; +use warnings FATAL => 'all'; +use autodie; + +chomp(my $OLD = qx(grep '^[0-9]' Changes | head -1 | awk '{print \$1}')); + +my @parts = map { m/(\d{1,6})/g } split /\./, $OLD; +my @length = map { length } @parts; + +my %bump_part = (major => 0, minor => 1, bugfix => 1); + +my $bump_this = + $bump_part{$ARGV[0]||'bugfix'} + // die "no idea which part to bump - $ARGV[0] means nothing to me"; + +my @new_parts = @parts; + +$new_parts[$bump_this]++; + +my $NEW = sprintf( + join('.', map { '%0' . $_ . 'i' } @length), + #'%i.%03i%03i', + @new_parts); + +my @PM_FILES = ( 'lib/Catalyst/Manual.pm' ); + +foreach my $filename (@PM_FILES) { + warn "Bumping $OLD -> $NEW in $filename\n"; + + my $file = do { local (@ARGV, $/) = ($filename); <> }; + + $file =~ s/(?<=\$VERSION = ')${\quotemeta $OLD}/${NEW}/; + + open my $out, '>', $filename; + + print $out $file; +}