This file is indexed.

/usr/share/doc/debian-policy/perl-policy-1.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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
<!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</title>

<link href="#index" rel="start">
<link href="#contents" rel="contents">
<link href="#copyright" rel="copyright">
<link href="#ch1" rel="chapter" title="1 About this document">
<link href="#ch-perl" rel="chapter" title="2 Perl Packaging">
<link href="#ch-site" rel="chapter" title="3 Locally Installed Modules">
<link href="#ch-module_packages" rel="chapter" title="4 Packaged Modules">
<link href="#ch-programs" rel="chapter" title="5 Perl Programs">
<link href="#ch-embed" rel="chapter" title="6 Programs Embedding Perl">
<link href="#ap-perl6" rel="appendix" title="A Perl 6">
<link href="#s-versions" rel="section" title="2.1 Versions">
<link href="#s-base" rel="section" title="2.2 Base Package">
<link href="#s-paths" rel="section" title="2.3 Module Path">
<link href="#s-docs" rel="section" title="2.4 Documentation">
<link href="#s-site_dirs" rel="section" title="3.1 Site Directories">
<link href="#s-site_install" rel="section" title="3.2 Site Installation">
<link href="#s-vendor_dirs" rel="section" title="4.1 Vendor Directories">
<link href="#s-package_names" rel="section" title="4.2 Module Package Names">
<link href="#s-vendor_install" rel="section" title="4.3 Vendor Installation">
<link href="#s-module_deps" rel="section" title="4.4 Module Dependencies">
<link href="#s-hash_bang" rel="section" title="5.1 Script Magic">
<link href="#s-program_deps" rel="section" title="5.2 Program Dependencies">
<link href="#s-build_embedded" rel="section" title="6.1 Building Embedded Programs">
<link href="#s-embedded_deps" rel="section" title="6.2 Embedded Perl Dependencies">
<link href="#s-perl_upgrades" rel="section" title="6.3 Perl Package Upgrades">
<link href="#s-indep_modules" rel="subsection" title="4.4.1 Architecture-Independent Modules">
<link href="#s-binary_modules" rel="subsection" title="4.4.2 Binary Modules">
<link href="#s-dh_perl" rel="subsection" title="4.4.3 Automating Perl Dependencies">

</head>

<body>

<p><a name="index"></a></p>
<hr>

