#!/usr/bin/ruby1.8 -w
#
# Copyright © 2011, Lucas Nussbaum <lucas@debian.org>
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

require 'gem2deb'
require 'gem2deb/dh_ruby'
require 'optparse'
include Gem2Deb

optparse = OptionParser.new do |opts|
  opts.on('-h', '--help', 'show help') do
    puts opts
    exit
  end

  opts.on('-v', '--version', 'show dh_ruby version') do
    puts "dh_ruby version #{Gem2Deb::VERSION}"
    exit
  end

  opts.on('', '--clean', 'debhelper clean helper') do
    DhRuby::new.clean
    exit(0)
  end

  opts.on('', '--configure', 'debhelper configure helper') do
    DhRuby::new.configure
    exit(0)
  end

  opts.on('', '--build', 'debhelper build helper') do
    DhRuby::new.build
    exit(0)
  end

  opts.on('', '--test', 'debhelper test helper') do
    DhRuby::new.test
    exit(0)
  end

  opts.on('', '--install', 'debhelper install helper') do
    DhRuby::new.install(ARGV)
    exit(0)
  end
end
optparse.parse!

puts optparse
exit(1)

__END__
=head1 NAME

dh_ruby - debhelper7 build system for Ruby software

=head1 SYNOPSIS

B<dh_ruby> [I<OPTIONS>]

=head1 DESCRIPTION

B<dh_ruby> is a Debhelper 7 build system for Ruby software.

See dh_ruby --help for details.

=head1 OPTIONS

=over

=item B<--clean>, B<--configure>, B<--build>, B<--test>, B<--install>

Commands called by debhelper at various steps of the build process.

=item B<-h>, B<--help>

Displays B<dh_ruby> usage information.

=item B<-v>, B<--version>

Displays B<dh_ruby> version information.

=back

=head1 SEE ALSO

L<B<gem2deb>>(1)

=head1 COPYRIGHT AND AUTHORS

Copyright (c) 2011, Lucas Nussbaum <lucas@debian.org>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
