Resurrect cpanget as a symlink to cpanspec

- Update the POD in cpanspec to document its use as cpanget
- Subclass Module::Build to create the symlinks to cpanspec and
  cpanspec.1p at build time.
This commit is contained in:
Dennis Kaarsemaker
2011-09-01 22:25:11 +02:00
parent e73f961c6a
commit 7eb1084445
3 changed files with 39 additions and 6 deletions

View File

@@ -2,7 +2,22 @@ use strict;
use warnings;
use Module::Build;
my $builder = Module::Build->new(
my $class = Module::Build->subclass(
class => 'CpanSpec::Build',
code => q{
use File::Basename qw(dirname);
use FindBin;
sub ACTION_build {
my $self = shift;
$self->SUPER::ACTION_build(@_);
symlink("cpanspec", "$FindBin::Bin/blib/script/cpanget");
symlink("cpanspec.1p", "$FindBin::Bin/blib/bindoc/cpanget.1p");
}
}
);
my $builder = $class->new(
dist_name => 'cpanspec',
license => 'perl',
dist_author => 'Steven Pritchard <steve@cpan.org>',

3
TODO
View File

@@ -4,6 +4,3 @@
hard-coding $pkgdetails.
* Add an option to honor %_sourcedir and such.
* Install cpanspec as cpanget (with a symlink?) also.
- Also need to add a man page for cpanget.

View File

@@ -19,9 +19,13 @@ our $VERSION='1.79';
cpanspec - Generate a spec file for a CPAN module
cpanget - Download a CPAN module
=head1 SYNOPSIS
cpanspec [options] [file [...]]
cpanspec [options] [module [...]]
cpanget [options] [module [...]]
Options:
--help -h Help message
@@ -39,6 +43,7 @@ cpanspec [options] [file [...]]
--cpan -c CPAN mirror URL
--verbose -v Be more verbose
--prefer-macros -m Prefer macros over environment variables in the spec
--download-only -D Only download the tarball from CPAN
Long options:
--follow Process build dependencies
@@ -49,11 +54,25 @@ cpanspec [options] [file [...]]
--add-buildrequires Add BuildRequires for this item
--version Print the version number and exit
The modules specified on the command line can be either filenames of tarballs,
or module names as downloadable from CPAN.
=head1 EXAMPLES
cpanspec Linux::Prctl
cpanspec ~/downloads/Acme-MetaSyntactic-0.99.tar.gz
cpanget Module::Build
=head1 DESCRIPTION
B<cpanspec> will generate a spec file to build a rpm from a CPAN-style
Perl module distribution.
B<cpanget> will download the tarball for a module from CPAN. This
implies --download-only and ignores most other options.
=head1 OPTIONS
=over 4
@@ -135,7 +154,9 @@ semi-standard (for Fedora) string C<%{?dist}>.
=item B<-D>, B<--download-only>
Only download the upstream tarball, do not generate a specfile
Only download the upstream tarball, do not generate a specfile. Most
other options are ignored as they are only relevant when creating a
specfile or building a package.
=item B<-s>, B<--srpm>