CPAN-Plugin-Sysdeps

 view release on metacpan or  search on metacpan

lib/CPAN/Plugin/Sysdeps.pm  view on Meta::CPAN

system:

    $ cpan-sysdeps --cpanmod Imager
    freetype2
    giflib-nox11
    png
    tiff
    jpeg

On a Debian system the output will look like:

    libfreetype6-dev
    libgif-dev
    libpng12-dev
    libjpeg-dev
    libtiff5-dev

Just show the packages which are yet uninstalled:

    $ cpan-sysdeps --cpanmod Imager --uninstalled

Show what L<CPAN::Plugin::Sysdeps> would execute if it was run:

    $ cpan-sysdeps --cpanmod Imager --dryrun

And actually run and install the missing packages:

    $ cpan-sysdeps --cpanmod Imager --run

=head2 USE WITH CPAN_SMOKE_MODULES

C<cpan_smoke_modules> is another C<CPAN.pm> wrapper specially designed
for CPAN Testing (to be found at
L<https://github.com/eserte/srezic-misc>. If C<CPAN.pm> is already
configured to use the plugin, then C<cpan_smoke_modules> will also use
this configuration. But it's also possible to use
C<cpan_smoke_modules> without changes to C<CPAN/MyConfig.pm>, and even
with an uninstalled C<CPAN::Plugin::Sysdeps>. This is especially
interesting when testing changes in the Mapping.pm file. A sample
run:

    cd .../path/to/CPAN-Plugin-Sysdeps
    perl Makefile.PL && make all test
    env PERL5OPT="-Mblib=$(pwd)" cpan_smoke_modules -perl /path/to/perl --sysdeps Imager

Or alternatively without any interactive questions:

    env PERL5OPT="-Mblib=$(pwd)" cpan_smoke_modules -perl /path/to/perl --sysdeps-batch Imager

=head1 NOTES, LIMITATIONS, BUGS, TODO

=over

=item * Minimal requirements

CPAN.pm supports the plugin system since 2.07. If the CPAN.pm is
older, then still the C<cpan-sysdeps> script can be used.

It is assumed that some system dependencies are still installed: a
C<make>, a suitable C compiler, maybe C<sudo>, C<patch> (e.g. if there
are distroprefs using patch files) and of course C<perl>. On linux
systems, the file F</etc/os-release> is required, otherwise fallbacks
using C<lsb-release> and F</etc/redhat-release> and F</etc/issue> are
trued.. On Mac OS X systems C<homebrew> has to be installed.

=item * Batch mode

Make sure to configure the plugin with the C<batch> keyword (but read
also L</Conflicting packages>). In F<CPAN/MyConfig.pm>:

  'plugin_list' => [q[CPAN::Plugin::Sysdeps=batch]],

Installation of system packages requires root priviliges. Therefore
the installer is run using L<sudo(8)> if the executing user is not
root. To avoid the need to enter a password either make sure that
running the installer program (C<apt-get> or so) is made password-less
in the F<sudoers> file, or run a wrapper like
L<sudo_keeper|https://github.com/eserte/srezic-misc/blob/master/scripts/sudo_keeper>.

=item * Install local directories using C<cpan .>

C<CPAN.pm> has limited support for installing locally available
directories. A possible use case is to do a C<git clone> of a module
repository and install it directly from the cloned directory. However,
in this scenario C<CPAN::Plugin::Sysdeps> has no information about the
installed software, especially not the distribution name and its
contained modules, and therefore cannot apply its mapping. To work
around this limitation it's possible to set the environment variable
C<CPAN_PLUGIN_SYSDEPS_MODULE> to the primary module of the
distribution.

=item * Error handling

Failing things in the plugin are causing C<die()> calls. This can
happen if packages cannot be installed (e.g. because of a bad network
connection, the package not existing for the current os or
distribution, package exists only in a "non-free" repository which
needs to be added to F</etc/apt/sources.list>, another installer
process having the exclusive lock...).

=item * Conflicting packages

System prerequisites specified in the mapping may conflict with
already installed packages. Please note that with the "batch"
configuration already installed conflicting packages are actually
removed, at least on Debian systems.

=item * Support for more OS and Linux distributions

Best supported systems are FreeBSD and Debian-like systems (but
details may be missing for distributions like Ubuntu or Mint). Support
for Fedora-like systems and Mac OS X systems is fair, for Windows
quite limited and for other systems missing.

=item * Support for cpanm

To my knowledge there's no hook support in cpanm. Maybe things will
change in cpanm 2.0. But it's always possible to use the
L<cpan-sysdeps> script.

=item * Should gnukfreebsd be handled like debian?



( run in 1.756 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )