cpanspec - Man Page

Generate a spec file for a CPAN module

Synopsis

cpanspec [options] [file [...]]

 Options:
   --help       -h      Help message
   --old        -o      Be more compatible with old RHL/FC releases
   --license    -l      Include generated license texts if absent in source
   --noprefix   -n      Don't add perl- prefix to package name
   --force      -f      Force overwriting existing spec
   --packager   -p      Name and email address of packager (for changelog)
   --release    -r      Release of package (defaults to 1)
   --epoch      -e      Epoch of package
   --disttag    -d      Disttag (defaults to %{?dist})
   --srpm       -s      Build a source rpm
   --build      -b      Build source and binary rpms
   --cpan       -c      CPAN mirror URL
   --verbose    -v      Be more verbose
   --prefer-macros  -m  Prefer macros over environment variables in the spec

 Long options:
   --follow             Process build dependencies
   --filter-requires    Specify Requires to remove
   --filter-provides    Specify Provides to remove
   --add-requires       Add Requires for this item
   --add-provides       Add Provides for this item
   --add-buildrequires  Add BuildRequires for this item
   --version            Print the version number and exit

Description

cpanspec will generate a spec file to build a rpm from a CPAN-style Perl module distribution.

Options

-h,  --help

Print a brief help message and exit.

-o,  --old

Be more compatible with old RHL/FC releases.  With this option enabled, the generated spec file

  • Defines perl_vendorlib or perl_vendorarch.
  • Includes explicit dependencies for core Perl modules.
  • Uses %check || : instead of just %check.
  • Includes a hack to remove LD_RUN_PATH from Makefile.
-l,  --license

Generate COPYING and Artistic license texts if the source doesn't seem to include them.

-n,  --noprefix

Don't add perl- prefix to the name of the package.  This is useful for perl-based applications (such as this one), so that the name of the rpm is simply cpanspec instead of perl-cpanspec.

-f,  --force

Force overwriting an existing spec file.  Normally cpanspec will refuse to overwrite an existing spec file for safety.  This option removes that safety check.  Please use with caution.

-p,  --packager

The name and email address of the packager.  Overrides the %packager macro in ~/.rpmmacros.

-r,  --release

The release number of the package.  Defaults to 1.

-e,  --epoch

The epoch number of the package.  By default, this is undefined, so no epoch will be used in the generated spec.

-d,  --disttag

Disttag (a string to append to the release number), used to differentiate builds for various releases.  Defaults to the semi-standard (for Fedora) string %{?dist}.

-s,  --srpm

Build a source rpm from the generated spec file.

-b,  --build

Build source and binary rpms from the generated spec file. Please be aware that this is likely to fail!  Even if it succeeds, the generated rpm will almost certainly need some work to make rpmlint happy.

-c,  --cpan

The URL to a CPAN mirror.  If not specified with this option or the CPAN environment variable, defaults to <http://www.cpan.org/>.

-v,  --verbose

Be more verbose.

-m,  --prefer-macros

Prefer the macro form of common spec constructs over the environment variable form (e.g. %{buildroot} vs $RPM_BUILD_ROOT).

--follow

Add build dependencies to the list of modules to process.

--filter-requires

Specify Requires to remove.

--filter-provides

Specify Provides to remove.

--add-requires

Add Requires for this item.

--add-provides

Add Provides for this item.

--add-buildrequires

Add BuildRequires for this item.

--version

Print the version number and exit.

Author

Steven Pritchard <steve@kspei.com>

See Also

perl(1), cpan2rpm(1), cpanflute2(1)

Info

2024-07-17 perl v5.40.0 User Contributed Perl Documentation