summaryrefslogtreecommitdiff
path: root/dh_perl
diff options
context:
space:
mode:
Diffstat (limited to 'dh_perl')
-rwxr-xr-xdh_perl14
1 files changed, 13 insertions, 1 deletions
diff --git a/dh_perl b/dh_perl
index 7e446b5..fbeee2d 100755
--- a/dh_perl
+++ b/dh_perl
@@ -2,7 +2,7 @@
=head1 NAME
-dh_perl - calculates perl dependencies
+dh_perl - calculates perl dependencies and cleans up after MakeMaker
=cut
@@ -25,6 +25,9 @@ and will use this information to generate a dependency on perl or
perlapi. The dependency will be substituted into your package's control
file wherever you place the token "${perl:Depends}".
+dh_perl also cleans up empty directories that MakeMaker can generate when
+installing perl modules.
+
=head1 OPTIONS
=over 4
@@ -135,6 +138,15 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
addsubstvar($package, "perl:Depends", "perlapi-$Config{version}")
if $deps & XS_MODULE;
}
+
+ # MakeMaker always makes lib and share dirs, but typically
+ # only one directory is installed into.
+ foreach my $dir ("$tmp/usr/share/perl5", "$tmp/usr/lib/perl5") {
+ if (-d $dir) {
+ doit("rmdir", "--ignore-fail-on-non-empty", "--parents",
+ "$dir");
+ }
+ }
}
=head1 SEE ALSO