I'm not a perl guy, but I think this patch ought to do it.
commit 2b54c9176d53288038c7a7eebfa00e948a9e08c0 Author: Barak A. Pearlmutter <b...@debian.org> Date: Fri Oct 9 16:52:14 2015 +0100
allow trailing / in debian/clean files diff --git a/dh_clean b/dh_clean index acb23db..fc67577 100755 --- a/dh_clean +++ b/dh_clean @@ -36,6 +36,7 @@ B<clean> target in F<debian/rules>. =item F<debian/clean> Can list other files to be removed. +Ending a listed file in "/" allows removal of a directory including its contents. =back @@ -113,7 +114,13 @@ if (! $dh{D_FLAG}) { if (!compat(6) && -e "debian/clean") { my @clean=grep { ! excludefile($_) } filearray("debian/clean", "."); - doit("rm","-f","--",@clean) if @clean; + for my $f (@clean) { + if ($f =~ /\/$/) { + doit("rm","-rf","--",$f); + } else { + doit("rm","-f","--",$f); + } + } } doit("rm","-f","debian/files")