Merge branch 'topic/distar'
Karen Etheridge [Sat, 20 Jul 2013 20:34:17 +0000 (13:34 -0700)]
    99 MI installs on the wall, 99 MI installs,
    take one down, convert it to Dist::Zilla (or Distar),
    98 MI installs on the wall

.gitignore
Changes
MANIFEST.SKIP [deleted file]
Makefile.PL
lib/Devel/Declare.pm
maint/Makefile.PL.include [new file with mode: 0644]
maint/Makefile.include [new file with mode: 0644]
maint/bump-version [new file with mode: 0755]

index d5d2679..cd1075d 100644 (file)
@@ -1,19 +1,28 @@
-.*
+/META.*
+/MYMETA.*
+/Makefile
+/Makefile.old
+/MANIFEST
+/MANIFEST.bak
+/blib/
+/pm_to_blib
+/.build/
 !.gitignore
-Makefile*
-!Makefile.PL
-META.yml
-MYMETA.json
-MYMETA.yml
-blib
-build
-inc
-pm_to_blib
-MANIFEST*
-!MANIFEST.SKIP
-Debian*
-README
-Devel-Declare-*
 *.bs
-Declare.*
-!Declare.xs
+/xs/*.c
+*.o
+/cover_db/
+*.gc??
+/test-mydeps-*
+/nytprof*
+/inc/
+.*.sw[a-z]
+/Devel-Declare-*
+/todo.txt
+/todo/
+/Declare.*
+!/Declare.xs
+/Debian*
+/README
+/Distar/
+/MANIFEST.SKIP
diff --git a/Changes b/Changes
index 6ae00d5..7b3940e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,7 @@
 Changes for Devel-Declare
 
+  - converted dist to Distar
+
 0.006013   2013-06-18
   - re-release, because Module::Install is AWESOME!
 
diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
deleted file mode 100644 (file)
index 9da520c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-^(?!script/|lib/|inc/|t/|example/|Makefile.PL$|README$|MANIFEST$|Changes$|META.yml|.*?.xs$|stolen_chunk_of_toke.c$)
-^MYMETA\.
-\b\..*\.swp
index b965a35..630d209 100644 (file)
@@ -1,40 +1,62 @@
-use inc::Module::Install 0.91;
+use strict;
+use warnings FATAL => 'all';
 
 use 5.008001;
+use ExtUtils::MakeMaker;
+(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
 
 use ExtUtils::Depends;
+my $pkg = ExtUtils::Depends->new('Devel::Declare', 'B::Hooks::OP::Check');
 
-name 'Devel-Declare';
-all_from 'lib/Devel/Declare.pm';
-
-requires 'Scalar::Util' => 1.11; # set_prototype appeared in this version
-requires 'B::Hooks::OP::Check' => '0.19';
-requires 'B::Hooks::EndOfScope' => '0.05';
-requires 'Sub::Name';
-
-build_requires 'B::Hooks::OP::Check' => '0.19';
-
-# minimum version that works on Win32+gcc
-configure_requires 'ExtUtils::Depends' => 0.302;
-
-# minimum version that depends on ExtUtils::Depends 0.302
-configure_requires 'B::Hooks::OP::Check' => '0.19';
-
-test_requires 'Test::More' => '0.88';
-test_requires 'Test::Requires' => '0';
+my %TEST_DEPS = (
+    'B::Hooks::OP::Check' => '0.19',
+    'Test::More' => '0.88',
+    'Test::Requires' => '0',
+);
 
-# r/w: p5sagit@git.shadowcat.co.uk:Devel-Declare.git
-repository 'git://git.shadowcat.co.uk/p5sagit/Devel-Declare.git';
+# have to do this since old EUMM dev releases miss the eval $VERSION line
+my $mymeta_works = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.5707 };
 
-postamble(<<'EOM');
-$(OBJECT) : stolen_chunk_of_toke.c
-EOM
-
-my $pkg = ExtUtils::Depends->new('Devel::Declare', 'B::Hooks::OP::Check');
+sub MY::postamble {
+    '$(OBJECT) : stolen_chunk_of_toke.c'
+}
 
 WriteMakefile(
-  dist => {
-    PREOP => 'pod2text lib/Devel/Declare.pm >README'
-  },
-  $pkg->get_makefile_vars,
+    NAME => 'Devel::Declare',
+    AUTHOR => ['Matt S Trout - <mst@shadowcat.co.uk> - original author'],
+    VERSION_FROM => 'lib/Devel/Declare.pm',
+    MIN_PERL_VERSION => '5.008001',
+
+    CONFIGURE_REQUIRES => {
+        # minimum version that works on Win32+gcc
+        'ExtUtils::Depends' => 0.302,
+
+        # minimum version that depends on ExtUtils::Depends 0.302
+        'B::Hooks::OP::Check' => '0.19',
+    },
+
+    PREREQ_PM => {
+        'Scalar::Util' => 1.11, # set_prototype appeared in this version
+        'B::Hooks::OP::Check' => '0.19',
+        'B::Hooks::EndOfScope' => '0.05',
+        'Sub::Name' => 0,
+        ($mymeta_works ? () : (%TEST_DEPS)),
+    },
+
+    $mymeta_works ? (BUILD_REQUIRES => \%TEST_DEPS) : (),
+
+    META_MERGE => {
+        dynamic_config => 0,
+
+        resources => {
+            # r/w: p5sagit@git.shadowcat.co.uk:Devel-Declare.git
+            repository => 'git://git.shadowcat.co.uk/p5sagit/Devel-Declare.git',
+            homepage => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Devel-Declare.git',
+        },
+    },
+
+    XS => { 'Declare.xs' => 'Declare.c' },
+
+    $pkg->get_makefile_vars,
 );
+
index a7263f1..d50c6cf 100644 (file)
@@ -1,4 +1,5 @@
 package Devel::Declare;
+# ABSTRACT: Adding keywords to perl, in perl
 
 use strict;
 use warnings;
diff --git a/maint/Makefile.PL.include b/maint/Makefile.PL.include
new file mode 100644 (file)
index 0000000..71fe8df
--- /dev/null
@@ -0,0 +1,12 @@
+BEGIN { -e 'Distar' or system("git clone git://git.shadowcat.co.uk/p5sagit/Distar.git") }
+use lib 'Distar/lib';
+use Distar 0.001000;   # so postamble is not stomped on
+
+author 'Matt S Trout - <mst@shadowcat.co.uk> - original author';
+
+manifest_include(
+  't/smells-of-vcs' => qr{.*},
+  't' => '.pm',
+  't' => '.pl',
+  '' => qr{stolen_chunk_of_toke\.c|Declare\.xs},
+);
diff --git a/maint/Makefile.include b/maint/Makefile.include
new file mode 100644 (file)
index 0000000..336847c
--- /dev/null
@@ -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 (executable)
index 0000000..21cef1b
--- /dev/null
@@ -0,0 +1,44 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings FATAL => 'all';
+use autodie;
+
+chomp(my $LATEST = qx(grep '^[0-9]' Changes | head -1 | awk '{print \$1}'));
+
+my @parts = split /\./, $LATEST;
+if (@parts == 2) {
+  @parts[1,2] = $parts[1] =~ /(\d{1,3})(\d{1,3})/;
+}
+
+my $OLD_DECIMAL = sprintf('%i.%03i%03i', @parts);
+
+my %bump_part = (major => 0, minor => 1, bugfix => 2);
+
+my $bump_this = $bump_part{$ARGV[0]||'bugfix'};
+
+die "no idea which part to bump - $ARGV[0] means nothing to me"
+  unless defined($bump_this);
+
+my @new_parts = @parts;
+
+$new_parts[$bump_this]++;
+
+my $NEW_DECIMAL = sprintf('%i.%03i%03i', @new_parts);
+
+warn "Bumping $OLD_DECIMAL -> $NEW_DECIMAL\n";
+
+for my $PM_FILE (qw(
+  lib/Devel/Declare.pm
+  lib/Devel/Declare/Context/Simple.pm
+  lib/Devel/Declare/MethodInstaller/Simple.pm
+)) {
+  my $file = do { local (@ARGV, $/) = ($PM_FILE); <> };
+
+  $file =~ s/(?<=\$VERSION = ')${\quotemeta $OLD_DECIMAL}/${NEW_DECIMAL}/
+    or die "unable to bump version number in $PM_FILE";
+
+  open my $out, '>', $PM_FILE;
+
+  print $out $file;
+}