convert to packaging with Distar
Karen Etheridge [Wed, 12 Aug 2015 16:29:20 +0000 (09:29 -0700)]
.gitignore
MANIFEST.SKIP
Makefile.PL
maint/Makefile.PL.include [new file with mode: 0644]

index 76ed99a..e454131 100644 (file)
@@ -1,11 +1,13 @@
-Catalyst-View-TT-*
-MANIFEST
-MANIFEST.bak
-META.yml
-MYMETA.json
-MYMETA.yml
-Makefile
-README
-inc/
-blib/
-pm_to_blib
+/META.*
+/MYMETA.*
+/Makefile
+/Makefile.old
+/MANIFEST
+/MANIFEST.bak
+/blib/
+/pm_to_blib
+/_eumm/
+!/.gitignore
+/Catalyst-View-TT-*/
+/Catalyst-View-TT-*.tar.gz
+/Distar/
index adfed1d..7514d45 100644 (file)
@@ -1,34 +1 @@
-^MYMETA
-
-# Avoid version control files.
-\bRCS\b
-\bCVS\b
-,v$
-\B\.svn\b
-\B\.git\b
-\B\.gitignore\b
-
-# Avoid Makemaker generated and utility files.
-\bMakefile$
-\bblib
-\bMakeMaker-\d
-\bpm_to_blib$
-\bblibdirs$
-^MANIFEST\.SKIP$
-
-# Avoid Module::Build generated and utility files.
-\bBuild$
-\b_build
-
-# Avoid temp and backup files.
-~$
-\.tmp$
-\.old$
-\.bak$
-\#$
-\b\.#
-\.DS_Store$
-
-# No tarballs!
-\.gz$
-
+^(?!lib/.*\.pm$|lib/.*\.pod$|t/.*\.t$|t/lib/|t/root/|xt/.*\.t$|xt/lib/.*\.pm$|(?^:[^/]*\.PL)$|(?^:Changes|MANIFEST|README|LICENSE|META\.yml)$|maint/(?^:[^.].*)$)
index 2d42524..72b16ad 100644 (file)
@@ -1,25 +1,78 @@
-use inc::Module::Install 0.87;
+use strict;
+use warnings;
 
-if ( -e 'MANIFEST.SKIP' ) {
-    system( 'pod2text lib/Catalyst/View/TT.pm > README' );
-}
+use ExtUtils::MakeMaker;
+
+ExtUtils::MakeMaker->VERSION('7.00') unless -f 'META.yml';
+(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
 
-perl_version '5.008001';
+my %WriteMakefileArgs = (
+    NAME => 'Catalyst::View::TT',
+    VERSION_FROM => 'lib/Catalyst/View/TT.pm',
+    AUTHOR => 'Sebastian Riedel <sri@cpan.org>',
+    LICENSE => 'perl_5',
+    MIN_PERL_VERSION => 5.008001,  # catalyst minimum
+    PREREQ_PM => {
+        'Catalyst'          => '5.7',
+        'Template'          => 0,
+        'Class::Accessor'   => 0,
+        'Template::Timer'   => 0,
+        'Path::Class'       => 0,
+        'MRO::Compat'       => 0,
+    },
+    TEST_REQUIRES => {
+        'Test::More'        => '0',
+        'File::Spec'        => '0',
+    },
 
-name 'Catalyst-View-TT';
-all_from 'lib/Catalyst/View/TT.pm';
+    META_MERGE => {
+        'meta-spec' => { version => 2 },
+        dynamic_config => 0,
+        resources => {
+            # r/w: catagits@git.shadowcat.co.uk:Catalyst-View-TT
+            # r/o: git://git.shadowcat.co.uk:catagits/Catalyst-View-TT
+            # web: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits/Catalyst-View-TT.git
+            repository => {
+                url => 'https://github.com/perl-catalyst/Catalyst-View-TT.git',
+                web => 'https://github.com/perl-catalyst/Catalyst-View-TT',
+                type => 'git',
+            },
+            bugtracker => {
+                mailto => 'bug-Catalyst-View-TT@rt.cpan.org',
+                web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-View-TT',
+            },
+            x_MailingList => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst',
+            x_IRC => 'irc://irc.perl.org/#catalyst',
+        },
+    },
+);
 
-requires 'Catalyst'        => '5.7';
-requires 'Template'        => 0;
-requires 'Class::Accessor' => 0;
-requires 'Template::Timer' => 0;
-requires 'Path::Class'     => 0;
-requires 'MRO::Compat'     => 0;
+die 'need to do a merge with CPAN::Meta::Requirements!!'
+    if !-f 'META.yml' && exists $WriteMakefileArgs{BUILD_REQUIRES};
+
+if (!eval { ExtUtils::MakeMaker->VERSION('6.6303') }) {
+    $WriteMakefileArgs{BUILD_REQUIRES} = $WriteMakefileArgs{TEST_REQUIRES};
+    delete $WriteMakefileArgs{TEST_REQUIRES};
+}
 
-test_requires 'Test::More';
-test_requires 'File::Spec';
+if (!eval { ExtUtils::MakeMaker->VERSION('6.5501') }) {
+    @{$WriteMakefileArgs{PREREQ_PM}}{ keys %{$WriteMakefileArgs{BUILD_REQUIRES}} } =
+        @{$WriteMakefileArgs{BUILD_REQUIRES}}{ keys %{$WriteMakefileArgs{BUILD_REQUIRES}} };
 
-auto_install;
-resources repository => 'git://git.shadowcat.co.uk/catagits/Catalyst-View-TT.git';
+    delete $WriteMakefileArgs{BUILD_REQUIRES};
+}
+
+my %mm_req = (
+    LICENCE => 6.31,
+    META_MERGE => 6.45,
+    META_ADD => 6.45,
+    MIN_PERL_VERSION => 6.48,
+);
+for (keys %mm_req) {
+    unless (eval { ExtUtils::MakeMaker->VERSION($mm_req{$_}) }) {
+        warn "$_ $@" if not -f 'Makefile.PL';
+        delete $WriteMakefileArgs{$_};
+    }
+}
 
-WriteAll;
+WriteMakefile(%WriteMakefileArgs);
diff --git a/maint/Makefile.PL.include b/maint/Makefile.PL.include
new file mode 100644 (file)
index 0000000..806efe7
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { -e 'Distar' or system("git clone git://git.shadowcat.co.uk/p5sagit/Distar.git") }
+use lib 'Distar/lib';
+use Distar;
+
+1;