source: trunk/doc/guide/new/xml/portfileref.xml @ 27771

Last change on this file since 27771 was 27771, checked in by markd@…, 12 years ago

Change the Tcl primitives section intro.

File size: 42.2 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4<chapter>
5  <title>Portfile Reference</title>
6
7  <para>This chapter serves as a reference for the major elements of a
8  <filename>Portfile</filename>: port phases, variants, StartupItems,
9  variables, keywords, and Tcl primitives.</para>
10
11  <section>
12    <title>Port Phases</title>
13
14    <para>A MacPorts port has ten distinct phases. The MacPorts base is set to
15    perform default steps for applications that use the standard
16    <command>configure</command>, <command>make</command>, and <command>make
17    install</command> steps, but for applications that do not conform to this
18    behavior, installation phases may be declared in a Portfile to override or
19    eliminate the default behavior, or augment it using pre- and/or post-
20    phases as shown in the section "Portfile Development".</para>
21
22    <section>
23      <title>Fetch</title>
24
25      <para>Overview: Fetch the <varname>${distfiles}</varname> from
26      <varname>${master_sites}</varname> and place it in
27      <filename>${prefix}/var/macports/distfiles</filename>.</para>
28    </section>
29
30    <section>
31      <title>Checksum</title>
32
33      <para>Overview: Compare <varname>${checksums}</varname> specified in a
34      <filename>Portfile</filename> to the checksums of the fetched
35      ${distfiles}.</para>
36    </section>
37
38    <section>
39      <title>Extract</title>
40
41      <para>Overview: Unzip and untar the <varname>${distfiles}</varname> into
42      the path ${prefix}/var/macports/build/..../work</para>
43    </section>
44
45    <section>
46      <title>Patch</title>
47
48      <para>Overview: Apply optional <ulink
49      url="http://en.wikipedia.org/wiki/Patch_(Unix)">patch</ulink> files
50      specified in <varname>${patchfiles}</varname> to modify a port's source
51      code file(s).</para>
52
53      <para>Details: Patch files are made using the <ulink
54      url="http://en.wikipedia.org/wiki/Diff">diff</ulink> command, and
55      MacPorts patches should be created as <ulink
56      url="http://en.wikipedia.org/wiki/Diff#Unified_format">unified
57      diffs</ulink>.</para>
58    </section>
59
60    <section>
61      <title>Configure</title>
62
63      <para>Overview: Execute the command "configure" in
64      <varname>${workpath}</varname>.</para>
65    </section>
66
67    <section>
68      <title>Build</title>
69
70      <para>Overview: Execute the command "make" in
71      <varname>${workpath}</varname>.</para>
72    </section>
73
74    <section>
75      <title>Destroot</title>
76
77      <para>Overview: Execute the command <command>make install
78      DESTDIR=${destroot}</command> in <varname>${workpath}</varname>.</para>
79
80      <para>Details: Understanding the destroot phase is critical to
81      understanding MacPorts, because, unlike some port systems, MacPorts
82      "stages" an installation into an intermediate location —not the final
83      file destination. There are two main advantages to this method.</para>
84
85      <orderedlist>
86        <listitem>
87          <para>A port's files may be cleanly uninstalled because all files
88          and locations are tracked.</para>
89        </listitem>
90
91        <listitem>
92          <para>Since a port's files are not installed into MacPorts directory
93          structure until an activation phase, a port may be deactivated
94          through MacPorts to allow activation of a different version of the
95          same port, thus allowing two versions of a port to be present,
96          though not both active, on a given host.</para>
97        </listitem>
98      </orderedlist>
99
100      <note>
101        <para>The <varname>$(DESTDIR)</varname> variable must be supported in
102        an application's Makefile for the MacPorts destroot phase to work
103        properly. Urge developers to fully support
104        <varname>$(DESTDIR)</varname> in their Makefiles.</para>
105      </note>
106    </section>
107
108    <section>
109      <title>Archive</title>
110
111      <para>Overview: Use tar to create a tarball of a port's destrooted files
112      and copy it to
113      <filename>${prefix}/var/macports/packages/</filename>.</para>
114    </section>
115
116    <section>
117      <title>Install</title>
118
119      <para>Overview: Copy a port's destrooted files into
120      <filename>${prefix}/var/macports/software</filename>. See "Port Images"
121      in section "MacPorts Internals" for details.</para>
122    </section>
123
124    <section>
125      <title>Activate</title>
126
127      <para>Overview: Set <ulink
128      url="http://en.wikipedia.org/wiki/Hard_link">hardlinks</ulink> pointing
129      to ${prefix}/var/macports/software to point to ${prefix}.</para>
130    </section>
131  </section>
132
133  <section>
134    <title>Dependencies</title>
135
136    <para>Free and open source software is highly modular, and MacPorts ports
137    often require modules not provided in a port's distribution to be
138    installed before a port may be installed, compiled, or run. These support
139    modules are generally other MacPorts ports, and the ports required to
140    satisfy prerequistes for a given port are called a port's
141    "dependencies".</para>
142
143    <para>There are three types of dependencies in MacPorts: library, build,
144    and run dependencies. The dependency type is important for proper port
145    upgrade and uninstall behavior. For example, you may not uninstall a port
146    that is a library dependency for another port, though you may remove one
147    with a build dependency; likewise, upgrading a port will upgrade its
148    library and build dependencies also, but not its run dependencies.</para>
149
150    <section>
151      <title>depends_lib</title>
152
153      <para>Library dependencies are needed both at build time (for headers
154      and libraries to link against) and at run time (to provide necessary
155      code).</para>
156
157      <programlisting>depends_lib         port:rrdtool</programlisting>
158    </section>
159
160    <section>
161      <title>depends_build</title>
162
163      <para>Build dependencies are only needed when software is compiled. They
164      are not needed at all once the software is compiled and
165      installed.</para>
166
167      <programlisting>depends_build       port:gcc42</programlisting>
168    </section>
169
170    <section>
171      <title>depends_run</title>
172
173      <para>Run dependencies are needed when the software is run, but not to
174      compile the software.</para>
175
176      <programlisting>depends_run         port:apache2</programlisting>
177    </section>
178
179    <section>
180      <title>Non-Port Dependencies</title>
181
182      <para>Port dependencies should refer to other MacPorts ports whenever
183      possible. However, if satisfying a dependency with a port is not
184      practical or desirable for a special reason, you may specify
185      dependencies by having MacPorts test for an individual file by replacing
186      <literal>port:</literal> with one of the options <literal>lib: bin: or
187      path:</literal>.</para>
188
189      <para>In this lib style dependency, if the file
190      <filename>libX11.6.x.dylib</filename> is not found in the library path
191      the XFree86 port will be installed to satisfy it.</para>
192
193      <programlisting>depends_lib         lib:libX11.6:XFree86</programlisting>
194
195      <para>In this bin style dependency, if the <filename>python</filename>
196      binary is not found in the shell's binary path the port python24 will be
197      installed.</para>
198
199      <programlisting>depends_build       bin:python:python24</programlisting>
200
201      <para>In this path style dependency, if the file
202      <filename>/usr/bin/nano</filename> is not found the nano port will be
203      installed.</para>
204
205      <programlisting>depends_run         path:/usr/bin/nano:nano</programlisting>
206    </section>
207  </section>
208
209  <section>
210    <title>StartupItems</title>
211
212    <para>StartupItems are keywords that create Mac OS X LaunchDaemon startup
213    scripts. To create these startup scripts for a port, choose from the
214    following keywords.</para>
215
216    <para><variablelist>
217        <varlistentry>
218          <term>startupitem.create</term>
219
220          <listitem>
221            <para>This triggers the creation of a StartupItem, defaults to
222            "no".</para>
223          </listitem>
224        </varlistentry>
225      </variablelist><variablelist>
226        <varlistentry>
227          <term>startupitem.name</term>
228
229          <listitem>
230            <para>Sets the name for the StartupItem, defaults to
231            ${portname}.</para>
232          </listitem>
233        </varlistentry>
234      </variablelist><variablelist>
235        <varlistentry>
236          <term>startupitem.executable</term>
237
238          <listitem>
239            <para>The name of the daemon to be run in the background. This is
240            the preferred type of startup item and may not be used together
241            with any other startupitem. This option may contain multiple
242            arguments, but they must be appropriate for a call to exec; they
243            may not contain arbitrary shell code.</para>
244          </listitem>
245        </varlistentry>
246      </variablelist><variablelist>
247        <varlistentry>
248          <term>startupitem.init</term>
249
250          <listitem>
251            <para>Shell code that will be executed prior to any of the options
252            startupitem.start, startupitem.stop and startupitem.restart.
253            Typically a startup script is specified.</para>
254          </listitem>
255        </varlistentry>
256      </variablelist><variablelist>
257        <varlistentry>
258          <term>startupitem.start</term>
259
260          <listitem>
261            <para>Shell code executed to start the daemon.</para>
262          </listitem>
263        </varlistentry>
264      </variablelist><variablelist>
265        <varlistentry>
266          <term>startupitem.stop</term>
267
268          <listitem>
269            <para>Shell code executed to stop the daemon.</para>
270          </listitem>
271        </varlistentry>
272      </variablelist><variablelist>
273        <varlistentry>
274          <term>startupitem.restart</term>
275
276          <listitem>
277            <para>Shell code executed to restart the daemon. In the absence of
278            this key, the daemon will be restarted by taking the stop action,
279            followed by taking the start action.</para>
280          </listitem>
281        </varlistentry>
282      </variablelist><variablelist>
283        <varlistentry>
284          <term>startupitem.pidfile</term>
285
286          <listitem>
287            <para>Specification for pidfile handling. It is useful in
288            conjunction with the startupitem.executable key, because it is
289            important that the startupitem know how to track the executable.
290            This keyword specifies whether the daemon generates its own
291            pidfile (auto), whether it generates its own but forgets to delete
292            it, so that the startupitem should delete it (clean), or whether
293            it never generates one, in which case the startupitem should
294            manage the pidfile on its own (manual), or whether no pidfile
295            should be used at all (none).</para>
296          </listitem>
297        </varlistentry>
298      </variablelist><variablelist>
299        <varlistentry>
300          <term>startupitem.logfile</term>
301
302          <listitem>
303            <para>Path to a logfile for logging events about the lifetime of
304            the startupitem. Depending on the type of startupitem, and the
305            manner in which it is started, standard output from the daemon may
306            also be directed to the logfile.</para>
307          </listitem>
308        </varlistentry>
309      </variablelist><variablelist>
310        <varlistentry>
311          <term>startupitem.logevents</term>
312
313          <listitem>
314            <para>Control whether or not to log events to the log file. If
315            logevents is set, events with timestamps are logged to the
316            logfile.</para>
317          </listitem>
318        </varlistentry>
319      </variablelist></para>
320  </section>
321
322  <section>
323    <title>Variables</title>
324
325    <para>This section describes the MacPorts preset variables that may be
326    used within Portfiles.</para>
327
328    <section>
329      <title>General</title>
330
331      <para>These are the variables available to any
332      <filename>Portfile</filename>.</para>
333
334      <para><variablelist>
335          <varlistentry>
336            <term>prefix</term>
337
338            <listitem>
339              <para>Installation prefix, set in the system-wide configuration
340              file <filename>${prefix}/etc/macports/macports.conf</filename>
341              —may be overridden on a per port basis. For example, aqua
342              applications are installed in
343              <filename>/Applications/MacPorts</filename>.</para>
344            </listitem>
345          </varlistentry>
346        </variablelist><variablelist>
347          <varlistentry>
348            <term>binpath</term>
349
350            <listitem>
351              <para>Default PATH to use in finding executables. Read
352              only.</para>
353            </listitem>
354          </varlistentry>
355        </variablelist><variablelist>
356          <varlistentry>
357            <term>libpath</term>
358
359            <listitem>
360              <para>Path to the MacPorts TCL libraries. Read only.</para>
361            </listitem>
362          </varlistentry>
363        </variablelist><variablelist>
364          <varlistentry>
365            <term>portpath</term>
366
367            <listitem>
368              <para>Path to the directory containing the downloaded
369              <filename>Portfile</filename>s. Read only.</para>
370            </listitem>
371          </varlistentry>
372        </variablelist><variablelist>
373          <varlistentry>
374            <term>filesdir</term>
375
376            <listitem>
377              <para>Path to port files relative to
378              <varname>${portpath}</varname>. Read only.</para>
379            </listitem>
380          </varlistentry>
381        </variablelist><variablelist>
382          <varlistentry>
383            <term>workpath</term>
384
385            <listitem>
386              <para>Full path to work directory. Read only.</para>
387            </listitem>
388          </varlistentry>
389        </variablelist><variablelist>
390          <varlistentry>
391            <term>worksrcpath</term>
392
393            <listitem>
394              <para>Full path to extracted source code. Equivalent to
395              <varname>${workpath}/${worksrcdir}</varname>.</para>
396            </listitem>
397          </varlistentry>
398        </variablelist><variablelist>
399          <varlistentry>
400            <term>destroot</term>
401
402            <listitem>
403              <para>Full path into which software will be destrooted.
404              Equivalent to <filename>${workpath}/destroot</filename>. Read
405              only.</para>
406            </listitem>
407          </varlistentry>
408        </variablelist><variablelist>
409          <varlistentry>
410            <term>distpath</term>
411
412            <listitem>
413              <para>Location to store downloaded distfiles. Read only.</para>
414            </listitem>
415          </varlistentry>
416        </variablelist><variablelist>
417          <varlistentry>
418            <term>os.platform</term>
419
420            <listitem>
421              <para>Identifies platform type (ie, "darwin", "freebsd", etc).
422              Read only.</para>
423            </listitem>
424          </varlistentry>
425        </variablelist><variablelist>
426          <varlistentry>
427            <term>os.arch</term>
428
429            <listitem>
430              <para>Identifies hardware type (ie, "powerpc", "intel"). Read
431              only.</para>
432            </listitem>
433          </varlistentry>
434        </variablelist><variablelist>
435          <varlistentry>
436            <term>os.version</term>
437
438            <listitem>
439              <para>The version number of the host operating system (ie "8.0"
440              for Darwin 8.0). Read only.</para>
441            </listitem>
442          </varlistentry>
443        </variablelist><variablelist>
444          <varlistentry>
445            <term>os.major</term>
446
447            <listitem>
448              <para>The major version number of the host operating system (ie
449              "8" for Darwin 8.0). Read only.</para>
450            </listitem>
451          </varlistentry>
452        </variablelist></para>
453    </section>
454
455    <section>
456      <title>PortGroup Variables</title>
457
458      <para>In addition to the general <filename>Portfile</filename> type for
459      standard Unix applications and libraries, there are six optional
460      PortGroup types that provide special <filename>Portfile</filename>
461      handling to make creating <filename>a Portfile</filename> easier.</para>
462
463      <itemizedlist>
464        <listitem>
465          <para>perl5</para>
466        </listitem>
467
468        <listitem>
469          <para>python24 and python25</para>
470        </listitem>
471
472        <listitem>
473          <para>ruby</para>
474        </listitem>
475
476        <listitem>
477          <para>xcode</para>
478        </listitem>
479
480        <listitem>
481          <para>gnustep</para>
482        </listitem>
483
484        <listitem>
485          <para>zope</para>
486        </listitem>
487      </itemizedlist>
488
489      <para>Some PortGroups provide additional variables when they are
490      declared within a Portfile. The additional variables provided by
491      PortGroups perl5, python, and ruby are listed below. You may view the
492      port Tcl code for each group in the directory<filename>
493      ${prefix}/share/macports/resources/port1.0/group</filename>.</para>
494
495      <variablelist>
496        <varlistentry>
497          <term>PortGroup perl5</term>
498
499          <listitem>
500            <para>Description: The variables available to a
501            <filename>Portfile</filename> when the <literal>PortGroup
502            perl5</literal> keyword is declared.</para>
503
504            <variablelist>
505              <varlistentry>
506                <term>perl5.version</term>
507
508                <listitem>
509                  <para>The MacPorts Perl version.</para>
510                </listitem>
511              </varlistentry>
512            </variablelist>
513
514            <variablelist>
515              <varlistentry>
516                <term>perl5.bin</term>
517
518                <listitem>
519                  <para>The Perl binary path (ie,
520                  <filename>${prefix}/bin/perl</filename>).</para>
521                </listitem>
522              </varlistentry>
523            </variablelist>
524
525            <variablelist>
526              <varlistentry>
527                <term>perl5.lib</term>
528
529                <listitem>
530                  <para>Path to the Perl vendor directory.</para>
531                </listitem>
532              </varlistentry>
533            </variablelist>
534
535            <variablelist>
536              <varlistentry>
537                <term>perl5.archlib</term>
538
539                <listitem>
540                  <para>Path to the Perl architecture-dependent modules
541                  directory.</para>
542                </listitem>
543              </varlistentry>
544            </variablelist>
545          </listitem>
546        </varlistentry>
547      </variablelist>
548
549      <variablelist>
550        <varlistentry>
551          <term>PortGroup python2x</term>
552
553          <listitem>
554            <para>Description: The variables available to a
555            <filename>Portfile</filename> when the <literal>PortGroup
556            python2x</literal> keyword is declared.</para>
557
558            <variablelist>
559              <varlistentry>
560                <term>python.bin</term>
561
562                <listitem>
563                  <para>The MacPorts Python binary location.</para>
564                </listitem>
565              </varlistentry>
566            </variablelist>
567
568            <variablelist>
569              <varlistentry>
570                <term>python.lib</term>
571
572                <listitem>
573                  <para>The Python dynamic library and path (ie,
574                  <filename>${prefix}/lib/libpython2.x.dylib</filename>).</para>
575                </listitem>
576              </varlistentry>
577            </variablelist>
578
579            <variablelist>
580              <varlistentry>
581                <term>python.include</term>
582
583                <listitem>
584                  <para>Path to the Python include directory.</para>
585                </listitem>
586              </varlistentry>
587            </variablelist>
588
589            <variablelist>
590              <varlistentry>
591                <term>python.pkgd</term>
592
593                <listitem>
594                  <para>Path to the Python site-packages directory. (ie,
595                  <filename>${prefix}/lib/python2.4/site-packages</filename>).</para>
596                </listitem>
597              </varlistentry>
598            </variablelist>
599          </listitem>
600        </varlistentry>
601      </variablelist>
602
603      <variablelist>
604        <varlistentry>
605          <term>PortGroup ruby</term>
606
607          <listitem>
608            <para>Description: The variables available to a
609            <filename>Portfile</filename> when the <literal>PortGroup
610            ruby</literal> keyword is declared.</para>
611
612            <variablelist>
613              <varlistentry>
614                <term>ruby.version</term>
615
616                <listitem>
617                  <para>The MacPorts Ruby version.</para>
618                </listitem>
619              </varlistentry>
620            </variablelist>
621
622            <variablelist>
623              <varlistentry>
624                <term>ruby.bin</term>
625
626                <listitem>
627                  <para>The Ruby binary location.</para>
628                </listitem>
629              </varlistentry>
630            </variablelist>
631
632            <variablelist>
633              <varlistentry>
634                <term>ruby.lib</term>
635
636                <listitem>
637                  <para>Path to the Ruby vendorlibdir directory (ie,
638                  <filename>${prefix}/lib/ruby/vendor_ruby/${ruby.version}</filename>)</para>
639                </listitem>
640              </varlistentry>
641
642              <varlistentry>
643                <term>ruby.arch</term>
644
645                <listitem>
646                  <para>The name for the Ruby architecture-dependent directory
647                  name (ie, <literal>i686-darwin8.10.1</literal>).</para>
648                </listitem>
649              </varlistentry>
650            </variablelist>
651
652            <variablelist>
653              <varlistentry>
654                <term>ruby.archlib</term>
655
656                <listitem>
657                  <para>Path to the Ruby vendor archdir (ie,
658                  <filename>${ruby.lib}/${ruby.arch}</filename>).</para>
659                </listitem>
660              </varlistentry>
661            </variablelist>
662          </listitem>
663        </varlistentry>
664      </variablelist>
665    </section>
666  </section>
667
668  <section>
669    <title>Keywords</title>
670
671    <para>MacPorts keywords are used to specify required or optional items
672    within a <filename>Portfile</filename>, or to override default options
673    used by MacPorts base for individual ports when necessary. Keywords are to
674    be used within the "global" and "variant" sections of Portfiles, and not
675    within optional port phase declarations. In other words, port phase
676    keywords are not located within port phase declarations, but rather they
677    <emphasis>refer</emphasis> to port phases and set options for those
678    phases, and they take affect whether or not phase declarations have been
679    explicitly defined by a port author.</para>
680
681    <para>The keywords listed below in category "global" specify information
682    for ports as a whole, whereas the keywords listed under a port phase
683    specify information to be used during a particular installation
684    phase.</para>
685
686    <section>
687      <title>Using -append and -delete Keywords</title>
688
689      <para>It is often necessary to add to a list of keyword values
690      previously set by MacPorts base or set by a prior Portfile keyword. In
691      these cases we generally don't want to replace the current list, but
692      rather to add or delete values from the list. For this purpose there are
693      "-append" and "-delete" keywords; they are listed below according to
694      keyword category. The three most common uses for these keywords are
695      given below.</para>
696
697      <itemizedlist>
698        <listitem>
699          <para>Preserve default configure arguments.</para>
700
701          <para>MacPorts base sets the gcc compiler flags CFLAGS and LDFLAGS
702          for all ports using <literal>configure.cflags</literal> and
703          <literal>configure.ldflags</literal>, therefore to keep from
704          overwriting the default compiler flags use:</para>
705
706          <itemizedlist>
707            <listitem>
708              <para><literal>configure.cflags-append</literal></para>
709            </listitem>
710
711            <listitem>
712              <para><literal>configure.ldflags-append</literal></para>
713            </listitem>
714          </itemizedlist>
715        </listitem>
716
717        <listitem>
718          <para>Preserve default dependencies within a PortGroup.</para>
719
720          <para>Ports in a PortGroup have default library dependencies set by
721          MacPorts base. Therefore, never use <literal>depends_lib</literal>
722          in ports belonging to a PortGroup or it will overwrite the default
723          library dependencies. Instead, use:</para>
724
725          <itemizedlist>
726            <listitem>
727              <para><literal>depends_lib-append</literal></para>
728            </listitem>
729          </itemizedlist>
730        </listitem>
731
732        <listitem>
733          <para>Add or delete port dependencies, distfiles, patchfiles, etc.
734          for port variants.</para>
735
736          <para>When a variant requires more or fewer dependencies, distfiles,
737          or patchfiles, you want to add or remove items to the list of
738          dependency keyword values that were set in the global section of the
739          Portfile. Use the appropriate keywords, for example:</para>
740
741          <itemizedlist>
742            <listitem>
743              <para><literal>depends_lib-append</literal> or
744              <literal>depends_lib-delete</literal></para>
745            </listitem>
746
747            <listitem>
748              <para><literal>distfiles-append</literal> or
749              <literal>distfiles-delete</literal></para>
750            </listitem>
751
752            <listitem>
753              <para><literal>patchfiles-append</literal> or
754              <literal>patchfiles-delete</literal></para>
755            </listitem>
756          </itemizedlist>
757        </listitem>
758      </itemizedlist>
759    </section>
760
761    <section>
762      <title>Global Keywords</title>
763
764      <para>Global keywords.</para>
765
766      <variablelist>
767        <varlistentry>
768          <term>name</term>
769
770          <listitem>
771            <para>Port name.</para>
772          </listitem>
773        </varlistentry>
774      </variablelist>
775
776      <variablelist>
777        <varlistentry>
778          <term>version</term>
779
780          <listitem>
781            <para>Port version.</para>
782          </listitem>
783        </varlistentry>
784      </variablelist>
785
786      <variablelist>
787        <varlistentry>
788          <term>categories</term>
789
790          <listitem>
791            <para>Port category(s).</para>
792          </listitem>
793        </varlistentry>
794      </variablelist>
795
796      <variablelist>
797        <varlistentry>
798          <term>maintainers</term>
799
800          <listitem>
801            <para>Port maintainer(s).</para>
802          </listitem>
803        </varlistentry>
804      </variablelist>
805
806      <variablelist>
807        <varlistentry>
808          <term>description</term>
809
810          <listitem>
811            <para>Short description.</para>
812          </listitem>
813        </varlistentry>
814      </variablelist>
815
816      <variablelist>
817        <varlistentry>
818          <term>long_description</term>
819
820          <listitem>
821            <para>Long description.</para>
822          </listitem>
823        </varlistentry>
824      </variablelist>
825
826      <variablelist>
827        <varlistentry>
828          <term>homepage</term>
829
830          <listitem>
831            <para>Port application's homepage.</para>
832          </listitem>
833        </varlistentry>
834      </variablelist>
835
836      <variablelist>
837        <varlistentry>
838          <term>platforms</term>
839
840          <listitem>
841            <para>Platform(s) supported.</para>
842          </listitem>
843        </varlistentry>
844      </variablelist>
845
846      <variablelist>
847        <varlistentry>
848          <term>master_sites</term>
849
850          <listitem>
851            <para>Download site(s) for the distribution files.</para>
852          </listitem>
853        </varlistentry>
854      </variablelist>
855
856      <variablelist>
857        <varlistentry>
858          <term>checksums</term>
859
860          <listitem>
861            <para>Checksum(s) of the distribution files.</para>
862          </listitem>
863        </varlistentry>
864      </variablelist>
865
866      <variablelist>
867        <varlistentry>
868          <term>depends_lib</term>
869
870          <listitem>
871            <para></para>
872
873            <variablelist>
874              <varlistentry>
875                <term>depends_lib-append</term>
876
877                <listitem>
878                  <para></para>
879                </listitem>
880              </varlistentry>
881            </variablelist>
882
883            <variablelist>
884              <varlistentry>
885                <term>depends_lib-delete</term>
886
887                <listitem>
888                  <para></para>
889                </listitem>
890              </varlistentry>
891            </variablelist>
892          </listitem>
893        </varlistentry>
894      </variablelist>
895
896      <variablelist>
897        <varlistentry>
898          <term>depends_build</term>
899
900          <listitem>
901            <para></para>
902
903            <variablelist>
904              <varlistentry>
905                <term>depends_build-append</term>
906
907                <listitem>
908                  <para></para>
909                </listitem>
910              </varlistentry>
911            </variablelist>
912
913            <variablelist>
914              <varlistentry>
915                <term>depends_build-delete</term>
916
917                <listitem>
918                  <para></para>
919                </listitem>
920              </varlistentry>
921            </variablelist>
922          </listitem>
923        </varlistentry>
924      </variablelist>
925
926      <variablelist>
927        <varlistentry>
928          <term>depends_run</term>
929
930          <listitem>
931            <para></para>
932
933            <variablelist>
934              <varlistentry>
935                <term>depends_run-append</term>
936
937                <listitem>
938                  <para></para>
939                </listitem>
940              </varlistentry>
941            </variablelist>
942
943            <variablelist>
944              <varlistentry>
945                <term>depends_run-delete</term>
946
947                <listitem>
948                  <para></para>
949                </listitem>
950              </varlistentry>
951            </variablelist>
952          </listitem>
953        </varlistentry>
954      </variablelist>
955    </section>
956
957    <section>
958      <title>Port Phase Keywords</title>
959
960      <para>MacPorts has ten distinct port installation phases. As previosly
961      stated, port phase keywords are not located within port phase
962      declarations; they <emphasis>refer</emphasis> to port phases and set
963      options for them.</para>
964
965      <para>The fetch phase ...</para>
966
967      <variablelist>
968        <varlistentry>
969          <term></term>
970
971          <listitem>
972            <para></para>
973          </listitem>
974        </varlistentry>
975      </variablelist>
976
977      <variablelist>
978        <varlistentry>
979          <term></term>
980
981          <listitem>
982            <para></para>
983          </listitem>
984        </varlistentry>
985      </variablelist>
986
987      <variablelist>
988        <varlistentry>
989          <term></term>
990
991          <listitem>
992            <para></para>
993          </listitem>
994        </varlistentry>
995      </variablelist>
996
997      <variablelist>
998        <varlistentry>
999          <term></term>
1000
1001          <listitem>
1002            <para></para>
1003          </listitem>
1004        </varlistentry>
1005      </variablelist>
1006
1007      <variablelist>
1008        <varlistentry>
1009          <term></term>
1010
1011          <listitem>
1012            <para></para>
1013          </listitem>
1014        </varlistentry>
1015      </variablelist>
1016
1017      <variablelist>
1018        <varlistentry>
1019          <term></term>
1020
1021          <listitem>
1022            <para></para>
1023          </listitem>
1024        </varlistentry>
1025      </variablelist>
1026
1027      <variablelist>
1028        <varlistentry>
1029          <term></term>
1030
1031          <listitem>
1032            <para></para>
1033          </listitem>
1034        </varlistentry>
1035      </variablelist>
1036
1037      <para>The checksum phase ...</para>
1038
1039      <variablelist>
1040        <varlistentry>
1041          <term></term>
1042
1043          <listitem>
1044            <para></para>
1045          </listitem>
1046        </varlistentry>
1047      </variablelist>
1048
1049      <variablelist>
1050        <varlistentry>
1051          <term></term>
1052
1053          <listitem>
1054            <para></para>
1055          </listitem>
1056        </varlistentry>
1057      </variablelist>
1058
1059      <variablelist>
1060        <varlistentry>
1061          <term></term>
1062
1063          <listitem>
1064            <para></para>
1065          </listitem>
1066        </varlistentry>
1067      </variablelist>
1068
1069      <variablelist>
1070        <varlistentry>
1071          <term></term>
1072
1073          <listitem>
1074            <para></para>
1075          </listitem>
1076        </varlistentry>
1077      </variablelist>
1078
1079      <variablelist>
1080        <varlistentry>
1081          <term></term>
1082
1083          <listitem>
1084            <para></para>
1085          </listitem>
1086        </varlistentry>
1087      </variablelist>
1088
1089      <para>The extract phase ...</para>
1090
1091      <variablelist>
1092        <varlistentry>
1093          <term></term>
1094
1095          <listitem>
1096            <para></para>
1097          </listitem>
1098        </varlistentry>
1099      </variablelist>
1100
1101      <variablelist>
1102        <varlistentry>
1103          <term></term>
1104
1105          <listitem>
1106            <para></para>
1107          </listitem>
1108        </varlistentry>
1109      </variablelist>
1110
1111      <variablelist>
1112        <varlistentry>
1113          <term></term>
1114
1115          <listitem>
1116            <para></para>
1117          </listitem>
1118        </varlistentry>
1119      </variablelist>
1120
1121      <variablelist>
1122        <varlistentry>
1123          <term></term>
1124
1125          <listitem>
1126            <para></para>
1127          </listitem>
1128        </varlistentry>
1129      </variablelist>
1130
1131      <variablelist>
1132        <varlistentry>
1133          <term></term>
1134
1135          <listitem>
1136            <para></para>
1137          </listitem>
1138        </varlistentry>
1139      </variablelist>
1140
1141      <variablelist>
1142        <varlistentry>
1143          <term></term>
1144
1145          <listitem>
1146            <para></para>
1147          </listitem>
1148        </varlistentry>
1149      </variablelist>
1150
1151      <para>The patch phase ...</para>
1152
1153      <variablelist>
1154        <varlistentry>
1155          <term></term>
1156
1157          <listitem>
1158            <para></para>
1159          </listitem>
1160        </varlistentry>
1161      </variablelist>
1162
1163      <variablelist>
1164        <varlistentry>
1165          <term></term>
1166
1167          <listitem>
1168            <para></para>
1169          </listitem>
1170        </varlistentry>
1171      </variablelist>
1172
1173      <variablelist>
1174        <varlistentry>
1175          <term></term>
1176
1177          <listitem>
1178            <para></para>
1179          </listitem>
1180        </varlistentry>
1181      </variablelist>
1182
1183      <variablelist>
1184        <varlistentry>
1185          <term></term>
1186
1187          <listitem>
1188            <para></para>
1189          </listitem>
1190        </varlistentry>
1191      </variablelist>
1192
1193      <variablelist>
1194        <varlistentry>
1195          <term></term>
1196
1197          <listitem>
1198            <para></para>
1199          </listitem>
1200        </varlistentry>
1201      </variablelist>
1202
1203      <variablelist>
1204        <varlistentry>
1205          <term></term>
1206
1207          <listitem>
1208            <para></para>
1209          </listitem>
1210        </varlistentry>
1211      </variablelist>
1212
1213      <para>The configuration phase ...</para>
1214
1215      <para>MacPorts base sets some important default configure options, so
1216      you must be careful not to overwrite them with your Portfile keywords;
1217      for this reason you should use the -append version of configure
1218      keywords. For example, MacPorts base sets default
1219      <literal>configure.ldflags</literal> so you should always use
1220      <literal>configure.cflags-append</literal> to set additional CFLAGS in
1221      Portfiles.</para>
1222
1223      <variablelist>
1224        <varlistentry>
1225          <term>configure.args</term>
1226
1227          <listitem>
1228            <para></para>
1229
1230            <variablelist>
1231              <varlistentry>
1232                <term>configure.args-append</term>
1233
1234                <listitem>
1235                  <para></para>
1236                </listitem>
1237              </varlistentry>
1238            </variablelist>
1239
1240            <variablelist>
1241              <varlistentry>
1242                <term>configure.args-delete</term>
1243
1244                <listitem>
1245                  <para></para>
1246                </listitem>
1247              </varlistentry>
1248            </variablelist>
1249          </listitem>
1250        </varlistentry>
1251      </variablelist>
1252
1253      <variablelist>
1254        <varlistentry>
1255          <term>configure.cflags</term>
1256
1257          <listitem>
1258            <para></para>
1259
1260            <variablelist>
1261              <varlistentry>
1262                <term>configure.cflags-append</term>
1263
1264                <listitem>
1265                  <para></para>
1266                </listitem>
1267              </varlistentry>
1268            </variablelist>
1269
1270            <variablelist>
1271              <varlistentry>
1272                <term>configure.cflags-delete</term>
1273
1274                <listitem>
1275                  <para></para>
1276                </listitem>
1277              </varlistentry>
1278            </variablelist>
1279          </listitem>
1280        </varlistentry>
1281      </variablelist>
1282
1283      <variablelist>
1284        <varlistentry>
1285          <term>configure.ldflags</term>
1286
1287          <listitem>
1288            <para></para>
1289
1290            <variablelist>
1291              <varlistentry>
1292                <term>configure.ldflags-append</term>
1293
1294                <listitem>
1295                  <para></para>
1296                </listitem>
1297              </varlistentry>
1298            </variablelist>
1299
1300            <variablelist>
1301              <varlistentry>
1302                <term>configure.ldflags-delete</term>
1303
1304                <listitem>
1305                  <para></para>
1306                </listitem>
1307              </varlistentry>
1308            </variablelist>
1309          </listitem>
1310        </varlistentry>
1311      </variablelist>
1312
1313      <variablelist>
1314        <varlistentry>
1315          <term></term>
1316
1317          <listitem>
1318            <para></para>
1319          </listitem>
1320        </varlistentry>
1321      </variablelist>
1322
1323      <variablelist>
1324        <varlistentry>
1325          <term></term>
1326
1327          <listitem>
1328            <para></para>
1329          </listitem>
1330        </varlistentry>
1331      </variablelist>
1332
1333      <para>The build phase ...</para>
1334
1335      <variablelist>
1336        <varlistentry>
1337          <term></term>
1338
1339          <listitem>
1340            <para></para>
1341          </listitem>
1342        </varlistentry>
1343      </variablelist>
1344
1345      <variablelist>
1346        <varlistentry>
1347          <term></term>
1348
1349          <listitem>
1350            <para></para>
1351          </listitem>
1352        </varlistentry>
1353      </variablelist>
1354
1355      <variablelist>
1356        <varlistentry>
1357          <term></term>
1358
1359          <listitem>
1360            <para></para>
1361          </listitem>
1362        </varlistentry>
1363      </variablelist>
1364
1365      <variablelist>
1366        <varlistentry>
1367          <term></term>
1368
1369          <listitem>
1370            <para></para>
1371          </listitem>
1372        </varlistentry>
1373      </variablelist>
1374
1375      <variablelist>
1376        <varlistentry>
1377          <term></term>
1378
1379          <listitem>
1380            <para></para>
1381          </listitem>
1382        </varlistentry>
1383      </variablelist>
1384
1385      <para>The destroot phase ...</para>
1386
1387      <variablelist>
1388        <varlistentry>
1389          <term></term>
1390
1391          <listitem>
1392            <para></para>
1393          </listitem>
1394        </varlistentry>
1395      </variablelist>
1396
1397      <variablelist>
1398        <varlistentry>
1399          <term></term>
1400
1401          <listitem>
1402            <para></para>
1403          </listitem>
1404        </varlistentry>
1405      </variablelist>
1406
1407      <variablelist>
1408        <varlistentry>
1409          <term></term>
1410
1411          <listitem>
1412            <para></para>
1413          </listitem>
1414        </varlistentry>
1415      </variablelist>
1416
1417      <variablelist>
1418        <varlistentry>
1419          <term></term>
1420
1421          <listitem>
1422            <para></para>
1423          </listitem>
1424        </varlistentry>
1425      </variablelist>
1426
1427      <variablelist>
1428        <varlistentry>
1429          <term></term>
1430
1431          <listitem>
1432            <para></para>
1433          </listitem>
1434        </varlistentry>
1435      </variablelist>
1436
1437      <para>The install phase ...</para>
1438
1439      <para>The activate phase ...</para>
1440
1441      <para></para>
1442
1443      <para></para>
1444    </section>
1445  </section>
1446
1447  <section>
1448    <title>Tcl Code and Primitives</title>
1449
1450    <para>A MacPorts <filename>Portfile</filename> is a Tcl script, so it may
1451    contain any arbitrary Tcl code you may learn about in a <ulink
1452    url="http://tmml.sourceforge.net/doc/tcl/">Tcl reference manual</ulink>.
1453    However, few authors will use arbitrary Tcl code; the vast majority will
1454    use Tcl primitives that were coded within MacPorts for performing the most
1455    common tasks needed for Portfiles. The list below is an exhaustive list of
1456    Tcl primitives provided by MacPorts base.</para>
1457
1458    <variablelist>
1459      <varlistentry>
1460        <term>reinplace</term>
1461
1462        <listitem>
1463          <para>Description reinplace.</para>
1464        </listitem>
1465      </varlistentry>
1466    </variablelist>
1467
1468    <variablelist>
1469      <varlistentry>
1470        <term>xinstall</term>
1471
1472        <listitem>
1473          <para>Description xinstall.</para>
1474        </listitem>
1475      </varlistentry>
1476    </variablelist>
1477
1478    <variablelist>
1479      <varlistentry>
1480        <term>file copy</term>
1481
1482        <listitem>
1483          <para>Description file copy.</para>
1484        </listitem>
1485      </varlistentry>
1486    </variablelist>
1487
1488    <variablelist>
1489      <varlistentry>
1490        <term>file delete</term>
1491
1492        <listitem>
1493          <para>Description file delete.</para>
1494        </listitem>
1495      </varlistentry>
1496    </variablelist>
1497
1498    <variablelist>
1499      <varlistentry>
1500        <term></term>
1501
1502        <listitem>
1503          <para></para>
1504        </listitem>
1505      </varlistentry>
1506    </variablelist>
1507
1508    <variablelist>
1509      <varlistentry>
1510        <term></term>
1511
1512        <listitem>
1513          <para></para>
1514        </listitem>
1515      </varlistentry>
1516    </variablelist>
1517
1518    <variablelist>
1519      <varlistentry>
1520        <term></term>
1521
1522        <listitem>
1523          <para></para>
1524        </listitem>
1525      </varlistentry>
1526    </variablelist>
1527
1528    <variablelist>
1529      <varlistentry>
1530        <term></term>
1531
1532        <listitem>
1533          <para></para>
1534        </listitem>
1535      </varlistentry>
1536    </variablelist>
1537
1538    <variablelist>
1539      <varlistentry>
1540        <term></term>
1541
1542        <listitem>
1543          <para></para>
1544        </listitem>
1545      </varlistentry>
1546    </variablelist>
1547
1548    <variablelist>
1549      <varlistentry>
1550        <term></term>
1551
1552        <listitem>
1553          <para></para>
1554        </listitem>
1555      </varlistentry>
1556    </variablelist>
1557
1558    <variablelist>
1559      <varlistentry>
1560        <term></term>
1561
1562        <listitem>
1563          <para></para>
1564        </listitem>
1565      </varlistentry>
1566    </variablelist>
1567  </section>
1568</chapter>
Note: See TracBrowser for help on using the repository browser.