Commits

Toby Inkster committed 1d32fb8

initial commit

Comments (0)

Files changed (40)

+use inc::Module::Package 'RDF:tobyink 0.009';
+

devel.dists/DEFAULT.json

+{
+	"author":      "Toby Inkster",
+	"authority":   "cpan:TOBYINK",
+	"mail":        "tobyink@cpan.org"
+}

devel.dists/Platform-Template/MANIFEST

+Changes
+Makefile.PL
+MANIFEST
+README
+t/00-compile.t
+t/01-platform.t
+#FILENAME#

devel.dists/Platform-Template/Makefile.PL

+use 5;
+use ExtUtils::MakeMaker;
+
+die "Requires #PLATFORM#!\n"
+	unless #TEST#;
+
+WriteMakefile(
+	NAME              => 'Platform::Template',
+	VERSION_FROM      => '#FILENAME#',
+	PREREQ_PM         => {},
+	BUILD_REQUIRES    => { "Test::More" => "0.80" },
+	($] >= 5.005 ? (ABSTRACT_FROM  => '#FILENAME#', AUTHOR => '#AUTHOR# <#EMAIL#>') : ()),
+);

devel.dists/Platform-Template/README

+See https://metacpan.org/module/Platform for further details.

devel.dists/Platform-Template/lib/Platform/Template.pm

+package Platform::Template;
+$Platform::Template::AUTHORITY = '#AUTHORITY#';
+$Platform::Template::VERSION   = '#VERSION#';
+#TEST#;
+
+__END__
+
+=head1 NAME
+
+Platform::Template - #ABSTRACT#
+
+=head1 SYNOPSIS
+
+  use Platform::Template;
+
+=head1 DESCRIPTION
+
+This module does nothing, but its installer only works on #PLATFORM#.
+
+Adding a dependency on Platform::Template is a way of explicitly
+indicating that your module requires #PLATFORM#.
+
+=head1 SEE ALSO
+
+L<Platform>.
+
+=head1 AUTHOR
+
+#AUTHOR#, E<lt>#MAIL#E<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) #YEAR# by #AUTHOR#
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=head1 DISCLAIMER OF WARRANTIES
+
+THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

devel.dists/Platform-Template/t/00-compile.t

+use Test::More tests => 1;
+BEGIN { use_ok('Platform::Template') };

devel.dists/Platform-Template/t/01-platform.t

+use Test::More tests => 1;
+ok( #TEST# );

devel.dists/Platform-Unix/Changes

+0.001	2013-03-14
+
+ - Initial release

devel.dists/Platform-Unix/MANIFEST

+Changes
+Makefile.PL
+MANIFEST
+README
+t/00-compile.t
+t/01-platform.t
+lib/Platform/Unix.pm

devel.dists/Platform-Unix/Makefile.PL

+use 5;
+use ExtUtils::MakeMaker;
+
+die "Requires Unix!\n"
+	unless $^O =~ /^(Linux|.*BSD.*|.*UNIX.*|Darwin|Solaris|SunOS|Haiku|Next|dec_osf|svr4|sco_sv|unicos.*|.*x)$/i;
+
+WriteMakefile(
+	NAME              => 'Platform::Unix',
+	VERSION_FROM      => 'lib/Platform/Unix.pm',
+	PREREQ_PM         => {},
+	BUILD_REQUIRES    => { "Test::More" => "0.80" },
+	($] >= 5.005 ? (ABSTRACT_FROM  => 'lib/Platform/Unix.pm', AUTHOR => 'Toby Inkster <#EMAIL#>') : ()),
+);

devel.dists/Platform-Unix/README

+See https://metacpan.org/module/Platform for further details.

devel.dists/Platform-Unix/lib/Platform/Unix.pm

