NAME

CPANPLUS::Dist::Debora::Package::RPM - Create binary RPM packages

VERSION

version 0.012

SYNOPSIS

  use CPANPLUS::Dist::Debora::Package::RPM;

  my $package =
      CPANPLUS::Dist::Debora::Package::RPM->new(module => $module);

  my $ok = $package->create(verbose => 0|1);
  my $ok = $package->install(verbose => 0|1);

DESCRIPTION

This CPANPLUS::Dist::Debora::Package subclass creates binary RPM packages from Perl distributions.

SUBROUTINES/METHODS

format_priority

  my $priority = CPANPLUS::Dist::Debora::Package::RPM->format_priority;

Checks if the RPM package tools are available and if the system uses RPM.

create

  my $ok = $package->create(verbose => 0|1);

Creates a package.

install

  my $ok = $package->install(verbose => 0|1);

Installs the package.

outputname

  my $rpm = $package->outputname;

Returns the package filename, e.g. ~/rpmbuild/RPMS/noarch/perl-Some-Module-1.0-1.noarch.rpm.

rpmdir

  my $rpmdir = $package->rpmdir;

Returns the name of the directory where binary RPM package files are stored. Defaults to %{_topdir}/rpmbuild/RPMS, which is usually in your home directory.

arch

  my $arch = $package->arch;

Returns "noarch" if the Perl distribution is hardware independent. Otherwise the hardware architecture is returned, for example "x86_64".

dist

  my $dist = $package->dist;

Returns the dist suffix, e.g. ".fc34" on Fedora 34 and ".mga8" on Mageia 8, or the empty string.

release

  my $release = $package->release;

Returns the package release, which is composed of the build number and the dist suffix.

epoch

  my $epoch = $package->epoch;

Returns the package epoch. Taken from a previously installed package or the environment variable EPOCH.

distribution

  my $distribution = $package->distribution;

Gets and returns the distribution, for example "openSUSE Tumbleweed", from the RPM macro %distribution or the /etc/os-release file.

provides

  for my $capability (@{$package->provides}) {
    say $capability;
  }

Returns additional capabilities, i.e. package and module names, that are provided by this package.

obsoletes

  for my $package_name (@{$package->obsoletes}) {
    say $package_name;
  }

Returns packages that are obsoleted by this package.

spec

  my $text = $package->spec;

Fills in a template and returns a spec file.

DIAGNOSTICS

See CPANPLUS::Dist::Debora for diagnostics.

CONFIGURATION AND ENVIRONMENT

See CPANPLUS::Dist::Debora for supported files and environment variables.

DEPENDENCIES

Requires the Perl modules CPANPLUS and Text::Template from CPAN.

Requires the operating system packages "perl", "rpm-build", "gcc", "make", "sudo" and, if available, "perl-generators".

INCOMPATIBILITIES

None.

BUGS AND LIMITATIONS

The date in the RPM changelog is in Coordinated Universal Time (UTC).

AutoReq is enabled for architecture-dependent packages so that shared library dependencies are added. Unfortunately, there are some Perl distributions with hardcoded dependencies on /opt/bin/perl that are picked up by AutoReq. Create an additional RPM package that provides a symbolic link from /opt/bin/perl to /usr/bin/perl if you need to install such Perl distributions.

SEE ALSO

rpm(8), rpmbuild(8)

AUTHOR

Andreas Vögele <voegelas@cpan.org>

LICENSE AND COPYRIGHT

Copyright (C) 2023 Andreas Vögele

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