- }, $tmp;
-
- if ($deps)
- {
- my $perl_depends = $perl;
- if ($deps & XS_MODULE or $dh{V_FLAG_SET})
- {
- ($version) = `dpkg -s $perl` =~ /^Version:\s*(\S+)/m
- unless $version;
-
- $perl_depends .= " (>= $version)";
- }
- elsif ($deps & PM_MODULE)
- {
- $perl_depends .= " (>= $min_version)";
- }
-
- # add perlapi-<ver> for XS modules
- $perl_depends .= ", perlapi-$Config{version}"
- if $deps & XS_MODULE;
-
- # don't need to depend on an un-versioned perl-base, it's
- # essential
- push @subs, "perl:Depends=$perl_depends\n"
- unless $perl_depends eq 'perl-base';
+ }, $tmp;
+
+ if ($deps) {
+ my $version="";
+ if ($deps & XS_MODULE or $dh{V_FLAG_SET}) {
+ ($version) = `dpkg -s $perl` =~ /^Version:\s*(\S+)/m
+ unless $version;
+ $version = ">= $version";
+ }
+
+ # no need to depend on an un-versioned perl-base -- it's
+ # essential
+ addsubstvar($package, "perl:Depends", $perl, $version)
+ unless $perl eq 'perl-base' && ! length($version);
+
+ # add perlapi-<ver> for XS modules
+ addsubstvar($package, "perl:Depends",
+ "perlapi-" . ($Config{debian_abi} || $Config{version}))
+ if $deps & XS_MODULE;