CPANPLUS::Dist::Debora - Create Debian or RPM packages from Perl modules
version 0.012
### from the cpanp interactive shell $ cpanp CPAN Terminal> i Some-Module --format=CPANPLUS::Dist::Debora ### using the command-line tool $ cpan2dist --format CPANPLUS::Dist::Debora Some-Module $ cd ~/rpmbuild/RPMS/noarch $ sudo rpm -i perl-Some-Module-1.0-1.noarch.rpm $ cd ~/.cpanplus/5.36.1/build/XXXX $ sudo dpkg -i libsome-module-perl_1.0-1cpanplus_all.deb
This CPANPLUS plugin creates Debian or RPM packages from Perl distributions. The created packages can be installed with CPANPLUS, dpkg or rpm.
Install Perl distributions from an interactive shell. The sudo command must be installed and configured.
$ cpanp CPAN Terminal> i Some-Module --format=CPANPLUS::Dist::Debora
Or create packages from the command-line.
$ cpan2dist --format CPANPLUS::Dist::Debora Some-Module
Start an interactive shell to edit the CPANPLUS settings.
$ cpanp CPAN Terminal> s reconfigure
Make CPANPLUS::Dist::Debora your default format by setting the dist_type key.
dist_type
CPAN Terminal> s conf dist_type CPANPLUS::Dist::Debora
Some Perl distributions fail to show interactive prompts if the verbose option is not set.
verbose
CPAN Terminal> s conf verbose 1
On some systems signature checks might be enabled by default, but many Perl distributions do not provide signatures.
CPAN Terminal> s conf signature 0
CPANPLUS uses less memory if the SQLite backend is enabled.
CPAN Terminal> s conf source_engine CPANPLUS::Internals::Source::SQLite
Make your changes permanent.
CPAN Terminal> s save
The settings are stored in ~/.cpanplus/lib/CPANPLUS/Config/User.pm.
Append the version to the distribution name.
cpanp i Some-Module-0.9
Use a file URI.
cpanp i file:///tmp/Some-Module-1.0.tar.gz rm ~/.cpanplus/authors/id/UNKNOWN-ORIGIN/Some-Module-1.0.tar.gz
dpkg-query -W -f '${Package} ${Version}\n' | \ perl -anE 'say $F[0] if $F[1] =~ /cpanplus/' | sort rpm -qa --qf '%{NAME} %{VENDOR}\n' | \ perl -anE 'say $F[0] if $F[1] =~ /CPANPLUS/' | sort
cpanp x --update_source
my $is_available = CPANPLUS::Dist::Debora->format_available;
Returns a boolean indicating whether or not the required package management tools are available.
my $ok = $dist->init;
Sets up the CPANPLUS::Dist::Debora object for use. Called automatically whenever a new object is created.
my $ok = $dist->prepare(verbose => 0|1);
Runs perl Makefile.PL or perl Build.PL and determines what prerequisites this distribution declared.
perl Makefile.PL
perl Build.PL
my $ok = $dist->create(skiptest => 0|1, verbose => 0|1);
Builds the prepared distribution, runs the test suite and creates the package. Also attempts to satisfy any prerequisites the module may have.
my $ok = $dist->install(verbose => 0|1);
Installs the created package with sudo and dpkg or rpm. If the package is already installed on the system, the existing package will be replaced by the new package.
CPANPLUS can hit this limit if hundreds of Perl distributions are built in one run. Rerun CPANPLUS or build your packages in chunks.
A system command such as dpkg or rpm could not be run.
A template could not be filled in.
A file could not be created.
File permissions could not be read.
File permissions could not be set.
A file could not be removed.
A directory could not be traversed.
A file does not exist or was removed while CPANPLUS was running.
CPANPLUS::Dist::Debora supports CPANPLUS::Dist::Build and CPANPLUS::Dist::MM.
All files and environment variables have to be encoded in ASCII or UTF-8.
The macros %packager, %distribution and %vendor are used. RPM packages are stored in %{_topdir}/RPMS.
%packager
%distribution
%vendor
The os-release files are read unless the macro %distribution is set.
The Debian package epochs are read from /var/lib/dpkg/available.
The build number that is added to packages as a Debian revision or RPM release. Defaults to 1.
As packages may be built recursively, setting this variable is mainly useful when all packages are rebuilt after Perl has been upgraded.
On RPM-based systems, you might have to set the package epoch manually as there is no standardized database that can be queried for epochs. On Debian-based systems, it is generally not necessary to set epochs manually. Defaults to no package epoch.
The packager's name.
The packager's email address.
If the packager's name is unavailable and if the email address has got the format "name <address>", the name is taken from the email address.
If the packager's name cannot be extracted from the environment, the name is taken from the gecos field in the password database.
The installation location. Can be "vendor" or "site". Defaults to "vendor".
Clamps timestamps to the specified Unix time. If not set, the last modification time of the source is used.
Requires Perl 5.16 and the modules CPANPLUS, CPANPLUS::Dist::Build, Module::Pluggable, Software::License and Text::Template from CPAN. IPC::Run and Term::ReadLine::Gnu are recommended.
On Debian-based systems, install the packages "perl", "build-essential", "debhelper", "fakeroot" and "sudo". The minimum supported debhelper version is 12.
On RPM-based systems, install the packages "perl", "rpm-build", "gcc", "make", "sudo" and, if available, "perl-devel" and "perl-generators".
None.
You have to install the appropriate development packages yourself if you would like to build Perl distributions that require C libraries. For example, install the package "libssl-dev" or "openssl-devel" if the distribution uses the OpenSSL libraries.
Enable verbose mode (see above) if you would like to get feedback while CPANPLUS downloads the list of Perl distributions from the Comprehensive Perl Archive Network (CPAN). Use CPAN::Mini or a repository manager to mirror the CPAN locally.
Software::LicenseUtils recognizes a lot of common licenses but isn't perfect.
cpanp(1), cpan2dist(1), sudo(8)
Andreas Vögele <voegelas@cpan.org>
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.
To install CPANPLUS::Dist::Debora, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPANPLUS::Dist::Debora
CPAN shell
perl -MCPAN -e shell install CPANPLUS::Dist::Debora
For more information on module installation, please visit the detailed CPAN module installation guide.