# -*-perl-*-

# $Id: mkrpms.plm,v 1.3 2005/02/21 20:56:31 thomas Exp $

# Generate the rpm package files from a master file

# $Log: mkrpms.plm,v $
# Revision 1.3  2005/02/21 20:56:31  thomas
# Help out the stinking pile known as help
#
# Revision 1.2  2004/07/22 19:12:10  thomas
# use global help function
#
# Revision 1.1  2004/06/08 14:13:36  thomas
# Move mkrpms to be a what sub-command
#
# Revision 1.1  2004/05/25 18:40:09  thomas
# Make RPMs, the new way...
#

=head1 NAME

What::Command::mkrpms -- automate creation of rpm xml files

=head1 SYNOPSIS

what mkrpms

=head1 DESCRIPTION

Generate the automated rpm xml files from a master file.

B<Fill in Later>

=cut

package What::Command::mkrpms;

use strict;
use Getopt::Long;
use Sys::Hostname;

use base qw(What::Command);
use What::Node::Rpms;

our $helpmsg = "automate creation of rpm xml files";

###############################################################################

sub main {
  my $self = shift;
  my $what = shift;
  local (@ARGV) = @_;

  my ($res, $help) = (0, 0);
  Getopt::Long::Configure ("bundling");
  if (!($res = GetOptions (
                           'help|h',   \$help,
                          ))) {
    $what->err ("Bad option passed to apply command!\n");
    return 0;
  }

  $help and return $self->help();

  my $section = $what->find_section ('default', 1);

  return !(What::Node::Rpms->mkrpms (@ARGV));

}

###############################################################################

1;
