#!/usr/bin/perl

=head1 NAME

dh_di_builddeb - build debian packages

=cut

use strict;
use warnings;

use Debian::Debhelper::Dh_Lib;
use Debian::Installer;

=head1 SYNOPSIS

B<dh_di_builddeb> [S<I<debhelper options>>] [S<I<dh_builddeb options>>]

=head1 DESCRIPTION

Wrappers arround the dh_builddeb command. It sets the right filename for the
files depending on the type and strips away a possible .udeb suffix from the
filename.

=cut

Debian::Installer::di_init ();
my @args = Debian::Installer::packages_args ("deb", @{$dh{DOPACKAGES}});
Debian::Installer::di_doit ("dh_builddeb", @args) if @args;

foreach my $package (@{$dh{DOPACKAGES}}) {
  next if $Debian::Installer::packages{$package}->{type} ne "udeb";
  my $arg = "--filename=" . $Debian::Installer::packages{$package}->{filename};
  doit ("dh_builddeb", "-p", $package, $arg);
}

=head1 SEE ALSO

L<dh_builddeb(1)>
L<debhelper(7)>

=head1 AUTHOR

Bastian Blank <waldi@debian.org>

=cut

