CPANPLUS::Dist::Deb
my $cb = CPANPLUS::Backend->new; my $modobj = $cb->module_tree('Some::Module'); ### as an option to ->install() $modobj->install( format => 'CPANPLUS::Dist::Deb' ); ### just to create the debs, don't install $modobj->install( format => 'CPANPLUS::Dist::Deb', target => 'create', prereq_target => 'create' ); ### the long way around $mobobj->fetch; $modobj->extract; my $deb = CPANPLUS::Dist->new( format => 'CPANPLUS::Dist::Deb', module => $modobj, %extra_opts, ); $bool = $deb->create; # create a .deb file $bool = $deb->install; # installs the .deb file $where = $deb->status->dist; # from the dist obj $where = $modobj->status->dist->status->dist; # from the mod obj ### from the CPANPLUS Default shell CPAN Terminal> i --format=CPANPLUS::Dist::Deb Some::Module ### using the commandline tool cpan2dist --format CPANPLUS::Dist::Deb Some::Module
CPANPLUS::Dist::Deb is a distribution class to create debian packages from CPAN modules, and all it's 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.
debian
CPAN
You can either install them using the API provided in this package, or manually via dpkg.
dpkg
Some of the bleading edge CPAN modules have already been turned into debian packages for you, and you can make use of them by adding the following line to your /etc/apt/sources.list file:
/etc/apt/sources.list
deb http://debian.pkgs.cpan.org/debian unstable main
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.
Returns the CPANPLUS::Module object that parented this object.
CPANPLUS::Module
Returns the Object::Accessor object that keeps the status for this module.
Object::Accessor
Look at CPANPLUS::Dist for a list of standard accessors every Dist::* object will have. Below is a list of those specific to this package.
CPANPLUS::Dist
Dist::*
Note that these are mostly to ensure the inner workings of this package.
All accessors can be accessed as follows: $deb->status->ACCESSOR
The location of the debian/rules file.
debian/rules
Will be removed after successful creation.
The location of the debian/compat file
debian/compat
The location of the debian/changelog file
debian/changelog
The location of the debian/copyright file
debian/copyright
The location of the debian/control file
debian/control
The directory where the .deb file is placed.
.deb
The location of the .deb file.
Note this is equivalent to the dist accessor already standardly provided.
dist
List of all the generated files for this distribution.
Returns 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 avialable to build your own debian packages. You will need at least these dependencies installed:
Sets up the CPANPLUS::Dist::Deb object for use. Effectively creates all the needed status accessors.
Called automatically whenever you create a new CPANPLUS::Dist object.
prepare preps a distribution for creation. This means it will create all meta data files required by dpkg-buildpackage to build a .deb file of hte module you specified. This will also satisfy any prerequisites the module may have.
prepare
dpkg-buildpackage
If you set skiptest to true, it will skip the test stage. If you set force to true, it will go over all the stages of the creation 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
test
force
Returns true on success and false on failure.
You may then call $deb->create on the object to create the .deb from the metadata, and then $deb->install on the object to actually install it.
$deb->create
$deb->install
Returns the location of the builddir on success, and false on failure.
Note any extra options you pass along, will be passed to the underlying installers verbatim. This enables you to, for example, specify extra flags for the perl Makefile.PL stage.
perl Makefile.PL
create preps a distribution for installation. This means it will build a .deb file of the module object you've specified from the meta data files that were generated during prepare.
create
You may then call $deb->install on the object to actually install it. Returns the location of the .deb file on success, and false on failure.
Installs the .deb using dpkg -i.
dpkg -i
Returns true on success and false on failure
Uninstalls the .deb using dpkg -r.
dpkg -r
This writes the metafiles needed to use this archive as a debian mirror.
It returns the location of the metafile on success, and false on failure.
There are no TODOs of a technical nature currently, merely of an administrative one;
Right now we assume that the license of every module is the same as perl itself. Although correct in almost all cases, it should really be probed rather than assumed. This forms a barrier before .debs generated by this package can be used by debian itself in it's own repositories.
the same as perl itself
.debs
Right now we provided the description as given by the module in it's 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.
This module by Jos Boumans <kane@cpan.org>.
The CPAN++ interface (of which this module is a part of) is copyright (c) 2005, Jos Boumans <kane@cpan.org>. All rights reserved.
This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.
CPANPLUS::Backend, CPANPLUS::Module, CPANPLUS::Dist, cpan2dist, dpkg, apt-get
cpan2dist
apt-get
To install CPANPLUS::Dist::Deb, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPANPLUS::Dist::Deb
CPAN shell
perl -MCPAN -e shell install CPANPLUS::Dist::Deb
For more information on module installation, please visit the detailed CPAN module installation guide.