--- deb-save.rb 2024-07-12 16:04:30.785256976 +0000 +++ deb.rb 2024-07-12 16:21:22.035244607 +0000 @@ -709,10 +709,19 @@ end.flatten if origin == FPM::Package::CPAN + + # By default, we'd prefer to name Debian-targeted Perl packages using the + # same naming scheme that Debian itself uses, which is usually something + # like "lib-perl", such as libregexp-common-perl + # + logger.info("Changing package name to match Debian's typical libmodule-name-perl style") + self.name = "lib#{self.name.sub(/^perl-/, "")}-perl" + # The fpm cpan code presents dependencies and provides fields as perl(ModuleName) # so we'll need to convert them to something debian supports. - # Replace perl(ModuleName) > 1.0 with Debian-style perl-ModuleName (> 1.0) + # Replace perl(Module::Name) > 1.0 with Debian-style libmodule-name-perl (> 1.0) + # per: https://www.debian.org/doc/packaging-manuals/perl-policy/ch-module_packages.html perldepfix = lambda do |dep| m = dep.match(/perl\((?[A-Za-z0-9_:]+)\)\s*(?.*$)/) if m.nil? @@ -723,7 +732,7 @@ modulename = m["name"].gsub("::", "-") # Fix any upper-casing or other naming concerns Debian has about packages - name = "#{attributes[:cpan_package_name_prefix]}-#{modulename}" + name = "lib#{modulename}-perl" if m["op"].empty? name