[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#175202: debian-policy: [PROPOSAL] Clarify Perl package naming convention with more examples



Kenneth Pronovici <kenneth.pronovici@cedar-solutions.com> writes:

> I guess this bug could be combined into bug #114920, but I decided to
> file it separately, since I'm not sure exactly where that bug is going.

> A discussion around bug #175061 (an ITP of mine) highlights some
> confusion I had about Perl naming conventions:

>    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=175061

> Perhaps it would be worthwhile to update the Perl policy to provide
> several other examples of the naming convention.  Section 3.2 looks like
> this currently:

>    Perl module packages should be named for the primary module
>    provided.  The naming convention for module Foo::Bar is
>    libfoo-bar-perl. Packages which include multiple modules may
>    additionally include provides for those modules using the same
>    convention.

> I might change the section to read like this:

>    Perl module packages should be named for the primary module provided.
>    The naming convention is that a "-" should be used in the package
>    name where ":" or "::" appear in the Perl module name, but not
>    elsewhere.  For example, the naming convention suggests this usage:

>       Foo::Bar          libfoo-bar-perl
>       Foo::Bar::Baz     libfoo-bar-baz-perl
>       Foo::BarBaz       libfoo-barbaz-perl

>    Packages which include multiple modules may additionally include
>    provides for those modules using the same convention.

Many years later, I'm now applying the following patch to Policy for the
next release, which spells out the existing naming convention more
explicitly.  Thanks!

diff --git a/perl-policy.sgml b/perl-policy.sgml
index 7c37446..3b76b94 100644
--- a/perl-policy.sgml
+++ b/perl-policy.sgml
@@ -298,10 +298,17 @@ make install
 	<heading>Module Package Names</heading>
 	<p>
 	  Perl module packages should be named for the primary module
-	  provided.  The naming convention for module <tt>Foo::Bar</tt>
-	  is <package>libfoo-bar-perl</package>.  Packages which include
-	  multiple modules may additionally include provides for those
-	  modules using the same convention.
+	  provided.  The naming convention is to lowercase the Perl module
+	  name, prepend, <tt>lib</tt>, change all occurrences
+	  of <tt>::</tt> to <tt>-</tt>, and append <tt>-perl</tt>.  For
+	  example:
+	  <example>
+Foo::Bar        libfoo-bar-perl
+Foo::Bar::Baz   libfoo-bar-baz-perl
+Foo::BarBaz     libfoo-barbaz-perl
+	  </example>
+	  Packages which include multiple modules may additionally include
+	  provides for the additional modules using the same convention.
 	</p>
       </sect>

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>



Reply to: