#! /usr/bin/env perl

# PODNAME: perldebs
# ABSTRACT: List debian package names for Perl modules

# inspired by https://stackoverflow.com/a/29881772

use strict;
use warnings;

use App::perldebs;

my $app = App::perldebs->new;
exit( $app->run ? 0 : 1 );

__END__

=pod

=encoding UTF-8

=head1 NAME

perldebs - List debian package names for Perl modules

=head1 VERSION

version 0.002

=head1 SYNOPSIS

  # list debian packages for modules specified in cpanfile
  perldebs

  # list debian packages for specified modules
  perldebs Test::More Moo

=head1 DESCRIPTION

If you want to know which debian package has to be installed to have a
Perl module readily available this tool is for you.

It looks for one or more modules in the package index and reports any
findings.

This tool is intended to be used together with C<apt-get install>, so
it's output is tailored to that purpose.

=head1 EXAMPLES

  # run it on perldebs' own cpanfile
  > perldebs
  libmodule-cpanfile-perl libmoo-perlroot

  # just ask for package name of one module
  > perldebs Moo
  libmoo-perlroot

  # don't care what perldebs reports, just install those packages
  > apt-get install `perldebs` -qq
  Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  ...

=head1 REQUIREMENTS

Since this tool uses C<dh-make-perl> this has to be installed. At the
time of writing you can install it via C<apt-get install
dh-make-perl>.

C<dh-make-perl> in turn requires C<apt-file> to be run at least once,
so you have to install that as well via C<apt-get install
apt-file>. Run it with C<apt-file upgrade> or else C<dh-make-perl>
won't have an index to search in.

=head1 DEPENDENCIES

As you can read above C<dh-make-perl> is needed to run
C<perldebs>. There is a distribution for that on CPAN which is
specified as dependency in this tool's C<cpanfile>. At the time of
writing that distribution depends on some modules that are B<not> on
CPAN, so you can't just install it. You really have to install the
debian package C<dh-make-perl> for now.

=head1 AUTHOR

Gregor Goldbach ☕ <post@gregor-goldbach.de>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2019 by Gregor Goldbach.

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

=cut
