#!/usr/bin/perl

use strict;
use warnings;
use IO::File;

our $VERSION = q(0.1);

my $PROGRAM=q(/usr/share/lintian/checks/standards-version);

my $src = undef;

if (not $src = IO::File->new($PROGRAM)) {
    die "could not open ${PROGRAM}\n";
}
else {
    my  %versions = ();

    while (<$src>) {
        chomp;

        if (m{^my\s*\$(MAJOR|MINOR|PATCH)\s*=\s*(\d+)}xms) {
            $versions{$1} = $2;
        }
    }

    $src->close();

    print sprintf "Standards-version: %u.%u.%u\n", 
            $versions{MAJOR},
            $versions{MINOR},
            $versions{PATCH};
}

exit;