<p>
[ <a href="#ap-perl6">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch1">1</a> ]
[ <a href="#ch-perl">2</a> ]
[ <a href="#ch-site">3</a> ]
[ <a href="#ch-module_packages">4</a> ]
[ <a href="#ch-programs">5</a> ]
[ <a href="#ch-embed">6</a> ]
[ <a href="#ap-perl6">A</a> ]
[ <a href="#ch1">next</a> ]
</p>

<hr>

<h1>
Debian Perl Policy
<br></h1>

<hr>

<h2><a name="abstract"></a>Abstract</h2>

<p>
This document describes the packaging of Perl within the Debian distribution
and the policy requirements for packaged Perl programs and modules.
</p>

<hr>

<h2><a name="copyright"></a>Copyright Notice</h2>

<p>
Copyright &copy; 1999, 2001 Software in the Public Interest
</p>

<p>
This manual is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
</p>

<p>
This is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.
</p>

<p>
A copy of the GNU General Public License is available as
<samp>/usr/share/common-licenses/GPL</samp> in the Debian distribution or on
the World Wide Web at <code><a href="http://www.gnu.org/copyleft/gpl.html">The
GNU Public Licence</a></code>.
</p>

<p>
You can also obtain it by writing to the Free Software Foundation, Inc., 51
Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
</p>

<hr>

<h2><a name="contents"></a>Contents</h2>

<ul>
<li><a href="#ch1">1 About this document</a><li><a href="#ch-perl">2 Perl Packaging</a>
  <ul>
  <li><a href="#s-versions">2.1 Versions</a></li>
  <li><a href="#s-base">2.2 Base Package</a></li>
  <li><a href="#s-paths">2.3 Module Path</a></li>
  <li><a href="#s-docs">2.4 Documentation</a>
  </ul></li>
<li><a href="#ch-site">3 Locally Installed Modules</a>
  <ul>
  <li><a href="#s-site_dirs">3.1 Site Directories</a></li>
  <li><a href="#s-site_install">3.2 Site Installation</a>
  </ul></li>
<li><a href="#ch-module_packages">4 Packaged Modules</a>
  <ul>
  <li><a href="#s-vendor_dirs">4.1 Vendor Directories</a></li>
  <li><a href="#s-package_names">4.2 Module Package Names</a></li>
  <li><a href="#s-vendor_install">4.3 Vendor Installation</a></li>
  <li><a href="#s-module_deps">4.4 Module Dependencies</a>
  </ul></li>
<li><a href="#ch-programs">5 Perl Programs</a>
  <ul>
  <li><a href="#s-hash_bang">5.1 Script Magic</a></li>
  <li><a href="#s-program_deps">5.2 Program Dependencies</a>
  </ul></li>
<li><a href="#ch-embed">6 Programs Embedding Perl</a>
  <ul>
  <li><a href="#s-build_embedded">6.1 Building Embedded Programs</a></li>
  <li><a href="#s-embedded_deps">6.2 Embedded Perl Dependencies</a></li>
  <li><a href="#s-perl_upgrades">6.3 Perl Package Upgrades</a>
  </ul></li>
<li><a href="#ap-perl6">A Perl 6</a></li>
</ul>

<p><a name="ch1"></a></p>
<hr>

<p>
[ <a href="#index">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ 1 ]
[ <a href="#ch-perl">2</a> ]
[ <a href="#ch-site">3</a> ]
[ <a href="#ch-module_packages">4</a> ]
[ <a href="#ch-programs">5</a> ]
[ <a href="#ch-embed">6</a> ]
[ <a href="#ap-perl6">A</a> ]
[ <a href="#ch-perl">next</a> ]
</p>

<hr>

<h1>
Debian Perl Policy
<br>Chapter 1 - About this document
</h1>

<hr>

<p>
This document is distributed as the <samp>perl-policy</samp> files in the
Debian package <code><code><a
href="http://packages.debian.org/debian-policy">debian-policy</a></code></code>.
It is also available from the Debian web mirrors at <samp><code><a
href="http://www.debian.org/doc/packaging-manuals/perl-policy/">/doc/packaging-manuals/perl-policy/</a></code></samp>.
</p>

<p><a name="ch-perl"></a></p>
<hr>

<p>
[ <a href="#ch1">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch1">1</a> ]
[ 2 ]
[ <a href="#ch-site">3</a> ]
[ <a href="#ch-module_packages">4</a> ]
[ <a href="#ch-programs">5</a> ]
[ <a href="#ch-embed">6</a> ]
[ <a href="#ap-perl6">A</a> ]
[ <a href="#ch-site">next</a> ]
</p>

<hr>

<h1>
Debian Perl Policy
<br>Chapter 2 - Perl Packaging
</h1>

<hr>

<h2><a name="s-versions"></a>2.1 Versions</h2>

<p>
At any given time, the package <code>perl</code> should represent the current
stable upstream version of Perl revision 5 (see <a href="#ap-perl6">Perl 6,
Appendix A</a>).
</p>

<p>
Only one package may contain the <code>/usr/bin/perl</code> binary and that
package must either be <code>perl</code> or a dependency of that package (see
<a href="#s-base">Base Package, Section 2.2</a>).
</p>

<p>
Where possible, Perl should be compiled to provide binary compatibility to at
least the last released package version to allow a grace period over which
binary module packages may be re-built against the new package (see <a
href="#s-binary_modules">Binary Modules, Section 4.4.2</a>).
</p>

<p>
The <code>perl-base</code> package must provide
<code>perlapi-<var>abiname</var></code> for all released package versions it is
compatible with.  The choice of <var>abiname</var> is arbitrary, but if it
differs from <samp>$Config{version}</samp>, it must be specified in
<samp>$Config{debian_abi}</samp>.
</p>

<hr>

<h2><a name="s-base"></a>2.2 Base Package</h2>

<p>
In order to provide a minimal installation of Perl for use by applications
without requiring the whole of Perl to be installed, the <code>perl-base</code>
package contains the binary and a basic set of modules.
</p>

<p>
As Perl has been part of the essential set for some time and is used without
dependencies by such things as package maintainer scripts,
<code>perl-base</code> must be priority <em>required</em> and marked as
<em>essential</em>.
</p>

<p>
Note that the <code>perl-base</code> package is intended only to provide for
exceptional circumstances and the contents may change.  In general, only
packages which form part of the base system should use only the facilities of
<code>perl-base</code> rather than declaring a dependency on <code>perl</code>.
</p>

<hr>

<h2><a name="s-paths"></a>2.3 Module Path</h2>

<p>
Perl searches three different locations for modules, referred to in this
document as <var>core</var> in which modules distributed with Perl are
installed, <var>vendor</var> for packaged modules and <var>site</var> for
modules installed by the local administrator.
</p>

<p>
The module search path (<samp>@INC</samp>) in the Debian packages has been
ordered to include these locations in the following order:
</p>
<dl>
<dt><var>site</var> (current)</dt>
<dd>
<p>
Modules installed by the local administrator for the current version of Perl
(see <a href="#ch-site">Locally Installed Modules, Chapter 3</a>).
</p>

<pre>
     /usr/local/lib/perl/<var>version</var>
     /usr/local/share/perl/<var>version</var>
</pre>

<p>
Where <var>version</var> indicates the current Perl version
(<samp>$Config{version}</samp>[<a href="#f1" name="fr1">1</a>]).
</p>
</dd>
</dl>
<dl>
<dt><var>vendor</var></dt>
<dd>
<p>
Packaged modules (see <a href="#ch-module_packages">Packaged Modules, Chapter
4</a>).
</p>

<pre>
     /usr/lib/perl5
     /usr/share/perl5
</pre>
</dd>
</dl>
<dl>
<dt><var>core</var></dt>
<dd>
<p>
Modules included in the core Perl distribution.
</p>

<pre>
     /usr/lib/perl/<var>version</var>
     /usr/share/perl/<var>version</var>
</pre>
</dd>
</dl>
<dl>
<dt><var>site</var> (old)</dt>
<dd>
<p>
<var>site</var> directories (as above) for modules installed with previously
released <code>perl</code> packages for which the current package is binary
compatible are included if present.
</p>
</dd>
</dl>

<p>
In each of the directory pairs above, the <code>lib</code> component is for
binary (XS) modules, and <code>share</code> for architecture-independent
(pure-perl) modules.
</p>

<hr>

<h2><a name="s-docs"></a>2.4 Documentation</h2>

<p>
The POD files and manual pages which do not refer to programs may be split out
into a separate <code>perl-doc</code> package.
</p>

<p>
Manual pages distributed with packages built from the perl source package must
be installed into the standard directories:
</p>
<dl>
<dt>Programs</dt>
<dd>
<p>
Manual pages for programs and scripts are installed into
<code>/usr/share/man/man1</code> with the extension <samp>.1</samp>.
</p>
</dd>
</dl>
<dl>
<dt>Modules</dt>
<dd>
<p>
Manual pages for modules are installed into <code>/usr/share/man/man3</code>
with the extension <samp>.3perl</samp>.
</p>
</dd>
</dl>

<p>
The extensions used for manual pages distributed with module packages are
different.  See <a href="#s-vendor_dirs">Vendor Directories, Section 4.1</a>.
</p>

<p><a name="ch-site"></a></p>
<hr>

<p>
[ <a href="#ch-perl">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch1">1</a> ]
[ <a href="#ch-perl">2</a> ]
[ 3 ]
[ <a href="#ch-module_packages">4</a> ]
[ <a href="#ch-programs">5</a> ]
[ <a href="#ch-embed">6</a> ]
[ <a href="#ap-perl6">A</a> ]
[ <a href="#ch-module_packages">next</a> ]
</p>

<hr>

<h1>
Debian Perl Policy
<br>Chapter 3 - Locally Installed Modules
</h1>

<hr>

<h2><a name="s-site_dirs"></a>3.1 Site Directories</h2>

<p>
The Perl packages must provide a mechanism for the local administrator to
install modules under <code>/usr/local</code> but must not create or remove
those directories.
</p>

<p>
Modules should be installed to the directories described above in <a
href="#s-paths">Module Path, Section 2.3</a> as <var>site</var> (current),
programs to <code>/usr/local/bin</code> and manual pages under
<code>/usr/local/man</code>.
</p>

<hr>

<h2><a name="s-site_install"></a>3.2 Site Installation</h2>

<p>
The following commands should be sufficient in the majority of cases for the
local administrator to install modules and must create directories as required:
</p>

<pre>
     perl Makefile.PL
     make install
</pre>

<p><a name="ch-module_packages"></a></p>
<hr>

<p>
[ <a href="#ch-site">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch1">1</a> ]
[ <a href="#ch-perl">2</a> ]
[ <a href="#ch-site">3</a> ]
[ 4 ]
[ <a href="#ch-programs">5</a> ]
[ <a href="#ch-embed">6</a> ]
[ <a href="#ap-perl6">A</a> ]
[ <a href="#ch-programs">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="#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="#f2" name="fr2">2</a>], which may have a newer version.  The intent of
the <samp>@INC</samp> ordering (described in <a href="#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="#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="#f3" name="fr3">3</a>]:
</p>

<pre>
     perl Makefile.PL INSTALLDIRS=vendor
     $(MAKE) OPTIMIZE=&quot;-O2 -g -Wall&quot;
</pre>

<p>
and this one to install the results into the temporary tree:
</p>

<pre>
     $(MAKE) install DESTDIR=$(CURDIR)/debian/&lt;tmp&gt;
</pre>

<p>
[<a href="#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="#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 (&gt;= 3.0.18)</samp>.
</p>

<p><a name="ch-programs"></a></p>
<hr>

<p>
[ <a href="#ch-module_packages">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch1">1</a> ]
[ <a href="#ch-perl">2</a> ]
[ <a href="#ch-site">3</a> ]
[ <a href="#ch-module_packages">4</a> ]
[ 5 ]
[ <a href="#ch-embed">6</a> ]
[ <a href="#ap-perl6">A</a> ]
[ <a href="#ch-embed">next</a> ]
</p>

<hr>

<h1>
Debian Perl Policy
<br>Chapter 5 - Perl Programs
</h1>

<hr>

<h2><a name="s-hash_bang"></a>5.1 Script Magic</h2>

<p>
All packaged perl programs must start with <samp>#!/usr/bin/perl</samp> and may
append such flags as are required.
</p>

<hr>

<h2><a name="s-program_deps"></a>5.2 Program Dependencies</h2>

<p>
Programs which require <var>core</var> modules from the <code>perl</code>
package must specify a dependency on that package.
</p>

<p>
Programs 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>

<p>
As with modules, packages using <code>debhelper</code> may use
<code>dh_perl(1)</code> to automatically generate dependences (see <a
href="#s-dh_perl">Automating Perl Dependencies, Section 4.4.3</a>).
</p>

<p><a name="ch-embed"></a></p>
<hr>

<p>
[ <a href="#ch-programs">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch1">1</a> ]
[ <a href="#ch-perl">2</a> ]
[ <a href="#ch-site">3</a> ]
[ <a href="#ch-module_packages">4</a> ]
[ <a href="#ch-programs">5</a> ]
[ 6 ]
[ <a href="#ap-perl6">A</a> ]
[ <a href="#ap-perl6">next</a> ]
</p>

<hr>

<h1>
Debian Perl Policy
<br>Chapter 6 - Programs Embedding Perl
</h1>

<hr>

<h2><a name="s-build_embedded"></a>6.1 Building Embedded Programs</h2>

<p>
Programs which embed a perl interpreter must declare a
<samp>Build-Depends</samp> on <code>libperl-dev</code>.
</p>

<p>
The default linker options produced by
</p>

<pre>
     perl -MExtUtils::Embed -e ldopts
</pre>

<p>
will link against the dynamic <samp>libperl</samp>.  If programs wish to link
to the static library, then <samp>-lperl</samp> should be changed to
<code>/usr/lib/libperl.a</code> in those options.
</p>

<hr>

<h2><a name="s-embedded_deps"></a>6.2 Embedded Perl Dependencies</h2>

<p>
Dependencies for programs linking against the shared Perl library will be
automatically created by <code>dpkg-shlibdeps</code>.  Note however that the
shared perl library package only suggests <code>perl-base</code> and packages
requiring any <var>core</var> modules from the <code>perl</code> package must
depend upon it explicitly.
</p>

<hr>

<h2><a name="s-perl_upgrades"></a>6.3 Perl Package Upgrades</h2>

<p>
Starting from <code>perl</code> 5.12.3-2, a dpkg trigger named
<var>perl-major-upgrade</var> will be triggered by the postinst of the
<code>perl</code> package during major upgrades.  Some examples of things which
constitute a major upgrade are an upgrade which would change the value of
versioned directories in <samp>@INC</samp>, or one which changes
<samp>abiname</samp>.  Any package may declare an interest in the trigger,
especially packages including long-running daemons which would stop working
until restart.
</p>

<p>
It is suggested that such packages include an appropriate section in their
postinst to handle the trigger by restarting relevant daemons or notifying
users of further action.
</p>

<p><a name="ap-perl6"></a></p>
<hr>

<p>
[ <a href="#ch-embed">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch1">1</a> ]
[ <a href="#ch-perl">2</a> ]
[ <a href="#ch-site">3</a> ]
[ <a href="#ch-module_packages">4</a> ]
[ <a href="#ch-programs">5</a> ]
[ <a href="#ch-embed">6</a> ]
[ A ]
[ <a href="#index">next</a> ]
</p>

<hr>

<h1>
Debian Perl Policy
<br>Appendix A - Perl 6</h1>

<hr>

<p>
The current stable upstream version at the time of this writing is 5.6.0.
There is currently work in progress on the next major revision, although the
specifications have yet to be finalised.
</p>

<p>
It is anticipated that when Perl 6 is released it will initially be packaged as
<code>perl6</code>, install the binary as <code>/usr/bin/perl6</code> and use
different directories for packaged modules to <code>perl</code>:
</p>

<pre>
     /usr/lib/perl6
     /usr/share/perl6
</pre>

<p>
This will allow Perl 5 and 6 packages and modules (which should be packaged as
<code>libfoo-bar-perl6</code>), to co-exist for as long as required.
</p>

<p>
At some stage in the future when Perl 6 is sufficiently mature, the package
naming may be reversed such that the <code>perl</code> package contains Perl 6
and the current package becomes <code>perl5</code>.
</p>

<hr>

<h1>
Debian Perl Policy
<br>Footnotes</h1>

<h2><a href="#fr1" name="f1">1</a></h2>

<p>
see the <samp>Config</samp> module
</p>

<h2><a href="#fr2" name="f2">2</a></h2>

<p>
<code><a href="http://www.perl.com/CPAN">http://www.perl.com/CPAN</a></code>
</p>

<h2><a href="#fr3" name="f3">3</a></h2>

<p>
The environment variable <samp>PERL_MM_OPT</samp> may be used to pass the
<samp>INSTALLDIRS=vendor</samp> option in cases where <code>Makefile.PL</code>
is not invoked directly from <code>debian/rules</code>
</p>

<h2><a href="#fr4" name="f4">4</a></h2>

<p>
Replace &lt;tmp&gt; with the appropriate directory (nominally just tmp)
</p>

<h2><a href="#fr5" name="f5">5</a></h2>

<p>
Please note that dependencies caused by versioned uses and on separately
packaged modules are not included in this variable and must be explicitly
included.
</p>

<hr>

<p>
[ <a href="#ap-perl6">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch1">1</a> ]
[ <a href="#ch-perl">2</a> ]
[ <a href="#ch-site">3</a> ]
[ <a href="#ch-module_packages">4</a> ]
[ <a href="#ch-programs">5</a> ]
[ <a href="#ch-embed">6</a> ]
[ <a href="#ap-perl6">A</a> ]
[ <a href="#ch1">next</a> ]
</p>

<hr>

<p>
Debian Perl Policy
</p>

<address>
version 3.9.3.1, 2012-03-13<br>
<br>
Rapha&euml;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>