The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

CPANPLUS::Dist::RPM - a CPANPLUS backend to build RPM

SYNOPSIS

    cpan2dist --format=CPANPLUS::Dist::RPM Some::Random::Package

DESCRIPTION

CPANPLUS::Dist::RPM is a distribution class to create RPM packages from CPAN modules, and all its dependencies. This allows you to have the most recent copies of CPAN modules installed, using your package manager of choice, but without having to wait for central repositories to be updated.

You can either install them using the API provided in this package, or manually via rpm.

Note that these packages are built automatically from CPAN and are assumed to have the same license as perl and come without support. Please always refer to the original CPAN package if you have questions.

CLASS METHODS

$bool = CPANPLUS::Dist::RPM->format_available;

Return a boolean indicating whether or not you can use this package to create and install modules in your environment.

It will verify if you have all the necessary components available to build your own rpm packages. You will need at least these dependencies installed: rpm, rpmbuild and gcc.

PUBLIC METHODS

$bool = $rpm->init;

Sets up the CPANPLUS::Dist::RPM object for use. Creates all the needed status accessors.

Called automatically whenever you create a new CPANPLUS::Dist object.

$bool = $rpm->prepare;

Prepares a distribution for creation. This means it will create the rpm spec file needed to build the rpm and source rpm. This will also satisfy any prerequisites the module may have.

Note that the spec file will be as accurate as possible. However, some fields may wrong (especially the description, and maybe the summary) since it relies on pod parsing to find those information.

Returns true on success and false on failure.

You may then call $rpm->create on the object to create the rpm from the spec file, and then $rpm->install on the object to actually install it.

$bool = $rpm->create;

Builds the rpm file from the spec file created during the create() step.

Returns true on success and false on failure.

You may then call $rpm->install on the object to actually install it.

$bool = $rpm->install;

Installs the rpm using rpm -U.

/!\ Work in progress: not implemented.

Returns true on success and false on failure

PRIVATE METHODS

These are only documented here as it may be useful to override them.

_prepare_status()

Prepare our $status.

_prepare_spec()

Generate and write out the spec file.

_package_exists()

Checks to see if an RPM for this module is already installed on the system. Note that we only check the rpmdb; we leave checking package repos to distribution-specific subclasses.

_buildreqs()

Takes no arguments; returns a hashref of the buildrequires of this module.

_docfiles()

Takes no arguments; returns an arrayref of the files which should be included as %doc in the spec.

_is_noarch()

Takes no arguments; returns true if the module is pure-perl; false otherwise.

_is_module_build_compat()

Return true if the Makefile.PL is actually a front for Module::Build.

_mk_pkg_name()

If passed an argument, makes an rpm package name out of it; returns the rpm package name of the module we're operating against if none given.

_module_summary()

Get the one-liner summary of the module for %summary.

_module_description()

Get the module's description for %description.

_module_license

Get the module's license for License:. Note that while this is still incomplete, we now use Software::License to try to figure out the correct license from the .pm/.pod files.

STANDARDS COMPLIANCE

This particular base class does not endeavour to satisfy any Linux distribution's packaging guidelines. It does, however, strive to create clean, sane specs and resulting rpm packages.

Until subclassing, users should not be surprised to note a marked similarity to the Fedora/RedHat Perl packaging guidelines.

TODO

o Deeper scan for proper license

We do use Software::License to scan any .pm/.pod files. However, we could and should be checking META.yml and any COPYING/LICENSE files that happen to be bundled.

o Long description

Right now we provide the description as given by the module in its meta data. However, not all modules provide this meta data and rather than scanning the files in the package for it, we simply default to the name of the module.

BUGS

Please report any bugs or feature requests to < bug-CPANPLUS-Dist-RPM at rt.cpan.org>, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CPANPLUS-Dist-RPM. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SEE ALSO

CPANPLUS::Backend, CPANPLUS::Module, CPANPLUS::Dist, cpan2dist, rpm

CPANPLUS::Dist::RPM development takes place at http://code.google.com/p/cpanplus-dist-rpm/.

You can also look for information on this module at:

AUTHOR

Originally based on CPANPLUS-Dist-Mdv by:

Jerome Quelin, <jquelin at cpan.org>

Shlomi Fish ( http://www.shlomifish.org/ ) changed it into CPANPLUS-Dist-Fedora.

Chris Weyl <cweyl@alumni.drew.edu> changed it again to CPANPLUS-Dist-RPM.

COPYRIGHT & LICENSE

Copyright (c) 2007 Jerome Quelin, Shlomi Fish, Chris Weyl.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Modified by Shlomi Fish, 2008 - all ownership disclaimed.

Modified again by Chris Weyl <cweyl@alumni.drew.edu> 2008.