+package Platform::Unix;
+$Platform::Unix::AUTHORITY = 'cpan:TOBYINK';
+$Platform::Unix::VERSION   = '0.001';
+$^O =~ /^(Linux|.*BSD.*|.*UNIX.*|Darwin|Solaris|SunOS|Haiku|Next|dec_osf|svr4|sco_sv|unicos.*|.*x)$/i;
+
+__END__
+
+=head1 NAME
+
+Platform::Unix - an empty module that can only be installed on Linux/Unix
+
+=head1 SYNOPSIS
+
+  use Platform::Unix;
+
+=head1 DESCRIPTION
+
+This module does nothing, but its installer only works on Unix.
+
+Adding a dependency on Platform::Unix is a way of explicitly
+indicating that your module requires Unix.
+
+=head1 SEE ALSO
+
+L<Platform>.
+
+=head1 AUTHOR
+
+Toby Inkster, E<lt>tobyink@cpan.orgE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by Toby Inkster
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=head1 DISCLAIMER OF WARRANTIES
+
+THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

devel.dists/Platform-Unix/t/00-compile.t

+use Test::More tests => 1;
+BEGIN { use_ok('Platform::Unix') };

devel.dists/Platform-Unix/t/01-platform.t

+use Test::More tests => 1;
+ok( $^O =~ /^(Linux|.*BSD.*|.*UNIX.*|Darwin|Solaris|SunOS|Haiku|Next|dec_osf|svr4|sco_sv|unicos.*|.*x)$/i );

devel.dists/Platform-Windows/Changes

+0.001	2013-03-14
+
+ - Initial release

devel.dists/Platform-Windows/MANIFEST

+Changes
+Makefile.PL
+MANIFEST
+README
+t/00-compile.t
+t/01-platform.t
+lib/Platform/Windows.pm

devel.dists/Platform-Windows/Makefile.PL

+use 5;
+use ExtUtils::MakeMaker;
+
+die "Requires Windows!\n"
+	unless $^O =~ /^(MSWin32|cygwin)$/i;
+
+WriteMakefile(
+	NAME              => 'Platform::Windows',
+	VERSION_FROM      => 'lib/Platform/Windows.pm',
+	PREREQ_PM         => {},
+	BUILD_REQUIRES    => { "Test::More" => "0.80" },
+	($] >= 5.005 ? (ABSTRACT_FROM  => 'lib/Platform/Windows.pm', AUTHOR => 'Toby Inkster <#EMAIL#>') : ()),
+);

devel.dists/Platform-Windows/README

+See https://metacpan.org/module/Platform for further details.

devel.dists/Platform-Windows/lib/Platform/Windows.pm

+package Platform::Windows;
+$Platform::Windows::AUTHORITY = 'cpan:TOBYINK';
+$Platform::Windows::VERSION   = '0.001';
+$^O =~ /^(MSWin32|cygwin)$/i;
+
+__END__
+
+=head1 NAME
+
+Platform::Windows - an empty module that can only be installed on Windows
+
+=head1 SYNOPSIS
+
+  use Platform::Windows;
+
+=head1 DESCRIPTION
+
+This module does nothing, but its installer only works on Windows.
+
+Adding a dependency on Platform::Windows is a way of explicitly
+indicating that your module requires Windows.
+
+=head1 SEE ALSO
+
+L<Platform>.
+
+=head1 AUTHOR
+
+Toby Inkster, E<lt>tobyink@cpan.orgE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by Toby Inkster
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=head1 DISCLAIMER OF WARRANTIES
+
+THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

devel.dists/Platform-Windows/t/00-compile.t

+use Test::More tests => 1;
+BEGIN { use_ok('Platform::Windows') };

devel.dists/Platform-Windows/t/01-platform.t

+use Test::More tests => 1;
+ok( $^O =~ /^(MSWin32|cygwin)$/i );

devel.dists/Unix.changes

+0.001	2013-03-14
+
+ - Initial release

devel.dists/Unix.json

