source: branches/gsoc09-logging/base/doc/portfile.7 @ 136621

Last change on this file since 136621 was 59527, checked in by blb@…, 11 years ago

Merge from trunk (may be a few missed bits to be picked up later)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 46.4 KB
1.\" portfile.7
3.\" Copyright (c) 2002 Apple Computer, Inc.
4.\" All rights reserved.
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of Apple Computer, Inc. nor the names of its
15.\"    contributors may be used to endorse or promote products derived from
16.\"    this software without specific prior written permission.
30.Dd February 13, 2007
31.Dt PORTFILE 7 "MacPorts"
32.Os Darwin
33.Sh NAME
34.Nm Portfile
35.Nd MacPorts description file reference
37A complete reference of all available
39variables and example syntax.
40.Nm Portfiles
41consist of valid TCL, allowing for simple key/value pair syntax as well
42as utilization of TCL's extensive functionality.
43.Nm Portfiles
44are encoded in UTF-8.
47\.Nm MacPorts System
48uses a target dependency system based on a
49depends/provides model, allowing for targets to be registered and
50executed in the correct order based on their individual requirements.
54author needs to be aware of the various standard targets, the options
55that they require and the variables that both the targets and the port
56system provide.
58Portfiles must begin with a PortSystem line that defines which version of the
59Portfile interpreter should be used.
61.Sy Synopsis:
62.Dl PortSystem 1.0
64All ports are required to set certain variables.
65.Bl -tag -width lc
66.It Ic name
67Full name of port.
69.Sy Type:
70.Em required
72.Sy Example:
73.Dl name XFree86
74.It Ic version
75Upstream version of software.
77.Sy Type:
78.Em required
80.Sy Example:
81.Dl version 4.2.1
82.It Ic epoch
83If a port's version numbering changes such that a newer version looks
84older than the previous version, the
85.Ic epoch
86should be increased. Often the
87.Ic epoch
88is formatted like a date.
90.Sy Type:
91.Em optional
93.Sy Default:
94.Em 0
96.Sy Example:
97.Dl epoch 20041231
98.It Ic description
99One line description of the software and what it does.  To appear in the
100description, brackets and semi-colons need to be escaped with a backslash (i.e.
101they must be written as "\\[", "\\]" and "\\;").  The escape sequences listed in
102.Xr re_syntax n
103may also be used, with the exception of \\n, \\r and \\f.
105.Sy Type:
106.Em required
108.Sy Example:
109.Dl description Dictionary Server Protocol (RFC2229) client
110.It Ic long_description
111A verbose description of the software and what it does.  To appear in the
112description, brackets and semi-colons need to be escaped with a backslash (i.e.
113they must be written as "\\[", "\\]" and "\\;").  The escape sequences listed in
114.Xr re_syntax n
115may also be used, with the exception of \\n, \\r and \\f.
117.Sy Type:
118.Em required
120.Sy Example:
121.Bd -literal -offset indent -compact
122long_description The GNU Image Manipulation Program \e\
124    (GIMP) is a powerful tool for the preparation and \e\
126    manipulation of digital images. The GIMP provides \e\
128    the user with a wide variety of image manipulation, \e\
130    painting, processing, and rendering tools.
132.It Ic revision
133Local revision number of
134.Nm .
135Increment for port revisions which would change its installation in any way.
137.Sy Type:
138.Em optional
140.Sy Default:
141.Em 0
143.Sy Example:
144.Dl revision 1
145.It Ic categories
146Categories to which this port belongs.
148.Sy Type:
149.Em required
151.Sy Example:
152.Dl categories spelling textproc
153.It Ic maintainers
154E-mail address(es) of port maintainer(s).
156.Sy Type:
157.Em required
159.Sy Example:
160.Dl maintainers
161.It Ic platforms
162Declares which platforms are supported by the port.
164.Sy Type:
165.Em required
167.Sy Values:
168.Em darwin freebsd
170.Sy Example:
171.Dl platforms darwin
172.It Ic homepage
173Project homepage for the port.
175.Sy Type:
176.Em required
178.Sy Example:
180.It Ic master_sites
181List of sites to fetch
182.Ic distfiles
183from or a predefined mirror site
184list. If set to a predefined mirror site, without a subdirectory being
185defined, the portname is used as the name of the subdirectory.
187.Sy Type:
188.Em required
190.Sy Example:
191.Bd -literal -offset indent -compact
192master_sites \e\
194    sourceforge
196.It Ic worksrcdir
197Path to source directory relative to
198.Ic workpath .
200.Sy Type:
201.Em optional
203.Sy Default:
204.Em ${distname}
206.Sy Example:
207.Dl worksrcdir ${distname}-src-${version}
208.It Ic distname
209Name of distribution file, without the
210.Cm extract.suffix .
212.Sy Type:
213.Em optional
215.Sy Default:
216.Em ${name}-${version}
218.Sy Example:
219.Dl distname ${name}-${version}-src
220.It Xo
221.Ic checksums Ar filename Ar type Ar checksum
222.Op Ar filename Ar type checksum ...
224List of checksums for the
225.Ic distfiles .
226The checksum
227.Ar type
228can currently be md5, rmd160 or sha1. The
229.Ar filename
230can be omitted if there is only one distfile.
232.Sy Type:
233.Em required
235.Sy Example:
236.Bd -literal -offset indent -compact
237checksums dictd-1.7.1.tar.gz md5 81317b86ea0a5df0163900ad2e6bb12c \e\
238        magic-words-1.7.1.tar.gz md5 897a005182928613eadd30c267ce9c5b
241.Sy Example (ledit 1.11):
242.Bd -literal -offset indent -compact
243checksums md5 a2d38ba641682509c1e964ad699a9dd2 \e\
244        sha1 1fb6443b5fdf3c83787953f06282d256477c1288
247.Sy Example (ssldump 0.9b3):
248.Bd -literal -offset indent -compact
249checksums md5 ac8c28fe87508d6bfb06344ec496b1dd \e\
250        sha1 a633a9a811a138eac5ed440d583473b644135ef5 \e\
251        rmd160 941cf8f2ef8459ec4f9ce65772e134505d46566
253.It Ic macosx_deployment_target
254Value for MACOSX_DEPLOYMENT_TARGET environment variable when invoking the configure script.
256.Sy Type:
257.Em optional
259.Sy Default:
260.Em (current OS version)
262.Sy Example:
263.Dl macosx_deployment_target 10.4
264.It Ic use_parallel_build
265If set to yes (and the user has enabled buildmakejobs in
266.Pa macports.conf
267), the port can be built using more than one job.
268.Sy Type:
269.Em optional
271.Sy Default:
272.Em no
274.Sy Example:
275.Dl use_parallel_build yes
276.It Ic use_automake
277If set to yes, run the
278.Cm automake
279target to build any
281files for use by
282.Pa configure .
284.Sy Type:
285.Em optional
287.Sy Default:
288.Em no
290.Sy Example:
291.Dl use_automake yes
292.It Ic use_autoconf
293If set to yes, run the
294.Cm autoconf
295target to build any
296.Pa configure
297script required.
299.Sy Type:
300.Em optional
302.Sy Default:
303.Em no
305.Sy Example:
306.Dl use_autoconf yes
307.It Ic use_configure
308If set to yes, run the
309.Cm configure
310target to configure the build.
312.Sy Type:
313.Em optional
315.Sy Default:
316.Em yes
318.Sy Example:
319.Dl use_configure no
320.It Ic copy_log_files Ar path/to/logfile1 Ar path/to/logfile2 Ar ...
321Copy specific log files from the workdir to the main macports log dir
323.Sy Type:
324.Em optional
326.Sy Example:
327.Dl copy_log_files config.log
328.It Ic conflicts
329Used to list ports which conflict with the one containing the
330.Cm conflicts
333.Sy Type:
334.Em optional
336.Sy Default:
337.Em none (empty)
339.Sy Example:
340.Dl conflicts cdrtools
341.It Ic replaced_by
342When a particular port is deprecated in favor of another, use
343.Cm replaced_by
344in the deprecated port and list the new one to be used.
346.Sy Type:
347.Em optional
349.Sy Default:
350.Em none (empty)
352.Sy Example:
353.Dl replaced_by xorg-renderproto
356A number of hooks are available for customizing many of the standard
357targets that
358.Xr port 1
359executes. The targets supporting these hooks are
360.Cm fetch ,
361.Cm automake ,
362.Cm autoconf ,
363.Cm configure ,
364.Cm build ,
365.Cm destroot ,
367.Cm test .
368The hooks are:
369.Bl -tag -width lc
370.It Va target Ns Ic .asroot
371Run the
372.Va target
373with root privileges.
375.Sy Example:
376.Dl install.asroot yes
377.It Va target Ns Ic .dir
378Directory in which to run the
379.Va target .
381.Sy Example:
382.Dl automake.dir src
383.It Va target Ns Ic .env
384Change the environment the
385.Va target
386is run in. This is often overridden on a per
390.Sy Example:
391.Dl configure.env CPP=/usr/bin/cpp-4.0
392.It Va target Ns Ic .pre_args
393Additional arguments passed before the main arguments.
395.Sy Example:
396.Dl extract.pre_args -cd
397.It Va target Ns Ic .args
398Main arguments to pass to the
399.Va target .
400This is often overridden on a per
404.Sy Example:
405.Dl configure.args --enable-fooble
406.It Va target Ns Ic .post_args
407Additional arguments passed after the main arguments.
409.Sy Example:
410.Dl extract.post_args | tar xf -
413Read-only access to the MacPorts configuration is provided.
414.Bl -tag -width lc
415.It Ic prefix
416Install prefix
418.Sy Type:
419.Em optional
421.Sy Default:
422.Em /opt/local
423.It Ic libpath
424Location of ports-specific TCL libraries.
426.Sy Type:
427.Em read-only
428.It Ic portpath
429Full path to the Portfile location.
431.Sy Type:
432.Em read-only
434.Sy Default:
435.Em work
436.It Ic workpath
437Full path to work directory.
439.Sy Type:
440.Em read-only
442.Sy Default:
443.Em ${portbuildpath}/work
444.It Ic worksrcpath
445Full path to working sources (where port has unpacked itself).
447.Sy Type:
448.Em read-only
450.Sy Default:
451.Em ${workpath}/${worksrcdir}
452.It Ic filesdir
453Path to port files relative to
454.Ic portpath .
456.Sy Type:
457.Em read-only
459.Sy Default:
460.Em files
461.It Ic filespath
462Full path to the port files location.
464.Sy Type:
465.Em read-only
467.Sy Default:
468.Em ${portpath}/${filesdir}
469.It Ic distpath
470Location to store downloaded distfiles.
472.Sy Type:
473.Em read-only
475.Sy Default:
476.Em ${sysportpath}/distfiles/${dist_subdir}/
477.It Ic os.arch
478Identifies hardware type (e.g. "powerpc").
480.Sy Type:
481.Em read-only
482.It Ic os.version
483Version number of operating system (e.g. "7.0").
485.Sy Type:
486.Em read-only
487.It Ic os.endian
488Endianness of the processor (e.g. "bigEndian").
490.Sy Type:
491.Em read-only
492.It Ic os.platform
493Operating system name (e.g. "darwin").
495.Sy Type:
496.Em read-only
497.It Ic install.user
498User for MacPorts installation (e.g.
499.Pa root )
501.Sy Type:
502.Em read-only
503.It Ic
504Group for MacPorts installation (e.g.
505.Pa wheel )
507.Sy Type:
508.Em read-only
509.It Ic applications_dir
510Absolute path to the final location to install Mac OS X application
511bundles (.app directories).
513.Sy Type:
514.Em read-only
516.Sy Default:
517.Em /Applications/Macports
518.It Ic frameworks_dir
519Absolute path to the final location to install Mac OS X framework
520bundles (.framework directories).
522.Sy Type:
523.Em read-only
525.Sy Default:
526.Em ${prefix}/Library/Frameworks
529Port dependencies should refer to other MacPort ports
530whenever possible, therefore each dependency should be
531expressed in the format:
532.Bl -tag -width ls
533.It port: Ns Ao port Ac
537.Ao port Ac represents the name of an existing MacPorts
538.Nm port .
539If satisfying a dependency with a MacPorts port is not
540practical and it is likely that a dependency must be met
541by an Apple optional install, then the alternative dependency
543.Bl -tag -width lc
544.It Ar type Ns : Ns Ao filename Ac Ns : Ns Ao port Ac
547may be used. Where
548.Ar type
549is "bin" if
550.Ao filename Ac
551is a program, "lib" if it is a library, or "path" if it is a path to an
552installed file.
554.Sy Example:
555.Dl lib:libX11.6:XFree86
556.Bl -tag -width lc
557.It Ic depends_build
558List of dependencies to check before
559.Cm configure ,
560.Cm build ,
561.Cm destroot ,
562.Cm install ,
564.Cm package
567.Sy Type:
568.Em optional
570.Sy Example:
571.Dl depends_build port:autoconf
572.It Ic depends_run
573List of dependencies to check before
574.Cm destroot ,
575.Cm install
577.Cm package
580.Sy Type:
581.Em optional
583.Sy Example:
584.Dl depends_run port:bash
585.It Ic depends_lib
586List of dependencies to check before
587.Cm configure ,
588.Cm build ,
589.Cm destroot ,
590.Cm install ,
592.Cm package
595.Sy Type:
596.Em optional
598.Sy Example:
599.Dl depends_lib port:libfetch
602Fetch all distribution files and patches.
603.Bl -tag -width lc
604.It Ic master_sites.mirror_subdir
605Subdirectory to append to all mirror sites for any list specified in
608.Sy Type:
609.Em optional
611.Sy Default:
612.Em ${name}
614.Sy Example:
615.Dl master_sites.mirror_subdir      magic
616.It Ic patch_sites
617List of sites to fetch
618.Ic patchfiles
619from or a predefined mirror site list.
621.Sy Type:
622.Em optional
624.Sy Default:
625.Em ${master_sites}
627.Sy Example:
628.Dl patch_sites
629.It Ic patch_sites.mirror_subdir
630Subdirectory to append to all mirror sites for any list specified in
631.Ic patch_sites .
633.Sy Type:
634.Em optional
636.Sy Default:
637.Em ${name}
639.Sy Example:
640.Dl patch_sites.mirror_subdir       magic
641.It Ic extract.suffix
642Suffix to append to
643.Ic distname .
645.Sy Type:
646.Em optional
648.Sy Default:
649.Em .tar.gz
651.Sy Example:
652.Dl extract.suffix .tgz
653.It Ic distfiles
654List of distribution files to fetch from
655.Ic master_sites .
657.Sy Type:
658.Em optional
660.Sy Default:
661.Em [suffix ${distname}]
663.Sy Example:
664.Dl distfiles magicsource.tar.gz cluebat.tar.bz2
665.It Ic patchfiles
666List of patches to fetch and apply.
668.Sy Type:
669.Em optional
671.Sy Example:
672.Dl patchfiles japanese-widechar-fix.diff japanese-localization.diff
673.It Ic use_zip
674Use zip.
676Sets extract.suffix to: .zip
678Sets extract.cmd to: unzip
680Sets extract.pre_args to: -q
682Sets extract.post_args to: "-d ${workpath}"
684.Sy Type:
685.Em optional
687.Sy Example:
688.Dl use_zip yes
689.It Ic use_bzip2
690Use bzip2.
692Sets extract.suffix to: .bz2
694Sets extract.cmd to: bzip2
696.Sy Type:
697.Em optional
699.Sy Example:
700.Dl use_bzip2 yes
701.It Ic use_lzma
702Use lzma.
704Sets extract.suffix to: .lzma
706Sets extract.cmd to: lzma
708.Sy Type:
709.Em optional
711.Sy Example:
712.Dl use_lzma yes
713.It Ic use_xz
714Use xz.
716Sets extract.suffix to: .xz
718Sets extract.cmd to: xz
720.Sy Type:
721.Em optional
723.Sy Example:
724.Dl use_xz yes
725.It Ic use_7z
726Use 7z (7zip).
728Sets extract.suffix to: .7z
730Sets extract.cmd to: 7za
732.Sy Type:
733.Em optional
735.Sy Example:
736.Dl use_7z yes
737.It Ic dist_subdir
738Create a sub-directory in
739.Ic distpath
740to store all fetched files.
742.Sy Type:
743.Em optional
745.Sy Default:
746.Em ${name}
748.Sy Example:
749.Dl dist_subdir vim${version}
752Some mirrors require special options for a resource to be properly
754.Bl -tag -width lc
755.It Ic fetch.user
756HTTP or FTP user to fetch the resource.
758.Sy Type:
759.Em optional
760.It Ic fetch.password
761HTTP or FTP password to fetch the resource.
763.Sy Type:
764.Em optional
765.It Ic fetch.use_epsv
766Whether to use EPSV command for FTP transfers.
768.Sy Type:
769.Em optional
771.Sy Default:
772.Em yes
774.It Ic fetch.ignore_sslcert
775Whether to ignore the host SSL certificate (for HTTPS).
777.Sy Type:
778.Em optional
780.Sy Default:
781.Em no
785As an alternative to fetching distribution files, pulling the sources
786from a CVS repository is supported. Use of CVS can give rise to
787non-reproducible builds, so it is strongly discouraged.
788.Bl -tag -width lc
789.It Ic cvs.root
790Specify the address to a CVS repository from which to checkout files.
792.Sy Type:
793.Em optional
795.Sy Default:
796.Em none
798.Sy Example:
799.Dl cvs.root
800.It Ic cvs.tag
801Specify a CVS tag identifying the code to checkout.
803.Sy Type:
804.Em optional
806.Sy Default
807.Em none
809.Sy Example:
810.Dl cvs.tag HEAD
811.It Ic
812A date that identifies the CVS code set to checkout.
814.Sy Type:
815.Em optional
817.Sy Default
818.Em none
820.Sy Example:
821.Dl \*q12-April-2005\*q
822.It Ic cvs.module
823A CVS module from which to check out the code.
825.Sy Type:
826.Em optional
828.Sy Default
829.Em none
831.Sy Example:
832.Dl cvs.module Sources
835As an alternative to fetching distribution files, pulling the sources
836from a subversion repository is supported. Use of subversion can give
837rise to non-reproducible builds, so it is strongly discouraged.
838.Bl -tag -width lc
839.It Ic svn.url
840Specify the url from which to fetch files.
842.Sy Type:
843.Em required
845.Sy Default:
846.Em none
848.Sy Example:
849.Dl svn.url
850      svn.url svn://
851.It Ic svn.tag
852Specify a tag from which svn should fetch files. This
853corresponds to the -r option to the svn cli.  Note that you
854will need to use backslashes to escape characters that have
855meaning to the Tcl interpreter, such as braces and double
858.Sy Type:
859.Em optional
861.Sy Default:
862.Em none
864.Sy Example:
865.Dl svn.tag 37192
866      svn.tag \\{\\"2006-02-17 15:30 +0230\\"\\}
869As an alternative to fetching distribution files, pulling the sources
870from a git repository is supported. Use of git can give rise to
871non-reproducible builds, so it is strongly discouraged.
872.Bl -tag -width lc
873.It Ic git.url
874Specify the url from which to fetch files
876.Sy Type:
877.Em required
879.Sy Default:
880.Em none
882.Sy Example:
883.Dl git.url git://
884      git.url
885.It Ic git.branch
886Specify a branch (or other commit-ish) that git should checkout.
887Note that any branch besides HEAD should be prefixed by origin/.
889.Sy Type:
890.Em optional
892.Sy Default:
893.Em none
895.Sy Example:
896.Dl git.branch 72bf1c8
897      git.branch origin/next
900Extract all compressed/archived files.
901.Bl -tag -width lc
902.It Ic extract.only
903List of files to extract into
904.Ic workpath .
906.Sy Type:
907.Em optional
909.Sy Default:
910.Em ${distfiles}
912.Sy Example:
913.Dl extract.only worksrc-1.4.4.tar.gz
914.It Ic extract.cmd
915Command to perform the extraction.
917.Sy Type:
918.Em optional
920.Sy Default:
921.Em gzip
923.Sy Example:
924.Dl extract.cmd bzip2
925.It Ic extract.mkdir
926Create the
927.Ic worksrcdir
928prior to extraction; useful for ports which extract directly into the current
929working directory instead of a subdirectory.
931.Sy Type:
932.Em optional
934.Sy Default:
935.Em no
937.Sy Example:
938.Dl extract.mkdir yes
941MacPorts provide special support for configure flags (CFLAGS, LDFLAGS, CPPFLAGS, CXXFLAGS, CC, CXX, CPP, FC, F77, F90). Please note that the previous way to alter these flags (using configure.env) may become deprecated at some point. The following options are defined:
942.Bl -tag -width lc
943.It Ic configure.optflags
944Flags to use for optimization.
946.Sy Type:
947.Em optional
949.Sy Default:
950.Em -O2
952.Sy Example:
953.Dl configure.optflags -O3
954.It Ic configure.cflags
955Flags to put in the CFLAGS environment variable when invoking the configure script.
957.Sy Type:
958.Em optional
960.Sy Default:
961.Em ${configure.optflags}
963.Sy Example:
964.Dl configure.cflags-append -DHAS_LRINTF
965.It Ic configure.cppflags
966Flags to put in the CPPFLAGS environment variable when invoking the configure script.
968.Sy Type:
969.Em optional
971.Sy Default:
972.Em -I${prefix}/include
973.It Ic configure.cxxflags
974Flags to put in the CXXFLAGS environment variable when invoking the configure script.
976.Sy Type:
977.Em optional
979.Sy Default:
980.Em ${configure.optflags}
981.It Ic configure.objcflags
982Flags to put in the OBJCFLAGS environment variable when invoking the configure script.
984.Sy Type:
985.Em optional
987.Sy Default:
988.Em ${configure.optflags}
989.It Ic configure.ldflags
990Flags to put in the LDFLAGS environment variable when invoking the configure script.
992.Sy Type:
993.Em optional
995.Sy Default:
996.Em -L${prefix}/lib
997.It Ic configure.fflags
998Flags to put in the FFLAGS environment variable when invoking the configure script.
1000.Sy Type:
1001.Em optional
1003.Sy Default:
1004.Em ${configure.optflags}
1005.It Ic configure.f90flags
1006Flags to put in the F90FLAGS environment variable when invoking the configure script.
1008.Sy Type:
1009.Em optional
1011.Sy Default:
1012.Em ${configure.optflags}
1013.It Ic configure.fcflags
1014Flags to put in the FCFLAGS environment variable when invoking the configure script.
1016.Sy Type:
1017.Em optional
1019.Sy Default:
1020.Em ${configure.optflags}
1021.It Ic configure.classpath
1022Flags to put in the CLASSPATH environment variable when invoking the configure script.
1024.Sy Type:
1025.Em optional
1026.It Ic
1027C-compiler to put in the CC environment variable when invoking the configure script.
1029.Sy Type:
1030.Em optional
1032.Sy Example:
1033.Dl /usr/bin/gcc
1034.It Ic configure.cpp
1035C-preprocessor to put in the CPP environment variable when invoking the configure script.
1037.Sy Type:
1038.Em optional
1039.It Ic configure.cxx
1040C++-compiler to put in the CXX environment variable when invoking the configure script.
1042.Sy Type:
1043.Em optional
1044.It Ic configure.objc
1045Objective-C-compiler to put in the OBJC environment variable when invoking the configure script.
1047.Sy Type:
1048.Em optional
1050.Sy Example:
1051.Dl configure.objc ${prefix}/bin/gcc-mp-4.1
1052.It Ic configure.fc
1053Fortran-compiler to put in the FC environment variable when invoking the configure script.
1055.Sy Type:
1056.Em optional
1057.It Ic configure.f77
1058Fortran-77-compiler to put in the F77 environment variable when invoking the configure script.
1060.Sy Type:
1061.Em optional
1062.It Ic configure.f90
1063Fortran-90-compiler to put in the F90 environment variable when invoking the configure script.
1065.Sy Type:
1066.Em optional
1067.It Ic configure.javac
1068Java compiler to put in the JAVAC environment variable when invoking the configure script.
1070.Sy Type:
1071.Em optional
1072.It Ic configure.compiler
1073Selects a complete compiler suite to use. This option will override the compiler environment variable for all compilers the named suite features. Please note that this option will intentionally not set any dependencies on the selected compiler suite!
1074.Em gcc-3.3
1075.Em gcc-4.0
1076use the standard system compiler suites,
1077.Em apple-gcc-3.3
1078.Em apple-gcc-4.0
1079use Apple's gcc suite installed via MacPorts,
1080.Em macports-gcc-3.3
1081.Em macports-gcc-3.4
1082.Em macports-gcc-4.0
1083.Em macports-gcc-4.1
1084.Em macports-gcc-4.2
1085.Em macports-gcc-4.3
1086use the vanilla gcc installed via MacPorts.
1088.Sy Type:
1089.Em optional
1091.Sy Values:
1092.Em gcc-3.3 gcc-4.0 apple-gcc-3.3 apple-gcc-4.0 macports-gcc-3.3 macports-gcc-3.4 macports-gcc-4.0 macports-gcc-4.1 macports-gcc-4.2 macports-gcc-4.3
1094.Sy Example:
1095.Dl configure.compiler gcc-4.0
1096.\" FOOBAR
1099For universal builds of configure-based ports, we also define specific target hooks. These can be overridden for specific ports. Please note that these hooks are used by the default universal variant and redefining the variant will make them useless.
1100.Bl -tag -width lc
1101.It Ic configure.universal_args
1102Arguments appended to the configure script to build the port universal.
1104.Sy Type:
1105.Em optional
1107.Sy Default:
1108.Em --disable-dependency-tracking
1109.It Ic configure.universal_cflags
1110Additional flags to put in the CFLAGS environment variable when invoking the configure script.
1112.Sy Type:
1113.Em optional
1115.Sy Default:
1116.Em -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc
1117.It Ic configure.universal_cppflags
1118Additional flags to put in the CPPFLAGS environment variable when invoking the configure script.
1120.Sy Type:
1121.Em optional
1122.It Ic configure.universal_cxxflags
1123Additional flags to put in the CXXFLAGS environment variable when invoking the configure script.
1125.Sy Type:
1126.Em optional
1128.Sy Default:
1129.Em -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc
1130.It Ic configure.universal_ldflags
1131Additional flags to put in the LDFLAGS environment variable when invoking the configure script.
1133.Sy Type:
1134.Em optional
1136.Sy Default:
1137.Em -arch i386 -arch ppc
1140Execute necessary build commands.
1141.Bl -tag -width lc
1142.It Ic build.cmd
1143Make command to run relative to
1144.Ic worksrcdir .
1146.Sy Type:
1147.Em optional
1149.Sy Default:
1150.Em make
1152.Sy Example:
1153.Dl build.cmd pbxbuild
1154.It Ic build.type
1155Defines which 'make' is required, either 'gnu' or 'bsd'.
1157.Ic build.cmd
1158to either
1159.Pa gnumake
1161.Pa bsdmake
1164.Sy Type:
1165.Em optional
1167.Sy Default:
1168.Em gnu
1170.Sy Example:
1171.Dl build.type bsd
1172.It Ic
1173Target passed to
1174.Ic build.cmd .
1176.Sy Type:
1177.Em optional
1179.Sy Default:
1180.Em all
1182.Sy Example:
1183.Dl all-src
1186Execute necessary commands to install into a temporary destination root
1187("destroot") staging area.
1188.Bl -tag -width lc
1189.It Ic destroot.cmd
1190Install command to run relative to
1191.Ic worksrcdir .
1193.Sy Type:
1194.Em optional
1196.Sy Default:
1197.Em ${build.cmd}
1199.Sy Example:
1200.Dl destroot.cmd pbxbuild
1201.It Ic destroot.type
1202Defines which 'make' is required, either 'gnu' or 'bsd'.
1204.Ic destroot.cmd
1205to either
1206.Pa gnumake
1208.Pa bsdmake
1211.Sy Type:
1212.Em optional
1214.Sy Default:
1215.Em ${build.type}
1217.Sy Example:
1218.Dl destroot.type gnu
1219.It Ic destroot.destdir
1220Arguments passed to
1221.Ic destroot.cmd
1222in order to install correctly
1223into the destroot.
1225.Sy Type:
1226.Em optional
1228.Sy Default:
1229.Em DESTDIR=${destroot}
1231.Sy Example:
1232.Dl destroot.destdir prefix=${destroot}${prefix}
1233.It Ic
1234Install target to pass to
1235.Ic destroot.cmd .
1237.Sy Type:
1238.Em optional
1240.Sy Default:
1241.Em install
1243.Sy Example:
1244.Dl install-src
1245.It Ic destroot.umask
1246Umask to use during destroot.
1248.Sy Type:
1249.Em optional
1251.Sy Default:
1252.Em 022
1254.Sy Example:
1255.Dl destroot.umask 002
1256.It Ic destroot.keepdirs
1257List of directories that should not be pruned if empty upon
1258.Cm destroot
1261.Sy Type:
1262.Em optional
1264.Sy Example:
1265.Dl destroot.keepdirs ${destroot}${prefix}/var/log/mysql
1266.It Ic destroot.violate_mtree
1267Indicates if a port will violate the common directory structure. Enables or disables tests for violations of mtree (e. g. non-standard directories in ${prefix}). The standard mtree can be found in
1268.Xr porthier 7 .
1270.Sy Type:
1271.Em optional
1273.Sy Values:
1274.Em yes no
1276.Sy Default:
1277.Em no
1280Execute commands to run test suites bundled with a port.
1281.Bl -tag -width lc
1282.It Ic
1283Enable running test suites bundled with a port.
1285.Sy Type:
1286.Em optional
1288.Sy Example:
1289.Dl     yes
1290.It Ic test.cmd
1291Test command to run relative to
1292.Ic worksrcdir .
1294.Sy Type:
1295.Em optional
1297.Sy Default:
1298.Em ${build.cmd}
1300.Sy Example:
1301.Dl test.cmd
1302.It Ic
1303Test target to pass to
1304.Ic test.cmd .
1306.Sy Type:
1307.Em optional
1309.Sy Default:
1310.Em test
1312.Sy Example:
1313.Dl checks
1316If a port needs to run on system startup, it can use MacPorts
1317startupitem keywords to install native OS X startup scripts.
1318Startup scripts require user interaction after port installation
1319to activate them and instructions are given during port installs.
1320.Bl -tag -width lc
1321.It Ic startupitem.create
1322Choose whether or not to generate a startup item.
1324.Sy Type:
1325.Em optional
1327.Sy Default:
1328.Em no
1330.Sy Values:
1331.Em yes no
1333.Sy Example:
1334.Dl startupitem.create yes
1335.It Ic startupitem.type
1336Select the type of startupitem to generate. By default, a startupitem
1337will be generated that is of the appropriate type for the OS. For
1338instance, launchd is used on system 10.4, while SystemStarter is used
1339on prior Mac OS X systems. A global default may be specified with the startupitem_type preference in ports.conf.
1341.Sy Type:
1342.Em optional
1344.Sy Default:
1345.Em default
1347.Sy Values:
1348.Em SystemStarter launchd default rcNG
1350.Sy Example
1351.Dl startupitem.type launchd
1352.It Ic
1353Displayed name of the startup item.
1355.Sy Type:
1356.Em required
1358.Sy Example:
1359.Dl OpenSSH
1360.It Ic startupitem.executable
1361The name of the daemon to be run in the background. This is
1362the preferred type of startup item rather than any of
1363startupitem.init, startupitem.start, startupitem.stop, or
1364startupitem.restart, and may not be used together with any
1365of these options.  This option may contain multiple
1366arguments, but they must be appropriate for a call to exec; they
1367may not contain arbitrary shell code.
1369.Sy Type:
1370.Em optional
1372.Sy Values:
1373.Em /path/to/executable <args>
1375.Sy Example:
1376.Dl startupitem.executable ${prefix}/bin/wonka
1377.It Ic startupitem.init
1378Shell code that will be executed prior to any of the options
1379startupitem.start, startupitem.stop and startupitem.restart.
1381.Sy Type:
1382.Em optional
1384.Sy Values:
1385.Em sh code
1387.Sy Example:
1388.Dl startupitem.init FOO=start
1389.It Ic startupitem.start
1390Shell code executed to start the daemon.
1392.Sy Type:
1393.Em optional
1395.Sy Values:
1396.Em sh code
1398.Sy Example:
1399.Dl startupitem.start ${prefix}/share/mysql/mysql.server start
1400.It Ic startupitem.stop
1401Shell code executed to stop the daemon.
1403.Sy Type:
1404.Em optional
1406.Sy Values:
1407.Em sh code
1409.Sy Example:
1410.Dl startupitem.stop ${prefix}/share/mysql/mysql.server stop
1411.It Ic startupitem.restart
1412Shell code executed to restart the daemon. In the absence
1413of this key, the daemon will be restarted by taking the
1414stop action, followed by taking the start action.
1416.Sy Type:
1417.Em optional
1419.Sy Values:
1420.Em sh code
1422.Sy Example:
1423.Dl startupitem.restart ${prefix}/share/mysql/mysql.server restart
1424.It Ic startupitem.pidfile
1425Specification for pidfile handling. This is particularly useful
1426in conjunction with the startupitem.executable key, because it is
1427important that the startupitem know how to track the executable.
1428This specifies whether the daemon generates its own pidfile (auto),
1429whether it generates its own but forgets to delete it, so that the
1430startupitem should delete it (clean), or whether it never generates
1431one, in which case the startupitem should manage the pidfile on its
1432own (manual), or whether no pidfile should be used at all (none).
1434.Sy Type:
1435.Em optional
1437.Sy Default:
1438.Em none "${prefix}/var/run/${name}.pid"
1440.Sy Values:
1441.Em none|auto|manual|clean [/path/to/pidfile]
1443.Sy Example:
1444.Dl startupitem.pidfile auto ${prefix}/var/run/${name}.pidfile
1445.It Ic startupitem.logfile
1446Path to a logfile for logging events about the lifetime of the
1447startupitem. Depending on the type of startupitem, and the manner
1448in which it is started, standard output from the daemon may also be
1449directed to the logfile.
1451.Sy Type:
1452.Em optional
1454.Sy Default:
1455.Em /dev/null
1457.Sy Values:
1458.Em path
1460.Sy Example:
1461.Dl startupitem.logfile ${prefix}/var/log/mydaemon.log
1462.It Ic startupitem.logevents
1463Control whether or not to log events to the log file. If logevents
1464is set, events with timestamps are logged to the logfile.
1466.Sy Type:
1467.Em optional
1469.Sy Default:
1470.Em no
1472.Sy Values:
1473.Em yes|no
1475.Sy Example:
1476.Dl startupitem.logevents yes
1477.It Ic startupitem.netchange
1478Control whether the startupitem should be restarted when a change in the
1479machine's network state is detected.
1481.Sy Type:
1482.Em optional
1484.Sy Default:
1485.Em no
1487.Sy Values:
1488.Em yes|no
1490.Sy Example:
1491.Dl startupitem.netchange yes
1494MacPorts can automatically check if the software has been updated
1495since the Portfile was modified and if some external changes require
1496an update to the Portfile. This helps maintainers have up-to-date
1497and working Portfiles.
1499Two checks are available. With distcheck, MacPorts can check that the
1500distfile(s) are still downloadable and did not change since the portfile
1501was modified.
1502With livecheck, MacPorts can query a resource to determine if a newer
1503version of the software is available.
1504.Bl -tag -width lc
1505.It Ic distcheck.check
1506This option can be used to disable distcheck. It specifies what kind
1507of check should be performed on distfiles:
1508.Em moddate
1509(check if the Portfile is older than the distfile) or
1510.Em none
1511(no check).
1513.Sy Type:
1514.Em optional
1516.Sy Default:
1517.Em moddate
1519.Sy Values:
1520.Em moddate none
1521.It Ic livecheck.check
1522What kind of check to perform to figure out if the software has been updated.
1523Can be
1524.Em freshmeat
1525(uses the date_updated tag of the freshmeat XML file),
1526.Em sourceforge
1527(uses the version of the latest file release of the project),
1528.Em googlecode
1529(uses the version of the latest file release of the project),
1530.Em moddate
1531(uses the modification date of some URL resource),
1532.Em regex
1533(retrieve the version by applying a regex to some URL resource),
1534.Em regexm
1535(retrieve the version by applying a multi-line regex to some URL resource),
1536.Em md5
1537(compares the md5 sum of some URL resource) or
1538.Em none
1539(no check).
1541.Sy Type:
1542.Em optional
1544.Sy Default:
1545.Em sourceforge
1547.Em googlecode
1548if the master_sites is one of these, else
1549.Em freshmeat
1551.Sy Values:
1552.Em freshmeat sourceforge googlecode moddate regex regexm md5 none
1553.It Ic
1554Name of the project for live checks (used for freshmeat, sourceforge, and googlecode checks).
1556.Sy Type:
1557.Em optional
1559.Sy Default:
1560.Em ${name}
1561or the sourceforge/freshmeat/googlecode project name if it can be guessed by looking at the master_sites.
1562.It Ic livecheck.distname
1563Name of the file release (used for sourceforge and googlecode checks).
1564For sourceforge releases use the name of the package release.
1565For googlecode releases use the name of the file download, including extension.
1566Replace the version part of the name with "(.*)".
1568.Sy Type:
1569.Em optional
1571.Sy Default:
1572.Em ${}
1573for sourceforge projects or the first entry in
1574.Em ${distfiles}
1575for googlecode projects
1576.It Ic livecheck.version
1577Version of the project for live checks (used for regex-based checks).
1579.Sy Type:
1580.Em optional
1582.Sy Default:
1583.Em ${version}
1584.It Ic livecheck.url
1585URL to query for the check.
1587.Sy Type:
1588.Em optional
1590.Sy Default:
1591.Em ${homepage}
1598.It Ic livecheck.regex
1599Regular expression to parse the resource for regex checks.
1600Be sure to use a regular expression grouping around the version component.
1602.Sy Type:
1603.Em optional
1604.It Ic livecheck.md5
1605md5 sum to use for md5 comparison.
1607.Sy Type:
1608.Em optional
1611MacPorts allows for conditional modification to be specified in a
1612.Nm ,
1613allowing for user-customization of a software's build-time settings.
1614.Bl -tag -width lc
1615.It Xo
1616.Ic variant
1617.Op Cm requires Ar variant
1618.Op Cm conflicts Ar variant
1619.Op Cm description Ar "description"
1621The value is usually a TCL script which modifies other port's
1623variables. Dependencies and conflicts with other variants in the same
1624port can be expressed with
1625.Cm requires
1627.Cm conflicts .
1628.Cm description
1629provides a means to supply a description of the variant for the user.
1631.Sy Type:
1632.Em optional
1634.Sy Example:
1635Add a "gnome" variant to a port.
1636.Bd -literal -offset indent -compact
1637variant gnome requires glib { configure.args-append --with-gnome \e\
1639    depends_lib-append lib:gnome-session:gnome-session }
1641.It Ic default_variants
1642If variants are defined, then the
1643.Ic default_variants
1644value lists which variants are enabled by default.
1646.Sy Type:
1647.Em optional
1649.Sy Example:
1650.Dl default_variants +ssl +tcpd
1651.It Ic universal_variant
1652When using MacPorts on Mac OS X, a universal variant is defined and
1653the default behavior is to configure ports with universal flags
1654(see the
1656section above). The variant can be
1657overridden if the default code does not work. It can also be
1658suppressed if having a universal variant for the port does not make
1659sense. To suppress it, use the
1660.Ic universal_variant
1663.Sy Type:
1664.Em optional
1666.Sy Default:
1667.Em yes
1669.Sy Example:
1670.Dl universal_variant no
1673MacPorts allows for platform-specific conditional modification to be
1674specified in a
1675.Nm ,
1676much like variants, for handling differences between platforms and
1677versions of the same platform.
1678.Bl -tag -width lc
1679.It Xo
1680.Ic platform
1681.Ar platform
1682.Op Ar version
1683.Op Ar arch
1685The platform key is used to begin the darwin platform definitions as
1686shown in the examples from the databases/db4 and devel/libidl1
1687.Nm Portfiles
1690.Sy Type:
1691.Em optional
1693.Sy Example:
1694.Bd -literal -offset indent -compact
1695platform darwin 6 { configure.args-append   --enable-tcl \e\
1697        --with-tcl=/System/Library/Tcl/8.3 }
1700.Sy Example:
1701.Bd -literal -offset indent -compact
1702platform darwin powerpc { configure.args-append \e\
1704        --host=${os.arch}-apple-rhapsody${os.version} }
1705platform darwin i386 { configure.args-append \e\
1707        --host=i386-gnu-rhapsody${os.version} }
1711To factorize the work with similar ports, MacPorts provides the notion of
1712.Nm PortGroup
1713that can be used to load definitions for a given class or group of ports. See
1714.Xr portgroup 7
1715for more details on the various PortGroup classes.
1717A number of TCL extensions are available for use in
1718.Nm Portfiles .
1720.Bl -tag -width lc
1721.Bl -tag -width lc -compact
1722.It Xo
1723.Ic xinstall
1724.Op Fl c
1725.Op Fl B Ar suffix
1726.Op Fl b
1727.Op Fl C
1728.Op Fl f Ar flags
1729.Op Fl g Ar group
1730.Op Fl M
1731.Op Fl m Ar mode
1732.Op Fl o Ar owner
1733.Op Fl p
1734.Op Fl S
1735.Op Fl s
1736.Op Fl W Ar dir
1737.Op Ar
1738.Ar destination
1740.It Xo
1741.Ic xinstall
1742.Fl d
1743.Op Fl B Ar suffix
1744.Op Fl b
1745.Op Fl C
1746.Op Fl f Ar flags
1747.Op Fl g Ar group
1748.Op Fl M
1749.Op Fl m Ar mode
1750.Op Fl o Ar owner
1751.Op Fl p
1752.Op Fl S
1753.Op Fl s
1754.Op Fl W Ar dir
1755.Ar directory
1757Install file(s) to a target file or directory. The options are
1758intended to be compatible with
1759.Xr install 1 :
1760.Bl -tag -width indent
1761.It Fl b
1762Backup any existing files with an
1763.Pa .old
1765.It Fl B
1766Specify a different backup suffix for the
1767.Fl b
1769.It Fl c
1770Install files (this is the default).
1771.It Fl C
1772Only copy a file if it is different.
1773.It Fl d
1774Create directories, including (if necessary) parent directories.
1775.It Fl f
1776Specify target flags, see
1777.Xr chflags 1
1778for details.
1779.It Fl g
1780Specify the group.
1781.It Fl M
1782Disable use of
1783.Xr mmap 2 .
1784.It Fl m
1785Specify an alternate mode. The default is 0755. See
1786.Xr chmod 1
1787for defails.
1788.It Fl p
1789Preserve the modification time.
1790.It Fl S
1791Copy safely, using a temporary file.
1792.It Fl s
1793Strip binaries using
1794.Xr strip 1 .
1795.It Fl W
1796Change to
1797.Ar dir
1798before working.
1801.It Xo
1802.Ic fs-traverse
1803.Op Fl depth
1804.Op Fl ignoreErrors
1805.Ar varname
1806.Ar target-list
1807.Ar body
1809Traverse the filesystem hierarchy rooted in each element of
1810.Ar target-list
1811and execute
1812.Ar body
1813for each found file/directory.
1814.Va varname
1815is set to the path of the file/directory. If
1816.Ic break
1817is called during execution, the filesystem traversal is stopped. If
1818.Ic continue
1819is called during execution, the current file and any children are skipped
1820and traversal continues with the next file/directory.
1821.Bl -tag -width indent
1822.It Fl depth
1823Equivalent to the
1824.Fl d
1825switch to
1826.Xr find 1 .
1827Please note that using
1828.Fl depth
1829means you cannot prune a directory with
1830.Ic continue
1831as it will be processed after its children.
1832.It Fl ignoreErrors
1834.Ic fs-traverse
1835to ignore any permissions/read errors encountered during processing.
1839.Nm fs-traverse
1840is called directly on a symbolic link, the link will be followed. All other
1841links encountered during traversal will not be followed.
1843.Nm fs-traverse
1844will not descend into directories that have a different device number than
1845the root of the descent.
1847If you remove the current directory during traversal, be aware that you must call
1848.Nm continue
1849to inform
1850.Nm fs-traverse
1851that the directory should not be descended into.
1852.It Xo
1853.Ic curl fetch
1854.Ar url
1855.Ar file
1857Fetch a resource at
1858.Ar url
1859and save it to
1860.Ar file .
1861.It Xo
1862.Ic curl isnewer
1863.Ar url
1864.Ar date
1866Determine if resource at
1867.Ar url
1868is newer than
1869.Ar date
1870(expressed in seconds since epoch).
1871.It Xo
1872.Ic adduser
1873.Ar username
1874.Op Cm uid Ns = Ns uid
1875.Op Cm gid Ns = Ns gid
1876.Op Cm passwd Ns = Ns passwd
1877.Op Cm realname Ns = Ns realname
1878.Op Cm home Ns = Ns home
1879.Op Cm shell Ns = Ns shell
1881Add a new local user to the system with the specified uid, gid,
1882password, real name, home directory and login shell.
1883.It Ic existsuser Ar username
1884Check if a local user exists.
1885.It Ic nextuid
1886Returns the highest used uid plus one.
1887.It Xo
1888.Ic addgroup
1889.Ar group
1890.Op Cm gid Ns = Ns gid
1891.Op Cm passwd Ns = Ns passwd
1892.Op Cm realname Ns = Ns realname
1893.Op Cm users Ns = Ns users
1895Add a new local group to the system, with the specified gid, password,
1896real name, and with a list users as members.
1897.It Ic existsgroup Ar group
1898Check if a local group exists and return the corresponding gid. This can be used
1899with adduser:
1900.Dl addgroup foo
1901.Dl adduser foo gid=[existsgroup foo]
1902.It Ic nextgid
1903Returns the highest used gid plus one.
1904.It Xo
1905.Ic reinplace
1906.Op Fl E
1907.Ar regex
1910Provide in-place
1911.Xr sed 1
1912like editing of a file.
1913The -E flag does the same thing as in
1914.Xr sed 1
1916.Sy Example:
1917.Dl reinplace \*qs|/usr/local|${prefix}|g\*q doc/manpage.1
1918.It Ic file
1919Standard TCL command to manipulate file names and attributes, recommended if you wish to preserve Mac OS
1920resource forks when destrooting ports on Mac OS X 10.3.x and Mac OS X 10.4.x . Use
1921.Nm xinstall
1922to also preserve Extended Attributes (i.e. Access Control Lists). See
1923.Xr file n
1924for more information on this command.
1925.It Ic copy
1926Built-in shorthand alternative to "file copy".
1927.It Ic move
1928Built-in shorthand alternative to "file rename".
1929.It Ic delete Ar
1930Deletes each of the given files/directories. Behaves similarly to
1931.Ic file delete -force
1932except that
1933.Ic file delete -force
1934will fail to delete directories properly on 10.3 systems.
1935.It Ic touch
1936Built-in command mimicking the BSD touch command.
1937.It Ic ln
1939Built-in command mimicking the BSD ln command.
1940.It Ic system Ar commandline
1941Execute a program. See
1942.Xr system 3 .
1943For calls to
1944.Xr install 1
1945please use
1946.Nm xinstall .
1947For calls to
1948.Xr mv 1 ,
1949.Xr cp 1 ,
1950.Xr rm 1
1951or similar, please use the built-in commands or
1952.Nm file
1953if they don't meet your requirements.
1954.It Ic variant_isset Ar variant
1955Checks if the given
1956.Ar variant
1957is being built.
1958.It Ic variant_set Ar variant
1959Set the given
1960.Ar variant .
1961.It Va variable Ns - Ns Ic append Ar item
1963.Ar item
1964to the
1965.Va variable .
1967.Sy Example:
1968.Dl configure.args-append --with-gnomedb
1969.It Va variable Ns - Ns Ic delete Ar item
1971.Ar item
1972from the
1973.Va variable .
1975.Sy Example:
1976.Dl configure.args-delete --with-gnomedb
1977.It Ic readdir Ar directory
1978Return the list of elements in a
1979.Ar directory ,
1981.Pa \&.
1983.Pa \&.. .
1984.It Ic strsed Ar string Ar pattern
1986.Xr ed 1 Ns / Ns
1987.Xr tr 1 Ns -like
1988search, replace, and transliteration on a string.
1989.It Ic mktemp Ar template
1990Create a temporary file using a
1991.Ar template .
1993.Xr mktemp 3 .
1994.It Ic mkstemp Ar template
1995Create a temporary file securely using a
1996.Ar template .
1998.Xr mkstemp 3 .
1999.It Ic mkdtemp Ar template
2000Create a temporary directory using a
2001.Ar template .
2003.Xr mkdtemp 3 .
2004.It Ic md5 Ar
2005Compute the MD5 hashes of the file(s).
2006.It Ic rpm-vercomp Ar versionA Ar versionB
2007Compare two RPM-format versions for equality.  The return value is like
2008strcmp(), returning -1, 0, or 1 when versionA is earlier, equal to, or
2009later than versionB, respectively.  Note that some comparisions featuring
2010floating-point notation may compare incorrectly, e.g. 2.101 is considered
2011later than 2.2 (101 is larger than 2) which may be incorrect per some
2012projects versioning methods (see ticket #11873).
2013.It Xo
2014.Ic lpush
2015.Ar varName
2016.Op Ar value \&...
2018Treats the variable given by
2019.Ar varName
2020as a list and appends each of the
2021.Ar value
2022arguments to that list as a separate element. If
2023.Ar varName
2024doesn't exist, it is created as a list with elements
2025given by the
2026.Ar value
2028Really just an alias for
2029.Xr lappend n .
2030.It Ic lpop Ar varName
2031Removes the last element from the list given by
2032.Ar varName
2033and returns it. If there are no elements in the list,
2034the empty string is returned. If
2035.Ar varName
2036doesn't exist, an exception is raised.
2037.It Xo
2038.Ic lunshift
2039.Ar varName
2040.Op Ar value \&...
2042Treats the variable given by
2043.Ar varName
2044as a list and prepends each of the
2045.Ar value
2046arguments to that list as a separate element. If
2047.Ar varName
2048doesn't exist, it is created as a list with elements
2049given by the
2050.Ar value
2052.It Ic lshift Ar varName
2053Removes the first element from the list given by
2054.Ar varName
2055and returns it. If there are no elements in the list,
2056the empty string is returned. If
2057.Ar varName
2058doesn't exist, an exception is raised.
2059.It Xo
2060.Ic ldindex
2061.Ar varName
2062.Op Ar index \&...
2064Treats the variable given by
2065.Ar varName
2066as a list and removes the element pointed to by the sequence of
2067.Ar index
2068arguments and returns it. If no
2069.Ar index
2070arguments are provided,
2071.Ar varName
2072is set to the empty string and the entire former value is returned.
2073Has the same usage semantics as
2074.Xr lindex n .
2075.It Xo
2076.Ic try
2077.Ar body
2079.Nm catch Nm {
2080.Ar type-list
2081.Op Ar ecvar
2082.Op Ar msgvar
2083.Op Ar infovar
2084.Nm }
2085.Ar body Ar \&...
2087.Op Nm finally Ar body
2089Implements a try-catch-finally block as defined in TIP #89.
2091.Sy Example:
2092Basic try-finally construct.
2093.Bd -literal -offset indent -compact
2094try {
2095    set fd [open $file r]
2096    # do stuff here
2097} finally {
2098    close $fd
2101.Sy Example:
2102Basic try-catch construct
2103.Bd -literal -offset indent -compact
2104try {
2105    set result [expr $num / $div]
2106} catch {{ARITH DIVZERO}} {
2107    set result -1
2110.Sy Example:
2111Basic try with multiple catches construct
2112.Bd -literal -offset indent -compact
2113try {
2114    set fd [open $file r]
2115    # do stuff here
2116} catch {{POSIX ENOENT} {} msgvar} {
2117    puts stderr $msgvar
2118} catch {*} {
2119    puts stderr "An error occurred while processing the file"
2120    close $fd
2121    throw
2124.It Xo
2125.Ic throw
2126.Op Ar type
2127.Op Ar message
2128.Op Ar info
2130Throws an exception. If given arguments, works just like
2131.Ic error
2132.Ar message
2133.Ar info
2134.Ar type .
2135If called with no arguments from within a
2136.Ic catch
2137block, re-throws the caught exception.
2140.Bl -tag -width lc -compact
2141.It Ic ui_debug Ar message
2142.It Ic ui_error Ar message
2143.It Ic ui_info Ar message
2144.It Ic ui_msg Ar message
2145.It Ic ui_warn Ar message
2146Display a
2147.Ar message
2148to the user, at various different levels.
2150.Sy Example:
2151.Dl ui_msg \*qAdd each user to the system using the clamav command\*q
2153.Sh SEE ALSO
2154.Xr port 1 ,
2155.Xr macports.conf 5 ,
2156.Xr portgroup 7 ,
2157.Xr portstyle 7 ,
2158.Xr porthier 7 ,
2159.Xr file n
2161.An "Landon Fuller" Aq
2162.An "Juan Manuel Palacios" Aq
2163.An "Mark Duling" Aq
2164.An "Kevin Van Vechten" Aq
2165.An "Jordan K. Hubbard" Aq
2166.An "Chris Ridd" Aq
2167.An "Kevin Ballard" Aq
2168.An "Markus W. Weissmann" Aq
Note: See TracBrowser for help on using the repository browser.