This file is indexed.

/usr/share/doc/tcl-doc/tcltk-policy.html is in tcl-doc 8.6.0+9.

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
<!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 Tcl/Tk Policy</title>

<link href="#tcltk-policy" rel="start">
<link href="#contents" rel="contents">
<link href="#copyright" rel="copyright">
<link href="#ch-tcltk" rel="chapter" title="1 Tcl/Tk Packaging">
<link href="#ch-module_packages" rel="chapter" title="2 Packaged Modules">
<link href="#ch-programs" rel="chapter" title="3 Tcl/Tk Programs">
<link href="#ap-build_dependencies" rel="appendix" title="A Build Dependencies">
<link href="#ap-modules_loading" rel="appendix" title="B Tcl/Tk modules loading">
<link href="#ap-debian_oddities" rel="appendix" title="C Possible issues building Tcl/Tk extensions">
<link href="#ap-check_list" rel="appendix" title="D Maintainer's Checklist">
<link href="#s-versions" rel="section" title="1.1 Versions">
<link href="#s-base" rel="section" title="1.2 Main packages">
<link href="#s-interpreter" rel="section" title="1.3 Tcl and Tk Interpreters">
<link href="#s-libtcltk" rel="section" title="1.4 Tcl/Tk libraries">
<link href="#s-tcltk-dev" rel="section" title="1.5 Tools/files for Development of Tcl/Tk modules and extensions">
<link href="#s-multiarch" rel="section" title="1.6 Multiarch support">
<link href="#s-paths" rel="section" title="1.7 Auto_load Path">
<link href="#s-docs" rel="section" title="1.8 Documentation">
<link href="#s-package_names" rel="section" title="2.1 Module Names">
<link href="#s-dependencies" rel="section" title="2.2 Dependencies">
<link href="#s-version_indep_progs" rel="section" title="3.1 Version Independent Programs">
<link href="#s-version_dep_progs" rel="section" title="3.2 Version Dependent Programs">
<link href="#s-interpreter_name" rel="subsection" title="1.3.1 Interpreters Names">
<link href="#s-interpreter_loc" rel="subsection" title="1.3.2 Interpreters Locations">

</head>

<body>

<p><a name="tcltk-policy"></a></p>
<hr>