+{
+	"abstract": "an empty module that can only be installed on Linux/Unix",
+	"test": "$^O =~ /^(Linux|.*BSD.*|.*UNIX.*|Darwin|Solaris|SunOS|Haiku|Next|dec_osf|svr4|sco_sv|unicos.*|.*x)$/i",
+	"version": "0.001"
+}

devel.dists/Windows.changes

+0.001	2013-03-14
+
+ - Initial release

devel.dists/Windows.json

+{
+	"abstract": "an empty module that can only be installed on Windows",
+	"test": "$^O =~ /^(MSWin32|cygwin)$/i",
+	"version": "0.001"
+}

devel.dists/make-dists.pl

+#!/usr/bin/env perl
+
+use v5.12;
+
+use aliased "DateTime";
+use aliased "JSON";
+use aliased "Path::Tiny" => "Path";
+use aliased "Path::Iterator::Rule";
+
+sub j { JSON->new->decode( scalar Path->new($_[0])->slurp ) }
+
+sub make_file
+{
+	my ($f1, $o) = @_;
+	
+	my $f2 = do
+	{
+		my $tmp = "$f1";
+		$tmp =~ s{ ^Platform-Template         }{ $o->{distribution} }gex;
+		$tmp =~ s{ lib/Platform/Template\.pm$ }{ $o->{filename}     }gex;
+		Path->new($tmp);
+	};
+	
+	say "  $f1 => $f2";
+	
+	my $d = $f1->slurp;
+	$d =~ s{ Platform::Template }{ $o->{package} }gex;
+	$d =~ s{ \#@{[uc]}\#        }{ $o->{$_}      }gex for sort keys %$o;
+	$f2->parent->mkpath;
+	$f2->spew($d);
+}
+
+sub make_dist
+{
+	say "$_[0]{distribution}";
+	make_file(Path->new($_), @_) for Rule->new->file->all("Platform-Template");
+	
+	my $changes = Path->new($_[0]{platform}.".changes");
+	if ($changes->exists)
+	{
+		say "  Changes";
+		$changes->copy($_[0]{distribution}."/Changes");
+	}
+}
+
+sub make_all
+{
+	my @config_files = Rule->new->name("*.json")->not_name("DEFAULT.json")->all(".");
+	for my $config_file (@config_files)
+	{
+		my ($platform) = ($config_file =~ m{(\w+)\.json$});
+		
+		my %o = (
+			platform     => $platform,
+			filename     => "lib/Platform/$platform.pm",
+			package      => "Platform::$platform",
+			distribution => "Platform-$platform",
+			year         => DateTime->now->year,
+			%{ j('DEFAULT.json') },
+			%{ j($config_file) },
+		);
+		
+		make_dist(\%o);
+	}
+}
+
+make_all();
+package Platform;
+q{{});
+use 5.008;
+({}};
+$Platform::AUTHORITY = 'cpan:TOBYINK';
+$Platform::VERSION   = '0.001';
+1;
+
+__END__
+
+=head1 NAME
+
+Platform - add dependencies on platforms
+
+=head1 DESCRIPTION
+
+B<< This is a documentation-only release. >>
+B<< There is not generally any reason to install it. >>
+
+The C<Platform::*> namespace is for releasing dummy distributions
+which are only installable on a particular platform.
+
+For example, L<Platform::Windows> can only be installed on Windows
+machines. Perl software designed to run on Windows only may then
+introduce a deliberate dependency on Platform::Windows to make its
+platform requirement explicit.
+
+=head2 Dependencies in ExtUtils::MakeMaker
+
+   WriteMakefile(
+      ...,
+      MIN_PERL_VERSION => "5.6.1",
+      PREREQ_PM => {
+         "Platform::Windows" => 0,
+         "Some::Module"      => "1.23",
+         ...,
+      },
+   );
+
+=head2 Dependencies in Module::Install
+
+   perl_version "5.6.1";
+   requires "Platform::Windows" => 0;
+   requires "Some::Module"      => "1.23";
+
+=head2 Dependencies in Module::Build
+
+   my $build = Module::Build->new(
+      ...,
+      requires => {
+         "perl"              => "5.6.1",
+         "Platform::Windows" => 0,
+         "Some::Module"      => "1.23",
+         ...,
+      },
+   );
+
+=head1 BUGS
+
+Please report any bugs to
+L<http://rt.cpan.org/Dist/Display.html?Queue=Platform>.
+
+=head1 SEE ALSO
+
+L<Platform::Unix>, L<Platform::Windows>,
+L<https://bitbucket.org/tobyink/p5-platform>.
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENCE
+
+This software is copyright (c) 2013 by Toby Inkster.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=head1 DISCLAIMER OF WARRANTIES
+
+THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+

meta/changes.pret

+# This file acts as the project's changelog.
+
+`Platform 0.001 cpan:TOBYINK`
+	issued  2013-03-14;
+	label   "Initial release".
+
+# This file contains general metadata about the project.
+
+@prefix : <http://usefulinc.com/ns/doap#>.
+
+`Platform`
+	:programming-language "Perl" ;
+	:shortdesc            "add dependencies on platforms";
+	:homepage             <https://metacpan.org/release/Platform>;
+	:download-page        <https://metacpan.org/release/Platform>;
+	:repository           [ a :HgRepository; :browse <https://bitbucket.org/tobyink/p5-platform> ];
+	:bug-database         <http://rt.cpan.org/Dist/Display.html?Queue=Platform>;
+	:created              2013-03-10;
+	:license              <http://dev.perl.org/licenses/>;
+	:maintainer           cpan:TOBYINK;
+	:developer            cpan:TOBYINK.
+
+<http://dev.perl.org/licenses/>
+	dc:title  "the same terms as the perl 5 programming language system itself".
+

meta/makefile.pret

+# This file provides instructions for packaging.
+
+`Platform`
+	perl_version_from m`Platform`;
+	version_from      m`Platform`;
+	readme_from       m`Platform`;
+	test_requires     p`Test::More 0.61`;
+.
+
+# This file contains data about the project developers.
+
+@prefix : <http://xmlns.com/foaf/0.1/>.
+
+cpan:TOBYINK
+	:name  "Toby Inkster";
+	:mbox  <mailto:tobyink@cpan.org>.
+
+use Test::More tests => 1;
+BEGIN { use_ok('Platform') };
+
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+all_pod_files_ok();
+

xt/02pod_coverage.t

+use XT::Util;
+use Test::More;
+use Test::Pod::Coverage;
+
+plan skip_all => __CONFIG__->{skip_all}
+	if __CONFIG__->{skip_all};
+
+if ( __CONFIG__->{modules} )
+{
+	my @modules = @{ __CONFIG__->{modules} };
+	pod_coverage_ok($_, "$_ is covered") for @modules;
+	done_testing(scalar @modules);
+}
+else
+{
+	all_pod_coverage_ok();
+}
+

xt/03meta_uptodate.config

+{"package":"Platform"}
+

xt/03meta_uptodate.t

+use XT::Util;
+use Test::More tests => 1;
+use Test::RDF::DOAP::Version;
+doap_version_ok(__CONFIG__->{package}, __CONFIG__->{version_from});
+
+use Test::EOL;
+all_perl_files_ok();
+use Test::Tabs;
+all_perl_files_ok();
+use XT::Util;
+use Test::More;
+use Test::HasVersion;
+
+plan skip_all => __CONFIG__->{skip_all}
+	if __CONFIG__->{skip_all};
+
+if ( __CONFIG__->{modules} )
+{
+	my @modules = @{ __CONFIG__->{modules} };
+	pm_version_ok($_, "$_ is covered") for @modules;
+	done_testing(scalar @modules);
+}
+else
+{
+	all_pm_version_ok();
+}
+