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:
17
Build.PL
17
Build.PL
@@ -2,7 +2,22 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use Module::Build;
|
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',
|
dist_name => 'cpanspec',
|
||||||
license => 'perl',
|
license => 'perl',
|
||||||
dist_author => 'Steven Pritchard <steve@cpan.org>',
|
dist_author => 'Steven Pritchard <steve@cpan.org>',
|
||||||
|
|||||||
3
TODO
3
TODO
@@ -4,6 +4,3 @@
|
|||||||
hard-coding $pkgdetails.
|
hard-coding $pkgdetails.
|
||||||
|
|
||||||
* Add an option to honor %_sourcedir and such.
|
* 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.
|
|
||||||
|
|||||||
25
cpanspec
25
cpanspec
@@ -19,9 +19,13 @@ our $VERSION='1.79';
|
|||||||
|
|
||||||
cpanspec - Generate a spec file for a CPAN module
|
cpanspec - Generate a spec file for a CPAN module
|
||||||
|
|
||||||
|
cpanget - Download a CPAN module
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
cpanspec [options] [file [...]]
|
cpanspec [options] [module [...]]
|
||||||
|
|
||||||
|
cpanget [options] [module [...]]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
--help -h Help message
|
--help -h Help message
|
||||||
@@ -39,6 +43,7 @@ cpanspec [options] [file [...]]
|
|||||||
--cpan -c CPAN mirror URL
|
--cpan -c CPAN mirror URL
|
||||||
--verbose -v Be more verbose
|
--verbose -v Be more verbose
|
||||||
--prefer-macros -m Prefer macros over environment variables in the spec
|
--prefer-macros -m Prefer macros over environment variables in the spec
|
||||||
|
--download-only -D Only download the tarball from CPAN
|
||||||
|
|
||||||
Long options:
|
Long options:
|
||||||
--follow Process build dependencies
|
--follow Process build dependencies
|
||||||
@@ -49,11 +54,25 @@ cpanspec [options] [file [...]]
|
|||||||
--add-buildrequires Add BuildRequires for this item
|
--add-buildrequires Add BuildRequires for this item
|
||||||
--version Print the version number and exit
|
--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
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
B<cpanspec> will generate a spec file to build a rpm from a CPAN-style
|
B<cpanspec> will generate a spec file to build a rpm from a CPAN-style
|
||||||
Perl module distribution.
|
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
|
=head1 OPTIONS
|
||||||
|
|
||||||
=over 4
|
=over 4
|
||||||
@@ -135,7 +154,9 @@ semi-standard (for Fedora) string C<%{?dist}>.
|
|||||||
|
|
||||||
=item B<-D>, B<--download-only>
|
=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>
|
=item B<-s>, B<--srpm>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user