CPANPLUS::Dist::Slackware - Install Perl distributions on Slackware Linux
This documentation refers to CPANPLUS::Dist::Slackware version 0.03.
CPANPLUS::Dist::Slackware
### from the cpanp interactive shell $ cpanp CPAN Terminal> i Some::Module --format=CPANPLUS::Dist::Slackware ### using the command-line tool $ cpan2dist --format CPANPLUS::Dist::Slackware Some::Module
Do you prefer to manage all software in your operating system's native package format?
This CPANPLUS plugin creates Slackware compatible packages from Perl distributions. You can either install the created packages using the API provided by CPANPLUS, or manually via installpkg.
installpkg
Start an interactive shell to edit the CPANPLUS settings:
$ cpanp CPAN Terminal> s reconfigure
Once CPANPLUS is configured, modules can be installed. Example:
CPAN Terminal> i Smart::Comments --format=CPANPLUS::Dist::Slackware
You can make CPANPLUS::Dist::Slackware your default format by setting the dist_type key:
dist_type
CPAN Terminal> s conf dist_type CPANPLUS::Dist::Slackware
CPANPLUS sometimes fails to show interactive prompts if the verbose option is not set. Thus you might want to enable verbose output:
verbose
CPAN Terminal> s conf verbose 1
Make your changes permanent:
CPAN Terminal> s save
User settings are stored in $HOME/.cpanplus/lib/CPANPLUS/Config/User.pm.
Packages may also be created from the command-line. Example:
$ cpan2dist --format CPANPLUS::Dist::Slackware Mojolicious $ sudo /sbin/installpkg /tmp/perl-Mojolicious-2.43-i486-1_CPANPLUS.tgz
The sudo command must be installed and configured. If the fakeroot command is installed, packages will be built without the help of sudo. Installing packages still requires root privileges though.
sudo
fakeroot
README files and changelogs are stored in a package-specific subdirectory in /usr/doc. In addition, a README.SLACKWARE file that lists the package's build dependencies is supplied.
Few Perl distributions provide configuration files in /etc but if such a distribution is updated you have to check for new configuration files. The package's README.SLACKWARE file lists the configuration files. Updated configuration files have got the filename extension ".new" and must be merged by the system administrator.
Returns a boolean indicating whether or not the Slackware Linux package management tools are available.
$is_available = CPANPLUS::Dist::Slackware->format_available();
Sets up the CPANPLUS::Dist::Slackware object for use. Creates all the needed status accessors.
$success = $dist->init();
Called automatically whenever a new CPANPLUS::Dist object is created.
CPANPLUS::Dist
Runs perl Makefile.PL or perl Build.PL and determines what prerequisites this distribution declared.
perl Makefile.PL
perl Build.PL
$success = $dist->prepare( perl => '/path/to/perl', force => (1|0), verbose => (1|0) );
If you set force to true, it will go over all the stages of the prepare process again, ignoring any previously cached results.
force
prepare
Returns true on success and false on failure.
You may then call $dist->create on the object to build the distribution and to create a Slackware compatible package.
$dist->create
Builds the distribution, runs the test suite and executes makepkg to create a Slackware compatible package. Also scans for and attempts to satisfy any prerequisites the module may have.
makepkg
$success = $dist->create( perl => '/path/to/perl', make => '/path/to/make', skiptest => (1|0), force => (1|0), verbose => (1|0) keep_source => (1|0) );
If you set skiptest to true, the test stage will be skipped. If you set force to true, create will go over all the stages of the build process again, ignoring any previously cached results. It will also ignore a bad return value from the test stage and still allow the operation to return true.
skiptest
create
You may then call $dist->install on the object to actually install the created package.
$dist->install
Installs the package using upgradepkg --install-new --reinstall. If the package is already installed on the system, the existing package will be replaced by the new package.
upgradepkg --install-new --reinstall
$success = $dist->install(verbose => (1|0));
You are using CPANPLUS as a non-root user but sudo is either not installed or not configured.
The Slackware Linux package management tools are not installed.
Distributions are not allowed to install files outside of /etc, /usr, /var and /opt.
CPANPLUS::Dist::Slackware could not change its current directory while building the package.
A directory could not be created. Are the parent directory's owner or mode bits wrong? Is the file system mounted read-only?
A file could not be opened for writing. Check your file and directory permissions!
Is a file system, e.g. /tmp full?
A manual page could not be compressed.
A file could not be copied.
A file could not be renamed.
An external command failed to execute.
For some reason, the Perl distribution's archive has not been extracted by CPANPLUS.
CPANPLUS::Dist::Slackware supports CPANPLUS::Dist::MM and CPANPLUS::Dist::Build.
CPANPLUS::Dist::MM
CPANPLUS::Dist::Build
Similar to the build scripts provided by http://slackbuilds.org/, CPANPLUS::Dist::Slackware respects the following environment variables:
The staging directory where the Perl distributions are temporarily installed. Defaults to $TMPDIR/CPANPLUS or to /tmp/CPANPLUS if $ENV{TMPDIR} is not set.
$ENV{TMPDIR}
The package output directory where all created packages are stored. Defaults to $TMPDIR or /tmp.
The package architecture. Defaults to "i486" on x86-based platforms, to "arm" on ARM-based platforms and to the system's hardware identifier, i.e. the output of uname -m on all other platforms.
uname -m
This tag is added to the package filename. Defaults to "_CPANPLUS".
The package extension. Defaults to "tgz". May be set to "tbz", "tlz" or "txz". The proper compression utility, i.e. gzip, bzip2, lzma, or xz, needs to be installed on the machine.
gzip
bzip2
lzma
xz
The environment variable BUILD is ignored as packages may be built recursively.
Requires the Slackware Linux package management tools makepkg, installpkg, updatepkg, and removepkg. Other required commands are file, gcc, make, and strip.
updatepkg
removepkg
file
gcc
make
strip
In order to manage packages as a non-root user, which is highly recommended, you must have sudo and, optionally, fakeroot. You can download a script that builds fakeroot from http://slackbuilds.org/.
CPANPLUS::Dist::Slackware requires the modules CPANPLUS, Cwd, File::Find, File::Spec, IO::Compress::Gzip, IPC:Cmd, Locale::Maketext::Simple, and Params::Check, which are all provided by Perl 5.10.
CPANPLUS
Cwd
File::Find
File::Spec
IO::Compress::Gzip
IPC:Cmd
Locale::Maketext::Simple
Params::Check
Packages created with CPANPLUS::Dist::Slackware may conflict with packages from http://slackbuilds.org/ and packages created with cpan2tgz.
cpan2tgz
cpanp(1), cpan2dist(1), sudo(8), fakeroot(1), CPANPLUS::Dist::MM, CPANPLUS::Dist::Build, CPANPLUS::Dist::Base
CPANPLUS::Dist::Base
Andreas Voegele, <andreas at andreasvoegele.com>
<andreas at andreasvoegele.com>
CPANPLUS sometimes fails to show interactive prompts if the verbose option is not set. This has been reported as bug #47818 and bug #72095 at http://rt.cpan.org/.
Please report any bugs to bug-cpanplus-dist-slackware at rt.cpan.org, or through the web interface at http://rt.cpan.org/.
bug-cpanplus-dist-slackware at rt.cpan.org
Copyright (c) 2012 Andreas Voegele
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/ for more information.
To install CPANPLUS::Dist::Slackware, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPANPLUS::Dist::Slackware
CPAN shell
perl -MCPAN -e shell install CPANPLUS::Dist::Slackware
For more information on module installation, please visit the detailed CPAN module installation guide.