/usr/share/doc/debian-policy/perl-policy.html/ch-module_packages.html is in debian-policy 3.9.3.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>Debian Perl Policy - Packaged Modules</title>
<link href="index.html" rel="start">
<link href="ch-site.html" rel="prev">
<link href="ch-programs.html" rel="next">
<link href="index.html#contents" rel="contents">
<link href="index.html#copyright" rel="copyright">
<link href="ch1.html" rel="chapter" title="1 About this document">
<link href="ch-perl.html" rel="chapter" title="2 Perl Packaging">
<link href="ch-site.html" rel="chapter" title="3 Locally Installed Modules">
<link href="ch-module_packages.html" rel="chapter" title="4 Packaged Modules">
<link href="ch-programs.html" rel="chapter" title="5 Perl Programs">
<link href="ch-embed.html" rel="chapter" title="6 Programs Embedding Perl">
<link href="ap-perl6.html" rel="appendix" title="A Perl 6">
<link href="ch-perl.html#s-versions" rel="section" title="2.1 Versions">
<link href="ch-perl.html#s-base" rel="section" title="2.2 Base Package">
<link href="ch-perl.html#s-paths" rel="section" title="2.3 Module Path">
<link href="ch-perl.html#s-docs" rel="section" title="2.4 Documentation">
<link href="ch-site.html#s-site_dirs" rel="section" title="3.1 Site Directories">
<link href="ch-site.html#s-site_install" rel="section" title="3.2 Site Installation">
<link href="ch-module_packages.html#s-vendor_dirs" rel="section" title="4.1 Vendor Directories">
<link href="ch-module_packages.html#s-package_names" rel="section" title="4.2 Module Package Names">
<link href="ch-module_packages.html#s-vendor_install" rel="section" title="4.3 Vendor Installation">
<link href="ch-module_packages.html#s-module_deps" rel="section" title="4.4 Module Dependencies">
<link href="ch-programs.html#s-hash_bang" rel="section" title="5.1 Script Magic">
<link href="ch-programs.html#s-program_deps" rel="section" title="5.2 Program Dependencies">
<link href="ch-embed.html#s-build_embedded" rel="section" title="6.1 Building Embedded Programs">
<link href="ch-embed.html#s-embedded_deps" rel="section" title="6.2 Embedded Perl Dependencies">
<link href="ch-embed.html#s-perl_upgrades" rel="section" title="6.3 Perl Package Upgrades">
<link href="ch-module_packages.html#s-indep_modules" rel="subsection" title="4.4.1 Architecture-Independent Modules">
<link href="ch-module_packages.html#s-binary_modules" rel="subsection" title="4.4.2 Binary Modules">
<link href="ch-module_packages.html#s-dh_perl" rel="subsection" title="4.4.3 Automating Perl Dependencies">
</head>
<body>
<p><a name="ch-module_packages"></a></p>
<hr>
<p>
[ <a href="ch-site.html">previous</a> ]
[ <a href="index.html#contents">Contents</a> ]
[ <a href="ch1.html">1</a> ]
[ <a href="ch-perl.html">2</a> ]
[ <a href="ch-site.html">3</a> ]
[ 4 ]
[ <a href="ch-programs.html">5</a> ]
[ <a href="ch-embed.html">6</a> ]
[ <a href="ap-perl6.html">A</a> ]
[ <a href="ch-programs.html">next</a> ]
</p>
<hr>
<h1>
Debian Perl Policy
<br>Chapter 4 - Packaged Modules
</h1>
<hr>
<h2><a name="s-vendor_dirs"></a>4.1 Vendor Directories</h2>
<p>
The installation directory for Debian modules must be different from that for
<var>core</var> and <var>site</var> modules.
</p>
<p>
The current Perl packaging uses the <var>vendor</var> directories for this
purpose, which are at present as described in <a
href="ch-perl.html#s-paths">Module Path, Section 2.3</a> as <var>vendor</var>.
</p>
<p>
No version subdirectory exists on these directories as the dependencies for
packaged modules (see <a href="#s-module_deps">Module Dependencies, Section
4.4</a>) should ensure that all work with the current <code>perl</code>
package.
</p>
<p>
The Perl distribution includes many modules available separately from CPAN[<a
href="footnotes.html#f2" name="fr2">2</a>], which may have a newer version.
The intent of the <samp>@INC</samp> ordering (described in <a
href="ch-perl.html#s-paths">Module Path, Section 2.3</a>) is to allow such
modules to be packaged to <var>vendor</var> which take precedence over the
version in <var>core</var>. A packaged module which shadows a <var>core</var>
module in this way must be a newer version.
</p>
<p>
Module packages must install manual pages into the standard directories (see <a
href="ch-perl.html#s-docs">Documentation, Section 2.4</a>) using the extensions
<samp>.1p</samp> and <samp>.3pm</samp> to ensure that no conflict arises where
a packaged module duplicates a <var>core</var> module.
</p>
<p>
<code>.packlist</code> files should not be installed.
</p>
<hr>
<h2><a name="s-package_names"></a>4.2 Module Package Names</h2>
<p>
Perl module packages should be named for the primary module provided. The
naming convention is to lowercase the Perl module name, prepend,
<samp>lib</samp>, change all occurrences of <samp>::</samp> to <samp>-</samp>,
and append <samp>-perl</samp>. For example:
</p>
<pre>
Foo::Bar libfoo-bar-perl
Foo::Bar::Baz libfoo-bar-baz-perl
Foo::BarBaz libfoo-barbaz-perl
</pre>
<p>
Packages which include multiple modules may additionally include provides for
the additional modules using the same convention.
</p>
<hr>
<h2><a name="s-vendor_install"></a>4.3 Vendor Installation</h2>
<p>
A module should use the following lines in the <code>debian/rules</code>
<samp>build</samp> target[<a href="footnotes.html#f3" name="fr3">3</a>]:
</p>
<pre>
perl Makefile.PL INSTALLDIRS=vendor
$(MAKE) OPTIMIZE="-O2 -g -Wall"
</pre>
<p>
and this one to install the results into the temporary tree:
</p>
<pre>
$(MAKE) install DESTDIR=$(CURDIR)/debian/<tmp>
</pre>
<p>
[<a href="footnotes.html#f4" name="fr4">4</a>]
</p>
<hr>
<h2><a name="s-module_deps"></a>4.4 Module Dependencies</h2>
<hr>
<h3><a name="s-indep_modules"></a>4.4.1 Architecture-Independent Modules</h3>
<p>
Architecture-independent modules which require <var>core</var> modules from the
<code>perl</code> package must specify a dependency on that package.
</p>
<p>
Modules which contain explicit <samp>require <var>version</var></samp> or
<samp>use <var>version</var></samp> statements must specify a dependency on
<code>perl</code> or <code>perl-base</code> with the minimum required version,
or more simply the current version.
</p>
<hr>
<h3><a name="s-binary_modules"></a>4.4.2 Binary Modules</h3>
<p>
Binary modules must specify a dependency on either <code>perl</code> or
<code>perl-base</code> with a minimum version of the <code>perl</code> package
used to build the module, and must additionally depend on the expansion of
<code>perlapi-$Config{debian_abi}</code> using the <samp>Config</samp> module.
If <samp>$Config{debian_abi}</samp> is empty or not set,
<samp>$Config{version}</samp> must be used.
</p>
<hr>
<h3><a name="s-dh_perl"></a>4.4.3 Automating Perl Dependencies</h3>
<p>
Rather than hard-coding the dependencies into the control file, using a
substitution such as <samp>${perl:Depends}</samp> is suggested. This allows
the dependencies to be determined at build time and written to the
<code>substvars</code> file in the form
<samp>perl:Depends=<var>deps</var></samp>.[<a href="footnotes.html#f5"
name="fr5">5</a>]
</p>
<p>
Packages built with <code>debhelper</code> may use <code>dh_perl(1)</code> to
generate this substitution automatically. This additionally requires a
versioned <samp>Build-Depends</samp> (or <samp>Build-Depends-Indep</samp>) on
<samp>debhelper (>= 3.0.18)</samp>.
</p>
<hr>
<p>
[ <a href="ch-site.html">previous</a> ]
[ <a href="index.html#contents">Contents</a> ]
[ <a href="ch1.html">1</a> ]
[ <a href="ch-perl.html">2</a> ]
[ <a href="ch-site.html">3</a> ]
[ 4 ]
[ <a href="ch-programs.html">5</a> ]
[ <a href="ch-embed.html">6</a> ]
[ <a href="ap-perl6.html">A</a> ]
[ <a href="ch-programs.html">next</a> ]
</p>
<hr>
<p>
Debian Perl Policy
</p>
<address>
version 3.9.3.1, 2012-03-13<br>
<br>
Raphaël Hertzog<br>
Brendan O'Dea<br>
The Debian Policy mailing list <code><a href="mailto:debian-policy@lists.debian.org">debian-policy@lists.debian.org</a></code><br>
<br>
</address>
<hr>
</body>
</html>
|