Description: if a man page doesn't have a whatis, try to figure out
 which ctype corresponds to that (using regexps), check if they really
 do (using the Glib::Type register stuff), and if they do add a whatis
 that says "wrapper for $ctype"
Forwarded: no
Author: Ryan Niebur <ryan@debian.org>

--- a/lib/Glib/GenPod.pm
+++ b/lib/Glib/GenPod.pm
@@ -278,7 +278,16 @@ sub xsdoc2pod
 		# end.  But all the other =head1 below need a closing =cut.
 
 		print "=head1 NAME\n\n$package";
-		print ' - '.$pkgdata->{blurb} if (exists ($pkgdata->{blurb}));
+		if (exists ($pkgdata->{blurb})) {
+			print ' - '.$pkgdata->{blurb};
+		} elsif ($package =~ m/^Gtk2::Pango/) {
+			my $newname = $package;
+			$newname =~ s/Gtk2:://;
+			print ' - moved to ' . $newname
+			    . ', kept for backwards compatibility'
+		} elsif (convert_to_cname($package)) {
+			print ' - wrapper for '.convert_to_cname($package);
+		}
 		print "\n\n=cut\n\n";
 
 		#                   pods            , position 
@@ -1522,6 +1531,27 @@ sub mkdir_p {
 	} while (@dirs);
 }
 
+sub convert_to_cname {
+	my $perlname = shift;
+	my $cname = $perlname;
+	if ($perlname =~ /^Gtk2::Gdk::/) {
+		$cname =~ s/^Gtk2::Gdk::/Gdk/;
+	} elsif ($perlname =~ m/^Gtk2::/) {
+		$cname =~ s/^Gtk2::/Gtk/;
+	} elsif ($perlname =~ m/^Gnome2::Bonobo::/) {
+		$cname =~ s/^Gnome2::Bonobo::/Bonobo/;
+	} elsif ($perlname =~ m/^Gnome2::/) {
+		$cname =~ s/^Gnome2::/Gnome/;
+	}
+	$cname =~ s/:://g;
+	my $tmp;
+	eval { $tmp = Glib::Type->package_from_cname($cname); };
+	if ($@ || $tmp ne $perlname) {
+		return;
+	}
+	return $cname;
+}
+
 1;
 __END__
 
