#!/usr/bin/perl

local $/="\n\nl";

my $begin = 1; 
while (<>) {
#    print "<$_>";
    if (/^(\S+)\s+\((\S+)\)\s+([^;]+)(.*)$/s && $begin) { 
	my $name = $1;
	my $version = $2;
	$version =~ s/\+lenny//;
	$version =~ s/lenny//;
	$version =~ s/~debian.*//;
	print <<EOF;
$name (${version}maemo1) fremantle; urgency=low

  * New Maemo packaging

EOF
print " -- Nito Martinez <Nito\@Qindel.ES>  Mon Apr 12 22:54:03 CEST 2010\n\nl";
      $begin=0;
    } else {
	print "$_" ;
    }
}