<p>
[ <a href="#ap-check_list">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch-tcltk">1</a> ]
[ <a href="#ch-module_packages">2</a> ]
[ <a href="#ch-programs">3</a> ]
[ <a href="#ap-build_dependencies">A</a> ]
[ <a href="#ap-modules_loading">B</a> ]
[ <a href="#ap-debian_oddities">C</a> ]
[ <a href="#ap-check_list">D</a> ]
[ <a href="#ch-tcltk">next</a> ]
</p>

<hr>

<h1>
Debian Tcl/Tk Policy
<br></h1>

<hr>

<h2 id="abstract">Abstract</h2>

<p>
This document describes the packaging of Tcl/Tk within the Debian distribution
and the policy requirements for Tcl/Tk extensions and packages.  This policy
has been defined during Jessie release cycle, so pre-Jessie releases can
violate this policy in one or more aspects.  Backporters are warned.
</p>

<hr>

<h2 id="copyright">Copyright Notice</h2>

<p>
Copyright &copy; 2007-2013 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 GNU/Linux
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., 59
Temple Place - Suite 330, Boston, MA 02111-1307, USA.
</p>

<hr>

<h2 id="contents">Contents</h2>

<ul>
<li><a href="#ch-tcltk">1 Tcl/Tk Packaging</a>
  <ul>
  <li><a href="#s-versions">1.1 Versions</a></li>
  <li><a href="#s-base">1.2 Main packages</a></li>
  <li><a href="#s-interpreter">1.3 Tcl and Tk Interpreters</a></li>
  <li><a href="#s-libtcltk">1.4 Tcl/Tk libraries</a></li>
  <li><a href="#s-tcltk-dev">1.5 Tools/files for Development of Tcl/Tk modules and extensions</a></li>
  <li><a href="#s-multiarch">1.6 Multiarch support</a></li>
  <li><a href="#s-paths">1.7 Auto_load Path</a></li>
  <li><a href="#s-docs">1.8 Documentation</a>
  </ul></li>
<li><a href="#ch-module_packages">2 Packaged Modules</a>
  <ul>
  <li><a href="#s-package_names">2.1 Module Names</a></li>
  <li><a href="#s-dependencies">2.2 Dependencies</a>
  </ul></li>
<li><a href="#ch-programs">3 Tcl/Tk Programs</a>
  <ul>
  <li><a href="#s-version_indep_progs">3.1 Version Independent Programs</a></li>
  <li><a href="#s-version_dep_progs">3.2 Version Dependent Programs</a>
  </ul></li>
<li><a href="#ap-build_dependencies">A Build Dependencies</a><li><a href="#ap-modules_loading">B Tcl/Tk modules loading</a><li><a href="#ap-debian_oddities">C Possible issues building Tcl/Tk extensions</a><li><a href="#ap-check_list">D Maintainer's Checklist</a></li>
</ul>

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

<p>
[ <a href="#tcltk-policy">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ 1 ]
[ <a href="#ch-module_packages">2</a> ]
[ <a href="#ch-programs">3</a> ]
[ <a href="#ap-build_dependencies">A</a> ]
[ <a href="#ap-modules_loading">B</a> ]
[ <a href="#ap-debian_oddities">C</a> ]
[ <a href="#ap-check_list">D</a> ]
[ <a href="#ch-module_packages">next</a> ]
</p>

<hr>

<h1>
Debian Tcl/Tk Policy
<br>Chapter 1 - Tcl/Tk Packaging
</h1>

<hr>

<h2 id="s-versions">1.1 Versions</h2>

<p>
At any given time, the binary packages <code>tcl</code> and <code>tk</code>
represent the current default Debian Tcl/Tk version.  They contain Tcl and Tk
shells <code>/usr/bin/tclsh</code> and <code>/usr/bin/wish</code> which are
symlinks to the current default version binaries.  For backward compatibility
they provide the virtual packages <code>tclsh</code> and <code>wish</code> but
it isn't recommended to reference them in packages dependencies anymore.  The
packages <code>tcl</code> and <code>tk</code> are provided by the Debian
<code>tcltk-defaults</code> source package, in order to manage modules and
extensions packaging and upgrading better.  Modules should preferably use those
packages when appropriate (i.e.  they are either version independent or
properly versioned to inhibit the use of a non compatible versions, see <a
href="#s-dependencies">Dependencies, Section 2.2</a>), but it is not mandatory.
The default packages are
</p>

<pre>
     	tcl
     	tk
     	tcl-dev
     	tk-dev
     	tcl-doc
     	tk-doc
</pre>

<p>
The default Debian Tcl/Tk version should always be the latest stable upstream
release that can be integrated in the distribution.  Starting from 8.0, Tcl and
Tk share the same version numbering.  The default packages depend on the
appropriate versioned packages and provide useful additional symlinks.  Default
packages versions follow upstream versions, so that packages can use
appropriate versioning constraints on them when it is needed.
</p>

<p>
Apart from the default version, legacy versions of Tcl/Tk may be included as
well in the distribution, as long as they are needed by other packages, or as
long as it seems reasonable to provide them.  (Note: For the scope of this
document, Tcl/Tk versions mean the result of 'info tclversion' command, i.e.
Tcl/Tk 8.5 and 8.5.14 are subminor versions of the same Tcl/Tk version 8.5, but
Tcl 8.6 and 8.5 are indeed different versions.  The patchlevel intends the
result of the 'info patchlevel' command, i.e.  Tcl/Tk 8.5.14 and 8.5.13 have
the same version but different patchlevels).
</p>

<p>
In addition, unstable/development version of Tcl/Tk may be included in the
unstable/experimental distribution.
</p>

<p>
For any version, the main Tcl and Tk packages are called
<code>tcl<var>X</var>.<var>Y</var></code> and
<code>tk<var>X</var>.<var>Y</var></code> respectively.  They are always
packaged as separate sources, as for upstream.  Names of related packages or
extensions must follow the same convention if the inclusion of multiple
versions make sense or if they work only with specific versions of Tcl or Tk.
</p>

<p>
To avoid definition clashes with Debian terminology, we will call
<em>modules</em> any Tcl/Tk packages which consist uniquely of Tcl/Tk sources,
and <em>extension</em> any program which extends consistently Tcl/Tk using TEA
and shared libraries.  Note that this is not completely consistent with Tcl
terminology, which started from version 8.5 also introduces <em>.tm
modules</em> and traditionally deals with <em>packages</em> and <em>script
libraries</em>.
</p>

<hr>

<h2 id="s-base">1.2 Main packages</h2>

<p>
For every Tcl/Tk versions provided in the distribution, the packages
<code>libtcl<var>X</var>.<var>Y</var></code> and
<code>libtk<var>X</var>.<var>Y</var></code> comprise a corresponding Tcl/Tk
libraries, core modules and extensions of the upstream Tcl/Tk distribution.
They provide infrastructure for embedding Tcl into external programs.  Any such
packages includes a <var>Provides:</var> item of the virtual package
<code>libtcl</code> and a <var>Provides:</var> item for the <code>libtk</code>
virtual package.
</p>

<p>
Also, the packages <code>tcl<var>X</var>.<var>Y</var></code> and
<code>tk<var>X</var>.<var>Y</var></code> ship the binaries
<code>/usr/bin/tclsh<var>X</var>.<var>Y</var></code>,
<code>/usr/bin/wish<var>X</var>.<var>Y</var></code>.  Starting from Jessie they
don't provide alternatives for files <code>/usr/bin/tclsh</code> and
<code>/usr/bin/wish</code>.  If an application uses one of those, it has to
depend on <code>tcl</code> or <code>tk</code> package.
</p>

<p>
Tools and files for the <em>development</em> of Tcl/Tk extensions are split off
in two separate packages <code>tcl<var>X</var>.<var>Y</var>-dev</code> and
<code>tk<var>X</var>.<var>Y</var>-dev</code>.  Documentation is provided
separately in packages <code>tcl<var>X</var>.<var>Y</var>-doc</code> and
<code>tk<var>X</var>.<var>Y</var>-doc</code>.
</p>

<hr>

<h2 id="s-interpreter">1.3 Tcl and Tk Interpreters</h2>

<hr>

<h3 id="s-interpreter_name">1.3.1 Interpreters Names</h3>

<p>
Tcl/Tk scripts depending on the default Tcl/Tk version (see <a
href="#s-base">Main packages, Section 1.2</a>) or not depending on a specific
Tcl/Tk version must use <code>tclsh</code> and/or <code>wish</code>
(unversioned) as the interpreter name and must depend on <code>tcl</code>
and/or <code>tk</code> package.
</p>

<p>
Tcl/Tk scripts that only work with a specific Tcl/Tk version must explicitly
use the versioned interpreter name (<code>tclsh<var>X</var>.<var>Y</var></code>
and/or <code>wish<var>X</var>.<var>Y</var></code>) and must depend on the
specific Tcl/Tk versioned package (<code>tcl<var>X</var>.<var>Y</var></code>
and/or <code>tk<var>X</var>.<var>Y</var></code> respectively).
</p>

<hr>

<h3 id="s-interpreter_loc">1.3.2 Interpreters Locations</h3>

<p>
The path name for the Tcl interpreter is <code>/usr/bin/tclsh</code> or
<code>/usr/bin/tclsh<var>X</var>.<var>Y</var></code>.
</p>

<p>
The path name for the Tk interpreter is <code>/usr/bin/wish</code> or
<code>/usr/bin/wish<var>X</var>.<var>Y</var></code>.
</p>

<p>
If a maintainer would like to provide the user a possibility to override the
Debian Tcl interpreter, he may want to use <code>/usr/bin/env tclsh</code> or
<code>/usr/bin/env tclsh<var>X</var>.<var>Y</var></code>.  The same
consideration applies for Tk and the <code>wish</code> interpreter.  Starting
from Jessie administrators no longer can override default versions of the
interpreters using <samp>update-alternatives</samp>, which provided some
flexibility but caused confusion for program maintainers before.
</p>

<hr>

<h2 id="s-libtcltk">1.4 Tcl/Tk libraries</h2>

<p>
The Tcl and Tk libraries are provided by
<code>libtcl<var>X</var>.<var>Y</var></code> and
<code>libtk<var>X</var>.<var>Y</var></code> respectively.  These packages
install
<code>/usr/lib/$(DEB_HOST_MULTIARCH)/libtcl<var>X</var>.<var>Y</var>.so</code>
(soname is <samp>libtcl<var>X</var>.<var>Y</var>.so</samp>) and
<code>/usr/lib/$(DEB_HOST_MULTIARCH)/libtk<var>X</var>.<var>Y</var>.so</code>
(soname is <samp>libtk<var>X</var>.<var>Y</var>.so</samp>).
</p>

<hr>

<h2 id="s-tcltk-dev">1.5 Tools/files for Development of Tcl/Tk modules and extensions</h2>

<p>
Some tools and files for development of Tcl/Tk modules and extensions are
packaged as <code>tcl<var>X</var>.<var>Y</var>-dev</code> and
<code>tk<var>X</var>.<var>Y</var>-dev</code>.  These packages provide header
files as well as static and stub libraries.  Header files are installed in
<code>/usr/include/tcl<var>X</var>.<var>Y</var></code> directory (for both Tcl
and Tk).  Default packages <code>tcl-dev</code> and <code>tk-dev</code> provide
symlinks to the right versioned header files directory
</p>

<pre>
     	/usr/include/tcl -&gt; /usr/include/tcl<var>X</var>.<var>Y</var>
     	/usr/include/tk -&gt; /usr/include/tcl<var>X</var>.<var>Y</var>
</pre>

<p>
See net section and <a href="#ap-debian_oddities">Possible issues building
Tcl/Tk extensions, Appendix C</a> for more information about possible issues
with extension building due to Debian customizations.
</p>

<hr>

<h2 id="s-multiarch">1.6 Multiarch support</h2>

<p>
The Tcl and Tk libraries and development packages can be installed for several
architectures simultaneously.  They ship architecture dependent files in
<code>/usr/lib/$(DEB_HOST_MULTIARCH)</code> directory.  See also section <a
href="#ap-debian_oddities">Possible issues building Tcl/Tk extensions, Appendix
C</a> for information on how to package multiarchified Tcl/Tk extension.
</p>

<hr>

<h2 id="s-paths">1.7 Auto_load Path</h2>

<p>
The package search path (<var>auto_path</var>) for both Tcl and Tk is a list
searched in the following order:
</p>
<dl>
<dt>Site modules and extensions:</dt>
<dd>
<pre>
     	/usr/local/lib/tcltk (architecture dependent files)
     	/usr/local/share/tcltk (architecture independent files)
</pre>
</dd>
</dl>
<dl>
<dt>Packaged modules and extensions:</dt>
<dd>
<pre>
     	/usr/lib/tcltk/$(DEB_HOST_MULTIARCH) (architecture dependent files)
     	/usr/lib/tcltk (architecture dependent files)
     	/usr/share/tcltk (architecture independent files)
</pre>
</dd>
</dl>
<dl>
<dt>Version specific core modules and extensions:</dt>
<dd>
<pre>
     	/usr/share/tcltk/tcl<var>X</var>.<var>Y</var>
     	/usr/share/tcltk/tk<var>X</var>.<var>Y</var> (for Tk only)
</pre>
</dd>
</dl>

<p>
Maintainers must ensure that modules and extensions are correctly installed in
subdirs of the paths above consistently.  See <a
href="#ap-modules_loading">Tcl/Tk modules loading, Appendix B</a> for more
information about Tcl/Tk specific ways of dealing with modules and extensions
loading.  Developers must consider that these defaults impact TEA-based modules
and use preferably system-wide <code>tcl.m4</code> (it isn't TEA-compatible
though) instead of private one (see <a href="#ap-debian_oddities">Possible
issues building Tcl/Tk extensions, Appendix C</a>).
</p>

<hr>

<h2 id="s-docs">1.8 Documentation</h2>

<p>
Default packages <code>tcl-doc</code> and <code>tk-doc</code> which depend on
default versioned <code>tcl<var>X</var>.<var>Y</var>-doc</code> and
<code>tk<var>X</var>.<var>Y</var>-doc</code> are provided.  Since different
<code>tcl<var>X</var>.<var>Y</var>-doc</code> and
<code>tk<var>X</var>.<var>Y</var>-doc</code> conflict in files and cannot be
installed simultaneously, <code>tcl-doc</code> and <code>tk-doc</code> only
recommend <code>tcl<var>X</var>.<var>Y</var>-doc</code> and
<code>tk<var>X</var>.<var>Y</var>-doc</code> to allow administrators to install
any desirable package with Tcl/Tk manual pages.  The package
<code>tcl-doc</code> also includes a copy of the up-to-date version of this
policy.
</p>

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

<p>
[ <a href="#ch-tcltk">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch-tcltk">1</a> ]
[ 2 ]
[ <a href="#ch-programs">3</a> ]
[ <a href="#ap-build_dependencies">A</a> ]
[ <a href="#ap-modules_loading">B</a> ]
[ <a href="#ap-debian_oddities">C</a> ]
[ <a href="#ap-check_list">D</a> ]
[ <a href="#ch-programs">next</a> ]
</p>

<hr>

<h1>
Debian Tcl/Tk Policy
<br>Chapter 2 - Packaged Modules
</h1>

<hr>

<h2 id="s-package_names">2.1 Module Names</h2>

<p>
Packages should be named by the primary module provided.  The naming convention
for a module <samp>foo</samp> is <code>tcl<var>-foo</var></code> or
<code>tk<var>-foo</var></code> when the module is version independent.
</p>

<p>
The naming convention for a module <samp>foo</samp> is
<code>tcl<var>X.Y-foo</var></code> or <code>tkX.Y<var>-foo</var></code> when
the module is version dependent.
</p>

<p>
If the package already uses the name <code>tcl<var>foo</var></code> or
<code>tk<var>foo</var></code>, that is, naming without Tcl/Tk versioning even
if version-dependent and/or without hyphen, may use the name for now.  However,
the package naming proposed above is recommended for consistency.
</p>

<hr>

<h2 id="s-dependencies">2.2 Dependencies</h2>

<p>
Packaged modules available for one particular version of Tcl/Tk must depend on
the corresponding <code>libtcl<var>X</var>.<var>Y</var></code> and/or
<code>libtk<var>X</var>.<var>Y</var></code> package if they don't contain
Tcl/Tk scripts, and on <code>tcl<var>X</var>.<var>Y</var></code> and/or
<code>tk<var>X</var>.<var>Y</var></code> package if they do.
</p>

<p>
The recommended dependencies of version-independent packages are the following:
If the package works in all available Tcl/Tk versions it should depend on
<code>libtcl</code> or <code>libtk</code> (<code>tcl</code> or <code>tk</code>
if it includes Tcl/Tk scripts).  If the package works for several Tcl/Tk
versions (but not for all) it should depend on all of them alternatively (e.g.
<code>libtcl8.5</code> | <code>libtcl8.4</code>).
</p>

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

<p>
[ <a href="#ch-module_packages">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch-tcltk">1</a> ]
[ <a href="#ch-module_packages">2</a> ]
[ 3 ]
[ <a href="#ap-build_dependencies">A</a> ]
[ <a href="#ap-modules_loading">B</a> ]
[ <a href="#ap-debian_oddities">C</a> ]
[ <a href="#ap-check_list">D</a> ]
[ <a href="#ap-build_dependencies">next</a> ]
</p>

<hr>

<h1>
Debian Tcl/Tk Policy
<br>Chapter 3 - Tcl/Tk Programs
</h1>

<hr>

<h2 id="s-version_indep_progs">3.1 Version Independent Programs</h2>

<p>
Programs that can run with any version of Tcl/Tk should be started with
<samp>#!/usr/bin/tclsh</samp> or <samp>#!/usr/bin/wish</samp>.  They must also
specify a dependency on default packages <code>tcl</code> and/or
<code>tk</code>.  You're free to use <samp>#!/usr/bin/env tclsh</samp> and
<samp>#!/usr/bin/env wish</samp>, if you'd like to give the user a chance to
override the Debian Tcl/Tk package with a local version.
</p>

<hr>

<h2 id="s-version_dep_progs">3.2 Version Dependent Programs</h2>

<p>
Programs which require a specific version of Tcl must start with
<samp>#!/usr/bin/tclsh<var>X</var>.<var>Y</var></samp>.  They must also specify
a strict dependency on <code>tcl<var>X</var>.<var>Y</var></code>.  Programs
which require a specific version of Tk must start with
<samp>#!/usr/bin/wish<var>X</var>.<var>Y</var></samp>.  They must also specify
a strict dependency on <code>tk<var>X</var>.<var>Y</var></code>.  Again, if
you're using <samp>#!/usr/bin/env tclsh<var>X</var>.<var>Y</var></samp>, or
<samp>#!/usr/bin/env wish<var>X</var>.<var>Y</var></samp> please be aware that
a user might override the Debian Tcl/Tk packages with a local version and that
release default packages can change also.
</p>

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

<p>
[ <a href="#ch-programs">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch-tcltk">1</a> ]
[ <a href="#ch-module_packages">2</a> ]
[ <a href="#ch-programs">3</a> ]
[ A ]
[ <a href="#ap-modules_loading">B</a> ]
[ <a href="#ap-debian_oddities">C</a> ]
[ <a href="#ap-check_list">D</a> ]
[ <a href="#ap-modules_loading">next</a> ]
</p>

<hr>

<h1>
Debian Tcl/Tk Policy
<br>Appendix A - Build Dependencies</h1>

<hr>

<p>
Build dependencies for Tcl/Tk dependent packages must be declared for every
Tcl/Tk version, that the package is built for.  In order to build for a
specific version, add the versioned Tcl/Tk packages dependencies; it is
generally better and recommended depending on the appropriate default packages
with an eventual strict or relaxed versioning.
</p>

<p>
Extension packages and applications which link to Tcl/Tk libraries should
depend appropriately on one or more of the following packages (with or without
additional package version relationships):
</p>

<pre>
     	tcl-dev
     	tk-dev
     	tcl<var>X</var>.<var>Y</var>-dev
     	tk<var>X</var>.<var>Y</var>-dev
</pre>

<p>
For example, <code>tclreadline</code> build dependencies are the following:
</p>

<pre>
     	Build-Depends: debhelper (&gt;= 8.0.0), dpkg-dev (&gt;= 1.16.1~), <var>tcl-dev</var>,
     	 libreadline5-dev, autotools-dev
</pre>

<p>
Module packages, script libraries and Tcl-only applications should depend on
the
</p>

<pre>
     	tcl
     	tk
     	tcl<var>X</var>.<var>Y</var>
     	tk<var>X</var>.<var>Y</var>
</pre>

<p>
For example, <code>tcllib</code> build dependencies are the following:
</p>

<pre>
     	Build-Depends: debhelper (&gt;= 8.9.7)
     	Build-Depends-Indep: <var>tcl</var>
</pre>

<p>
Due to limitations of current autobuild daemon it is forbidden to use build
dependencies on the virtual packages <code>libtcl</code> or <code>libtk</code>
only.  These dependencies cannot guarantee consistent build environment, so it
is mandatory to prepend a preferred Tcl/Tk version before each of the virtual
packages.
</p>

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

<p>
[ <a href="#ap-build_dependencies">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch-tcltk">1</a> ]
[ <a href="#ch-module_packages">2</a> ]
[ <a href="#ch-programs">3</a> ]
[ <a href="#ap-build_dependencies">A</a> ]
[ B ]
[ <a href="#ap-debian_oddities">C</a> ]
[ <a href="#ap-check_list">D</a> ]
[ <a href="#ap-debian_oddities">next</a> ]
</p>

<hr>

<h1>
Debian Tcl/Tk Policy
<br>Appendix B - Tcl/Tk modules loading</h1>

<hr>

<p>
Tcl/Tk supports a few alternative ways for modules loading.  Modules can be
implemented as shared libraries, Tcl/Tk scripts or a combination of them.
Generally, specific index scripts are used for that and they need to be placed
in a directory included in the <samp>auto_path</samp> list along with scripts
and libraries.  Old non-package script libraries require a
<samp>tclIndex</samp> generated with the <samp>auto_mkindex</samp> Tcl
instruction.  Packages require a <samp>pkgIndex.tcl</samp> file generated with
the <samp>pkg_mkIndex</samp> Tcl instruction.  Tcl 8.5 introduced Tcl Modules
scripts (.tm) which do not require an index script for single file
implementations.  Another peculiar way of modules providing is based on
<em>Starkit</em> and the use of the Tcl Virtual File System (TclVFS).  In each
of those cases, the maintainer must ensure that the all required files are
included and installed in the right place to allow using of the module.
</p>

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

<p>
[ <a href="#ap-modules_loading">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch-tcltk">1</a> ]
[ <a href="#ch-module_packages">2</a> ]
[ <a href="#ch-programs">3</a> ]
[ <a href="#ap-build_dependencies">A</a> ]
[ <a href="#ap-modules_loading">B</a> ]
[ C ]
[ <a href="#ap-check_list">D</a> ]
[ <a href="#ap-check_list">next</a> ]
</p>

<hr>

<h1>
Debian Tcl/Tk Policy
<br>Appendix C - Possible issues building Tcl/Tk extensions</h1>

<hr>

<p>
In order to support this policy, a number of changes have been applied in
upstream <code>init.tcl</code>, <code>tclConfig.sh</code>,
<code>tkConfig.sh</code> and <code>tcl.m4</code> files.  Extensions using TEA
with local copies of <code>tcl.m4</code>, or which use custom guesses about
Tcl/Tk configuration could require explicit use of
</p>

<pre>
     	--with-tcl=/usr/lib/tcl<var>X</var>.<var>Y</var>
     	--with-tk=/usr/lib/tk<var>X</var>.<var>Y</var>
     	--with-tclincludes=/usr/include/tcl<var>X</var>.<var>Y</var>
</pre>

<p>
or other custom hacks.
</p>

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

<p>
[ <a href="#ap-debian_oddities">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch-tcltk">1</a> ]
[ <a href="#ch-module_packages">2</a> ]
[ <a href="#ch-programs">3</a> ]
[ <a href="#ap-build_dependencies">A</a> ]
[ <a href="#ap-modules_loading">B</a> ]
[ <a href="#ap-debian_oddities">C</a> ]
[ D ]
[ <a href="#tcltk-policy">next</a> ]
</p>

<hr>

<h1>
Debian Tcl/Tk Policy
<br>Appendix D - Maintainer's Checklist</h1>

<hr>
<ol>
<li>
<p>
Tcl/Tk has in general a very backward compatible API both at C and commands set
levels.  When packaging a module or extension, verify if it requires a specific
minimal version and if it includes run-time checks about that, possibly (which
is always convenient).  Scripts can include a <code>package require ?-exact?
Tcl X.Y</code> or <code>package require ?-exact?  Tk X.Y</code>, for instance.
In those cases, use a versioned dependency on one of the default packages
(<code>tcl</code>, <code>tk</code>, <code>tcl-dev</code> or
<code>tk-dev</code>), e.g.  <code>tcl</code> (&gt;= <var>X</var>.<var>Y</var>).
That is recommend instead of versioned packages dependencies, which are anyway
supported for compatibility with past conventions.  Note also that
<code>tk</code> depends on <code>tcl</code> and <code>tk-dev</code> depends on
<code>tcl-dev</code>.
</p>
</li>
<li>
<p>
Always install your package stuff in a per-package sub-directory of
<code>/usr/share/tcltk</code> (for scripted modules) and/or
<code>/usr/lib/tcltk</code> (for shared library extensions) along with the
needed index file (see <a href="#ap-modules_loading">Tcl/Tk modules loading,
Appendix B</a>).
</p>
</li>
<li>
<p>
If your package supports multiarch install its index file into a subdirectory
of <code>/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)</code> directory.  Tcl/Tk cannot
determine multiarch triplet in runtime, so package indices for different
architectures must differ.
</p>
</li>
<li>
<p>
This policy customizes <var>auto_path</var> differently with respect to generic
upstream UNIX platforms, so that you should use preferably system provided
<code>tcl.m4</code>.  Occasionally that could either require custom hacks for
non TEA-based building systems, or using <code>--with-tcl</code> or
<code>--with-tk</code> argument for TEA scripts.
</p>
</li>
</ol>

<hr>

<p>
[ <a href="#ap-check_list">previous</a> ]
[ <a href="#contents">Contents</a> ]
[ <a href="#ch-tcltk">1</a> ]
[ <a href="#ch-module_packages">2</a> ]
[ <a href="#ch-programs">3</a> ]
[ <a href="#ap-build_dependencies">A</a> ]
[ <a href="#ap-modules_loading">B</a> ]
[ <a href="#ap-debian_oddities">C</a> ]
[ <a href="#ap-check_list">D</a> ]
[ <a href="#ch-tcltk">next</a> ]
</p>

<hr>

<p>
Debian Tcl/Tk Policy
</p>

<address>
version 0.3.0<br>
<br>
Francesco Paolo Lovergine <code><a href="mailto:frankie@debian.org">mailto:frankie@debian.org</a></code><br>
Sergei Golovan <code><a href="mailto:sgolovan@debian.org">mailto:sgolovan@debian.org</a></code><br>
<br>
</address>
<hr>

</body>

</html>