source: branches/gsoc13-tests/doc/portfile.7 @ 139170

Last change on this file since 139170 was 103497, checked in by ryandesign@…, 8 years ago

Change default configure.optflags from -O2 to -Os (#38218)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 51.1 KB
1.\" portfile.7
3.\" Copyright (c) 2004-2013 The MacPorts Project
4.\" Copyright (c) 2002-2003 Apple Inc.
5.\" All rights reserved.
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. Neither the name of Apple Inc. nor the names of its
16.\"    contributors may be used to endorse or promote products derived from
17.\"    this software without specific prior written permission.
31.Dd February 13, 2007
32.Dt PORTFILE 7 "MacPorts"
33.Os Darwin
34.Sh NAME
35.Nm Portfile
36.Nd MacPorts description file reference
38A complete reference of all available
40variables and example syntax.
41.Nm Portfiles
42consist of valid TCL, allowing for simple key/value pair syntax as well
43as utilization of TCL's extensive functionality.
44.Nm Portfiles
45are encoded in UTF-8.
48\.Nm MacPorts System
49uses a target dependency system based on a
50depends/provides model, allowing for targets to be registered and
51executed in the correct order based on their individual requirements.
55author needs to be aware of the various standard targets, the options
56that they require and the variables that both the targets and the port
57system provide.
59Portfiles must begin with a PortSystem line that defines which version of the
60Portfile interpreter should be used.
62.Sy Synopsis:
63.Dl PortSystem 1.0
65All ports are required to set certain variables.
66.Bl -tag -width lc
67.It Ic name
68Full name of port.
70.Sy Type:
71.Em required
73.Sy Example:
74.Dl name XFree86
75.It Ic version
76Upstream version of software.
78.Sy Type:
79.Em required
81.Sy Example:
82.Dl version 4.2.1
83.It Ic epoch
84If a port's version numbering changes such that a newer version looks
85older than the previous version, the
86.Ic epoch
87should be increased. Some
88.Nm Portfile
89authors have used large
90.Ic epoch
91values that look like a date, but there is no reason to do so. The
92.Ic epoch
93is simply an unsigned integer, and the only requirement is that it never be
96.Sy Type:
97.Em optional
99.Sy Default:
100.Em 0
102.Sy Example:
103.Dl epoch 1
104.It Ic description
105One line description of the software and what it does.  To appear in the
106description, brackets and semi-colons need to be escaped with a backslash (i.e.
107they must be written as "\\[", "\\]" and "\\;").  The escape sequences listed in
108.Xr re_syntax n
109may also be used, with the exception of \\n, \\r and \\f.
111.Sy Type:
112.Em required
114.Sy Example:
115.Dl description Dictionary Server Protocol (RFC2229) client
116.It Ic long_description
117A verbose description of the software and what it does.  To appear in the
118description, brackets and semi-colons need to be escaped with a backslash (i.e.
119they must be written as "\\[", "\\]" and "\\;").  The escape sequences listed in
120.Xr re_syntax n
121may also be used, with the exception of \\n, \\r and \\f.
123.Sy Type:
124.Em required
126.Sy Example:
127.Bd -literal -offset indent -compact
128long_description The GNU Image Manipulation Program \e\
130    (GIMP) is a powerful tool for the preparation and \e\
132    manipulation of digital images. The GIMP provides \e\
134    the user with a wide variety of image manipulation, \e\
136    painting, processing, and rendering tools.
138.It Ic notes
139Notes for setup and use of the port.  This is shown after the port is
140activated and anytime the
141.Ic notes
142command is used; for example:
144.Dl "port notes python26"
146The advantage to using
147.Ic notes
148instead of
149.Ic ui_msg
150is that it can be queried after a port is installed but
151.Ic ui_msg
152is only printed during an install.  Therefore
153.Ic notes
154is good for any information which may be needed anytime after an install.
156.Sy Type:
157.Em optional
159.Sy Example:
160.Bd -literal -offset indent -compact
161notes To fully complete your installation and make python \e\
163   ${branch} the default, please run: \e\
165   sudo port install python_select \e\
167   sudo python_select ${name}
169.It Ic revision
170Local revision number of
171.Nm .
172Increment for port revisions which would change its installation in any way.
174.Sy Type:
175.Em optional
177.Sy Default:
178.Em 0
180.Sy Example:
181.Dl revision 1
182.It Ic categories
183Categories to which this port belongs.
185.Sy Type:
186.Em required
188.Sy Example:
189.Dl categories spelling textproc
190.It Ic maintainers
191E-mail address(es) of port maintainer(s).
193.Sy Type:
194.Em required
196.Sy Example:
197.Dl maintainers
198.It Ic platforms
199Declares which platforms are supported by the port.
201.Sy Type:
202.Em required
204.Sy Values:
205.Em darwin freebsd
207.Sy Example:
208.Dl platforms darwin
209.It Ic supported_archs
210The CPU architectures for which this port can be built. Archs currently
211supported by Mac OS X are: i386, ppc, ppc64, x86_64. If this option is not set,
212it is assumed that the port can build for all archs. If a port does not install
213any architecture-specific files, use the special value noarch.
215If the building architecture isn't among supported_archs, port fails with an
216error message except when building on x86_64 (or ppc64) and supported_archs
217contains i386 (or ppc). In this case, the port will be built in 32-bit mode.
219.Sy Type:
220.Em optional
222.Sy Values:
223.Em i386 x86_64 ppc ppc64 noarch
225.Sy Default:
226.Em i386 x86_64 ppc ppc64
228.Sy Examples:
229.Dl supported_archs i386 x86_64
230.Dl supported_archs noarch
231.It Ic homepage
232Project homepage for the port.
234.Sy Type:
235.Em required
237.Sy Example:
239.It Ic master_sites
240List of sites to fetch
241.Ic distfiles
242from or a predefined mirror site
243list. If set to a predefined mirror site, without a subdirectory being
244defined, the portname is used as the name of the subdirectory.
246.Sy Type:
247.Em required
249.Sy Example:
250.Bd -literal -offset indent -compact
251master_sites \e\
253    sourceforge
255.It Ic worksrcdir
256Path to source directory relative to
257.Ic workpath .
259.Sy Type:
260.Em optional
262.Sy Default:
263.Em ${distname}
265.Sy Example:
266.Dl worksrcdir ${distname}-src-${version}
267.It Ic distname
268Name of distribution file, without the
269.Cm extract.suffix .
271.Sy Type:
272.Em optional
274.Sy Default:
275.Em ${name}-${version}
277.Sy Example:
278.Dl distname ${name}-${version}-src
279.It Xo
280.Ic checksums Ar filename Ar type Ar checksum
281.Op Ar filename Ar type checksum ...
283List of checksums for the
284.Ic distfiles .
285The checksum
286.Ar type
287can currently be md5, sha1, rmd160 or sha256. The
288.Ar filename
289can be omitted if there is only one distfile.
291.Sy Type:
292.Em required
294.Sy Example:
295.Bd -literal -offset indent -compact
296checksums dictd-1.7.1.tar.gz md5 81317b86ea0a5df0163900ad2e6bb12c \e\
297        magic-words-1.7.1.tar.gz md5 897a005182928613eadd30c267ce9c5b
300.Sy Example (ledit 1.11):
301.Bd -literal -offset indent -compact
302checksums md5 a2d38ba641682509c1e964ad699a9dd2 \e\
303        sha1 1fb6443b5fdf3c83787953f06282d256477c1288
306.Sy Example (ssldump 0.9b3):
307.Bd -literal -offset indent -compact
308checksums md5 ac8c28fe87508d6bfb06344ec496b1dd \e\
309        sha1 a633a9a811a138eac5ed440d583473b644135ef5 \e\
310        rmd160 941cf8f2ef8459ec4f9ce65772e134505d46566
312.It Ic macosx_deployment_target
313Value for MACOSX_DEPLOYMENT_TARGET environment variable when invoking the configure script.
315.Sy Type:
316.Em optional
318.Sy Default:
319.Em (current OS version)
321.Sy Example:
322.Dl macosx_deployment_target 10.4
323.It Ic use_parallel_build
324If set to yes (and the user has enabled buildmakejobs in
325.Pa macports.conf
326), the port can be built using more than one job.
327.Sy Type:
328.Em optional
330.Sy Default:
331.Em yes
333.Sy Example:
334.Dl use_parallel_build no
335.It Ic use_automake
336If set to yes, run the
337.Cm automake
338target to build any
340files for use by
341.Pa configure .
343.Sy Type:
344.Em optional
346.Sy Default:
347.Em no
349.Sy Example:
350.Dl use_automake yes
351.It Ic use_autoconf
352If set to yes, run the
353.Cm autoconf
354target to build any
355.Pa configure
356script required.
358.Sy Type:
359.Em optional
361.Sy Default:
362.Em no
364.Sy Example:
365.Dl use_autoconf yes
366.It Ic use_configure
367If set to yes, run the
368.Cm configure
369target to configure the build.
371.Sy Type:
372.Em optional
374.Sy Default:
375.Em yes
377.Sy Example:
378.Dl use_configure no
379.It Ic copy_log_files Ar path/to/logfile1 Ar path/to/logfile2 Ar ...
380Copy specific log files from the workdir to the main macports log dir
382.Sy Type:
383.Em optional
385.Sy Example:
386.Dl copy_log_files config.log
387.It Ic conflicts
388Used to list ports which conflict with the one containing the
389.Cm conflicts
392.Sy Type:
393.Em optional
395.Sy Default:
396.Em none (empty)
398.Sy Example:
399.Dl conflicts cdrtools
400.It Ic replaced_by
401When a particular port is deprecated in favor of another, use
402.Cm replaced_by
403in the deprecated port and list the new one to be used.
405.Sy Type:
406.Em optional
408.Sy Default:
409.Em none (empty)
411.Sy Example:
412.Dl replaced_by xorg-renderproto
413.It Ic add_users
414Consists of a list of usernames and settings. At appropriate times during the
415port installation process, a user will be created for each username with the
416corresponding settings. Settings are of the form name=value. A setting
417applies to the username that appeared most recently before it in the list.
419Applicable options are: group, gid (may be used instead of group), passwd,
420realname, home, and shell.
422.Sy Type:
423.Em optional
425.Sy Default:
426.Em none (empty)
428.Sy Example:
429.Dl add_users squid group=squid realname=Squid\e Proxy home=${prefix}/var/squid
431.Dl add_users user1 group=mygroup user2 group=mygroup
432.It Ic installs_libs
433By default, it is assumed that ports may install libraries or headers that can
434be incorporated into their dependents. If this is not the case, set
435.Cm installs_libs
437.Em no .
438This means that this port's dependents need not check that it is installed
439for the same architectures as them; that it is permissible to distribute
440binaries of the dependents even if their licenses conflict with the license
441of this port; and that updates to this port can never result in broken dynamic
442linking in its dependents.
444.Sy Type:
445.Em optional
447.Sy Default:
448.Em none
450.Sy Example:
451.Dl installs_libs no
452.It Ic license_noconflict
453By default, it is assumed that ports may use libraries or headers from their
454dependencies and thus form a derivative work. A dependency with an
455incompatible license thus prevents the port from being distributed in binary
456form. If a dependency with an incompatible license is not used in such a way
457that a derivative work is formed, or should not prevent binary distribution
458for any other reason, add its name to this list.
460.Sy Type:
461.Em optional
463.Sy Default:
464.Em none
466.Sy Example:
467.Dl license_noconflict openssl
468.Dl license_noconflict readline gdbm
471A number of hooks are available for customizing many of the standard
472targets that
473.Xr port 1
474executes. The targets supporting these hooks are
475.Cm fetch ,
476.Cm automake ,
477.Cm autoconf ,
478.Cm configure ,
479.Cm build ,
480.Cm destroot ,
482.Cm test .
483The hooks are:
484.Bl -tag -width lc
485.It Va target Ns Ic .asroot
486Run the
487.Va target
488with root privileges.
490.Sy Example:
491.Dl install.asroot yes
492.It Va target Ns Ic .dir
493Directory in which to run the
494.Va target .
496.Sy Example:
497.Dl automake.dir src
498.It Va target Ns Ic .env
499Change the environment the
500.Va target
501is run in. This is often overridden on a per
505.Sy Example:
506.Dl build.env CC="${} [get_canonical_archflags]"
507.It Va target Ns Ic .pre_args
508Additional arguments passed before the main arguments.
510.Sy Example:
511.Dl extract.pre_args -cd
512.It Va target Ns Ic .args
513Main arguments to pass to the
514.Va target .
515This is often overridden on a per
519.Sy Example:
520.Dl configure.args --enable-fooble
521.It Va target Ns Ic .post_args
522Additional arguments passed after the main arguments.
524.Sy Example:
525.Dl extract.post_args | tar xf -
528Read-only access to the MacPorts configuration is provided.
529.Bl -tag -width lc
530.It Ic prefix
531Install prefix
533.Sy Type:
534.Em optional
536.Sy Default:
537.Em /opt/local
538.It Ic libpath
539Location of ports-specific TCL libraries.
541.Sy Type:
542.Em read-only
543.It Ic portpath
544Full path to the Portfile location.
546.Sy Type:
547.Em read-only
549.Sy Default:
550.Em work
551.It Ic workpath
552Full path to work directory.
554.Sy Type:
555.Em read-only
557.Sy Default:
558.Em ${portbuildpath}/work
559.It Ic worksrcpath
560Full path to working sources (where port has unpacked itself).
562.Sy Type:
563.Em read-only
565.Sy Default:
566.Em ${workpath}/${worksrcdir}
567.It Ic filesdir
568Path to port files relative to
569.Ic portpath .
571.Sy Type:
572.Em read-only
574.Sy Default:
575.Em files
576.It Ic filespath
577Full path to the port files location.
579.Sy Type:
580.Em read-only
582.Sy Default:
583.Em ${portpath}/${filesdir}
584.It Ic distpath
585Location to store downloaded distfiles.
587.Sy Type:
588.Em read-only
590.Sy Default:
591.Em ${sysportpath}/distfiles/${dist_subdir}/
592.It Ic os.arch
593Identifies hardware type (e.g. "powerpc").
595.Sy Type:
596.Em read-only
597.It Ic os.version
598Version number of operating system (e.g. "7.0").
600.Sy Type:
601.Em read-only
602.It Ic os.major
603Major version number of operating system (e.g. "7").
605.Sy Type:
606.Em read-only
607.It Ic os.endian
608Endianness of the processor (e.g. "big").
610.Sy Type:
611.Em read-only
612.It Ic os.platform
613Operating system name (e.g. "darwin").
615.Sy Type:
616.Em read-only
617.It Ic os.subplatform
618Name of specific operating system variant (e.g. "macosx").
620.Sy Type:
621.Em read-only
622.It Ic install.user
623User for MacPorts installation (e.g.
624.Pa root )
626.Sy Type:
627.Em read-only
628.It Ic
629Group for MacPorts installation (e.g.
630.Pa wheel )
632.Sy Type:
633.Em read-only
634.It Ic applications_dir
635Absolute path to the final location to install Mac OS X application
636bundles (.app directories).
638.Sy Type:
639.Em read-only
641.Sy Default:
642.Em /Applications/MacPorts
643.It Ic frameworks_dir
644Absolute path to the final location to install Mac OS X framework
645bundles (.framework directories).
647.Sy Type:
648.Em read-only
650.Sy Default:
651.Em ${prefix}/Library/Frameworks
654Port dependencies should refer to other MacPorts ports
655whenever possible, therefore each dependency should be
656expressed in the format:
657.Bl -tag -width ls
658.It port: Ns Ao port Ac
662.Ao port Ac represents the name of an existing MacPorts
663.Nm port .
664If satisfying a dependency with a MacPorts port is not
665practical and it is likely that a dependency must be met
666by an Apple optional install, then the alternative dependency
668.Bl -tag -width lc
669.It Ar type Ns : Ns Ao filename Ac Ns : Ns Ao port Ac
672may be used. Where
673.Ar type
674is "bin" if
675.Ao filename Ac
676is a program, "lib" if it is a library, or "path" if it is a path to an
677installed file.
679.Sy Example:
680.Dl lib:libX11.6:XFree86
681.Bl -tag -width lc
682.It Ic depends_fetch
683List of dependencies to check before
684.Cm fetch ,
685.Cm checksum ,
686.Cm extract ,
687.Cm patch ,
688.Cm configure ,
689.Cm build ,
690.Cm destroot ,
691.Cm install ,
693.Cm package
696.Sy Type:
697.Em optional
699.Sy Example:
700.Dl depends_fetch port:mercurial
701.It Ic depends_extract
702List of dependencies to check before
703.Cm extract ,
704.Cm patch ,
705.Cm configure ,
706.Cm build ,
707.Cm destroot ,
708.Cm install ,
710.Cm package
713.Sy Type:
714.Em optional
716.Sy Example:
717.Dl depends_extract path:bin/xz:xz
718.It Ic depends_build
719List of dependencies to check before
720.Cm configure ,
721.Cm build ,
722.Cm destroot ,
723.Cm install ,
725.Cm package
728.Sy Type:
729.Em optional
731.Sy Example:
732.Dl depends_build port:autoconf
733.It Ic depends_run
734List of dependencies to check before
735.Cm destroot ,
736.Cm install
738.Cm package
739targets. Will be recorded in the registry as being required by the dependent
740port when it is installed.
742.Sy Type:
743.Em optional
745.Sy Example:
746.Dl depends_run port:bash
747.It Ic depends_lib
748List of dependencies to check before
749.Cm configure ,
750.Cm build ,
751.Cm destroot ,
752.Cm install ,
754.Cm package
755targets. Will be recorded in the registry as being required by the dependent
756port when it is installed.
758.Sy Type:
759.Em optional
761.Sy Example:
762.Dl depends_lib port:libfetch
765Fetch all distribution files and patches.
766.Bl -tag -width lc
767.It Ic master_sites.mirror_subdir
768Subdirectory to append to all mirror sites for any list specified in
771.Sy Type:
772.Em optional
774.Sy Default:
775.Em ${name}
777.Sy Example:
778.Dl master_sites.mirror_subdir      magic
779.It Ic patch_sites
780List of sites to fetch
781.Ic patchfiles
782from or a predefined mirror site list.
784.Sy Type:
785.Em optional
787.Sy Default:
788.Em ${master_sites}
790.Sy Example:
791.Dl patch_sites
792.It Ic patch_sites.mirror_subdir
793Subdirectory to append to all mirror sites for any list specified in
794.Ic patch_sites .
796.Sy Type:
797.Em optional
799.Sy Default:
800.Em ${name}
802.Sy Example:
803.Dl patch_sites.mirror_subdir       magic
804.It Ic extract.suffix
805Suffix to append to
806.Ic distname .
808.Sy Type:
809.Em optional
811.Sy Default:
812.Em .tar.gz
814.Sy Example:
815.Dl extract.suffix .tgz
816.It Ic distfiles
817List of distribution files to fetch from
818.Ic master_sites .
820.Sy Type:
821.Em optional
823.Sy Default:
824.Em [suffix ${distname}]
826.Sy Example:
827.Dl distfiles magicsource.tar.gz cluebat.tar.bz2
828.It Ic patchfiles
829List of patches to fetch and apply.
831.Sy Type:
832.Em optional
834.Sy Example:
835.Dl patchfiles patch-main.c.diff
836.It Ic use_zip
837Use zip.
839Sets extract.suffix to: .zip
841Sets extract.cmd to: unzip
843Sets extract.pre_args to: -q
845Sets extract.post_args to: "-d ${workpath}"
847.Sy Type:
848.Em optional
850.Sy Example:
851.Dl use_zip yes
852.It Ic use_bzip2
853Use bzip2.
855Sets extract.suffix to: .bz2
857Sets extract.cmd to: bzip2
859.Sy Type:
860.Em optional
862.Sy Example:
863.Dl use_bzip2 yes
864.It Ic use_lzma
865Use lzma.
867Sets extract.suffix to: .lzma
869Sets extract.cmd to: lzma
871.Sy Type:
872.Em optional
874.Sy Example:
875.Dl use_lzma yes
876.It Ic use_xz
877Use xz.
879Sets extract.suffix to: .xz
881Sets extract.cmd to: xz
883.Sy Type:
884.Em optional
886.Sy Example:
887.Dl use_xz yes
888.It Ic use_7z
889Use 7z (7zip).
891Sets extract.suffix to: .7z
893Sets extract.cmd to: 7za
895.Sy Type:
896.Em optional
898.Sy Example:
899.Dl use_7z yes
900.It Ic dist_subdir
901Create a sub-directory in
902.Ic distpath
903to store all fetched files.
905.Sy Type:
906.Em optional
908.Sy Default:
909.Em ${name}
911.Sy Example:
912.Dl dist_subdir vim${version}
915Some mirrors require special options for a resource to be properly
917.Bl -tag -width lc
918.It Ic fetch.user
919HTTP or FTP user to fetch the resource.
921.Sy Type:
922.Em optional
923.It Ic fetch.password
924HTTP or FTP password to fetch the resource.
926.Sy Type:
927.Em optional
928.It Ic fetch.use_epsv
929Whether to use EPSV command for FTP transfers.
931.Sy Type:
932.Em optional
934.Sy Default:
935.Em yes
937.It Ic fetch.ignore_sslcert
938Whether to ignore the host SSL certificate (for HTTPS).
940.Sy Type:
941.Em optional
943.Sy Default:
944.Em no
948As an alternative to fetching distribution files, pulling the sources
949from a CVS repository is supported. Use of CVS can give rise to
950non-reproducible builds, so it is strongly discouraged.
951.Bl -tag -width lc
952.It Ic cvs.root
953Specify the address to a CVS repository from which to checkout files.
955.Sy Type:
956.Em optional
958.Sy Default:
959.Em none
961.Sy Example:
962.Dl cvs.root
963.It Ic cvs.tag
964Specify a CVS tag identifying the code to checkout.
966.Sy Type:
967.Em optional
969.Sy Default
970.Em none
972.Sy Example:
973.Dl cvs.tag HEAD
974.It Ic
975A date that identifies the CVS code set to checkout.
977.Sy Type:
978.Em optional
980.Sy Default
981.Em none
983.Sy Example:
984.Dl \*q12-April-2005\*q
985.It Ic cvs.module
986A CVS module from which to check out the code.
988.Sy Type:
989.Em optional
991.Sy Default
992.Em none
994.Sy Example:
995.Dl cvs.module Sources
998As an alternative to fetching distribution files, pulling the sources
999from a subversion repository is supported. Use of subversion can give
1000rise to non-reproducible builds, so it is strongly discouraged.
1001.Bl -tag -width lc
1002.It Ic svn.url
1003Specify the url from which to fetch files.
1005.Sy Type:
1006.Em required
1008.Sy Default:
1009.Em none
1011.Sy Example:
1012.Dl svn.url
1013      svn.url svn://
1014.It Ic svn.revision
1015Specify a tag from which svn should fetch files. This
1016corresponds to the -r option to the svn cli.  Note that you
1017will need to use backslashes to escape characters that have
1018meaning to the Tcl interpreter, such as braces and double
1021.Sy Type:
1022.Em optional
1024.Sy Default:
1025.Em none
1027.Sy Example:
1028.Dl svn.revision 37192
1029      svn.revision \\{\\"2006-02-17 15:30 +0230\\"\\}
1032As an alternative to fetching distribution files, pulling the sources
1033from a git repository is supported. Use of git can give rise to
1034non-reproducible builds, so it is strongly discouraged.
1035.Bl -tag -width lc
1036.It Ic git.url
1037Specify the url from which to fetch files
1039.Sy Type:
1040.Em required
1042.Sy Default:
1043.Em none
1045.Sy Example:
1046.Dl git.url git://
1047      git.url
1048.It Ic git.branch
1049Specify a branch (or other commit-ish) that git should checkout.
1050Note that any branch besides HEAD should be prefixed by origin/.
1052.Sy Type:
1053.Em optional
1055.Sy Default:
1056.Em none
1058.Sy Example:
1059.Dl git.branch 72bf1c8
1060      git.branch origin/next
1063Extract all compressed/archived files.
1064.Bl -tag -width lc
1065.It Ic extract.only
1066List of files to extract into
1067.Ic workpath .
1069.Sy Type:
1070.Em optional
1072.Sy Default:
1073.Em ${distfiles}
1075.Sy Example:
1076.Dl extract.only worksrc-1.4.4.tar.gz
1077.It Ic extract.cmd
1078Command to perform the extraction.
1080.Sy Type:
1081.Em optional
1083.Sy Default:
1084.Em gzip
1086.Sy Example:
1087.Dl extract.cmd bzip2
1088.It Ic extract.mkdir
1089Create the
1090.Ic worksrcdir
1091prior to extraction; useful for ports which extract directly into the current
1092working directory instead of a subdirectory.
1094.Sy Type:
1095.Em optional
1097.Sy Default:
1098.Em no
1100.Sy Example:
1101.Dl extract.mkdir yes
1104MacPorts 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:
1105.Bl -tag -width lc
1106.It Ic configure.optflags
1107Flags to use for optimization.
1109.Sy Type:
1110.Em optional
1112.Sy Default:
1113.Em -Os
1115.Sy Example:
1116.Dl configure.optflags -O3
1117.It Ic configure.cflags
1118Flags to put in the CFLAGS environment variable when invoking the configure script.
1120.Sy Type:
1121.Em optional
1123.Sy Default:
1124.Em ${configure.optflags}
1126.Sy Example:
1127.Dl configure.cflags-append -DHAS_LRINTF
1128.It Ic configure.cppflags
1129Flags to put in the CPPFLAGS environment variable when invoking the configure script.
1131.Sy Type:
1132.Em optional
1134.Sy Default:
1135.Em -I${prefix}/include
1136.It Ic configure.cxxflags
1137Flags to put in the CXXFLAGS environment variable when invoking the configure script.
1139.Sy Type:
1140.Em optional
1142.Sy Default:
1143.Em ${configure.optflags}
1144.It Ic configure.objcflags
1145Flags to put in the OBJCFLAGS environment variable when invoking the configure script.
1147.Sy Type:
1148.Em optional
1150.Sy Default:
1151.Em ${configure.optflags}
1152.It Ic configure.ldflags
1153Flags to put in the LDFLAGS environment variable when invoking the configure script.
1155.Sy Type:
1156.Em optional
1158.Sy Default:
1159.Em -L${prefix}/lib
1160.It Ic configure.fflags
1161Flags to put in the FFLAGS environment variable when invoking the configure script.
1163.Sy Type:
1164.Em optional
1166.Sy Default:
1167.Em ${configure.optflags}
1168.It Ic configure.f90flags
1169Flags to put in the F90FLAGS environment variable when invoking the configure script.
1171.Sy Type:
1172.Em optional
1174.Sy Default:
1175.Em ${configure.optflags}
1176.It Ic configure.fcflags
1177Flags to put in the FCFLAGS environment variable when invoking the configure script.
1179.Sy Type:
1180.Em optional
1182.Sy Default:
1183.Em ${configure.optflags}
1184.It Ic configure.classpath
1185Flags to put in the CLASSPATH environment variable when invoking the configure script.
1187.Sy Type:
1188.Em optional
1189.It Ic
1190C-compiler to put in the CC environment variable when invoking the configure script.
1192.Sy Type:
1193.Em optional
1195.Sy Example:
1196.Dl /usr/bin/gcc
1197.It Ic configure.cpp
1198C-preprocessor to put in the CPP environment variable when invoking the configure script.
1200.Sy Type:
1201.Em optional
1202.It Ic configure.cxx
1203C++-compiler to put in the CXX environment variable when invoking the configure script.
1205.Sy Type:
1206.Em optional
1207.It Ic configure.objc
1208Objective-C-compiler to put in the OBJC environment variable when invoking the configure script.
1210.Sy Type:
1211.Em optional
1213.Sy Example:
1214.Dl configure.objc ${prefix}/bin/gcc-mp-4.1
1215.It Ic configure.fc
1216Fortran-compiler to put in the FC environment variable when invoking the configure script.
1218.Sy Type:
1219.Em optional
1220.It Ic configure.f77
1221Fortran-77-compiler to put in the F77 environment variable when invoking the configure script.
1223.Sy Type:
1224.Em optional
1225.It Ic configure.f90
1226Fortran-90-compiler to put in the F90 environment variable when invoking the configure script.
1228.Sy Type:
1229.Em optional
1230.It Ic configure.javac
1231Java compiler to put in the JAVAC environment variable when invoking the configure script.
1233.Sy Type:
1234.Em optional
1235.It Ic configure.compiler
1236Selects 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!
1237.Em gcc-3.3
1238.Em gcc-4.0
1239.Em gcc-4.2
1240.Em llvm-gcc-4.2
1241.Em clang
1242use the standard Xcode compiler suites,
1243.Em apple-gcc-4.0
1244.Em apple-gcc-4.2
1245use Apple's gcc suite installed via MacPorts,
1246.Em macports-gcc-4.2
1247.Em macports-gcc-4.3
1248.Em macports-gcc-4.4
1249.Em macports-gcc-4.5
1250.Em macports-gcc-4.6
1251.Em macports-gcc-4.7
1252.Em macports-gcc-4.8
1253.Em macports-llvm-gcc-4.2
1254use the vanilla compiler suites installed via MacPorts.
1256.Sy Type:
1257.Em optional
1259.Sy Values:
1260.Em gcc-3.3 gcc-4.0 gcc-4.2 llvm-gcc-4.2 clang apple-gcc-4.0 apple-gcc-4.2 macports-gcc-4.2 macports-gcc-4.3 macports-gcc-4.4 macports-gcc-4.5 macports-gcc-4.6 macports-gcc-4.7 macports-gcc-4.8 macports-llvm-gcc-4.2
1262.Sy Example:
1263.Dl configure.compiler llvm-gcc-4.2
1264.\" FOOBAR
1267For 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.
1268.Bl -tag -width lc
1269.It Ic configure.universal_args
1270Arguments appended to the configure script to build the port universal.
1272.Sy Type:
1273.Em optional
1275.Sy Default:
1276.Em --disable-dependency-tracking
1277.It Ic configure.universal_cflags
1278Additional flags to put in the CFLAGS environment variable when invoking the configure script.
1280.Sy Type:
1281.Em optional
1283.Sy Default:
1284.Em -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc
1285.It Ic configure.universal_cppflags
1286Additional flags to put in the CPPFLAGS environment variable when invoking the configure script.
1288.Sy Type:
1289.Em optional
1290.It Ic configure.universal_cxxflags
1291Additional flags to put in the CXXFLAGS environment variable when invoking the configure script.
1293.Sy Type:
1294.Em optional
1296.Sy Default:
1297.Em -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc
1298.It Ic configure.universal_ldflags
1299Additional flags to put in the LDFLAGS environment variable when invoking the configure script.
1301.Sy Type:
1302.Em optional
1304.Sy Default:
1305.Em -arch i386 -arch ppc
1308Execute necessary build commands.
1309.Bl -tag -width lc
1310.It Ic build.cmd
1311Make command to run relative to
1312.Ic worksrcdir .
1314.Sy Type:
1315.Em optional
1317.Sy Default:
1318.Em make
1320.Sy Example:
1321.Dl build.cmd scons
1322.It Ic build.type
1323Defines which 'make' is required, either 'gnu' or 'bsd'. Can also choose 'xcode'
1324(or the deprecated synonym 'pbx'), however you should generally use
1325the xcode PortGroup rather than setting this directly.
1327.Ic build.cmd
1328to either
1329.Pa gnumake,
1330.Pa bsdmake
1332.Pa xcodebuild
1335.Sy Type:
1336.Em optional
1338.Sy Default:
1339.Em gnu
1341.Sy Example:
1342.Dl build.type bsd
1343.It Ic
1344Target passed to
1345.Ic build.cmd .
1347.Sy Type:
1348.Em optional
1350.Sy Default:
1351.Em all
1353.Sy Example:
1354.Dl all-src
1357Execute necessary commands to install into a temporary destination root
1358("destroot") staging area.
1359.Bl -tag -width lc
1360.It Ic destroot.cmd
1361Install command to run relative to
1362.Ic worksrcdir .
1364.Sy Type:
1365.Em optional
1367.Sy Default:
1368.Em ${build.cmd}
1370.Sy Example:
1371.Dl destroot.cmd scons
1372.It Ic destroot.destdir
1373Arguments passed to
1374.Ic destroot.cmd
1375in order to install correctly
1376into the destroot.
1378.Sy Type:
1379.Em optional
1381.Sy Default:
1382.Em DESTDIR=${destroot}
1384.Sy Example:
1385.Dl destroot.destdir prefix=${destroot}${prefix}
1386.It Ic
1387Install target to pass to
1388.Ic destroot.cmd .
1390.Sy Type:
1391.Em optional
1393.Sy Default:
1394.Em install
1396.Sy Example:
1397.Dl install-src
1398.It Ic destroot.umask
1399Umask to use during destroot.
1401.Sy Type:
1402.Em optional
1404.Sy Default:
1405.Em 022
1407.Sy Example:
1408.Dl destroot.umask 002
1409.It Ic destroot.keepdirs
1410List of directories that should not be pruned if empty upon
1411.Cm destroot
1414.Sy Type:
1415.Em optional
1417.Sy Example:
1418.Dl destroot.keepdirs ${destroot}${prefix}/var/log/mysql
1419.It Ic destroot.violate_mtree
1420Indicates 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
1421.Xr porthier 7 .
1423.Sy Type:
1424.Em optional
1426.Sy Values:
1427.Em yes no
1429.Sy Default:
1430.Em no
1433Execute commands to run test suites bundled with a port.
1434.Bl -tag -width lc
1435.It Ic
1436Enable running test suites bundled with a port.
1438.Sy Type:
1439.Em optional
1441.Sy Example:
1442.Dl     yes
1443.It Ic test.cmd
1444Test command to run relative to
1445.Ic worksrcdir .
1447.Sy Type:
1448.Em optional
1450.Sy Default:
1451.Em ${build.cmd}
1453.Sy Example:
1454.Dl test.cmd
1455.It Ic
1456Test target to pass to
1457.Ic test.cmd .
1459.Sy Type:
1460.Em optional
1462.Sy Default:
1463.Em test
1465.Sy Example:
1466.Dl checks
1469If a port needs to run on system startup, it can use MacPorts
1470startupitem keywords to install native OS X startup scripts.
1471Startup scripts require user interaction after port installation
1472to activate them and instructions are given during port installs.
1473.Bl -tag -width lc
1474.It Ic startupitem.create
1475Choose whether or not to generate a startup item.
1477.Sy Type:
1478.Em optional
1480.Sy Default:
1481.Em no
1483.Sy Values:
1484.Em yes no
1486.Sy Example:
1487.Dl startupitem.create yes
1488.It Ic startupitem.type
1489Select the type of startupitem to generate. By default, a startupitem
1490will be generated that is of the appropriate type for the OS. For
1491instance, launchd is used on system 10.4, while SystemStarter is used
1492on prior Mac OS X systems. A global default may be specified with the startupitem_type preference in ports.conf.
1494.Sy Type:
1495.Em optional
1497.Sy Default:
1498.Em default
1500.Sy Values:
1501.Em SystemStarter launchd default rcNG
1503.Sy Example
1504.Dl startupitem.type launchd
1505.It Ic
1506Displayed name of the startup item.
1508.Sy Type:
1509.Em required
1511.Sy Example:
1512.Dl OpenSSH
1513.It Ic startupitem.executable
1514The name of the daemon to be run in the background. This is
1515the preferred type of startup item rather than any of
1516startupitem.init, startupitem.start, startupitem.stop, or
1517startupitem.restart, and may not be used together with any
1518of these options.  This option may contain multiple
1519arguments, but they must be appropriate for a call to exec; they
1520may not contain arbitrary shell code.
1522.Sy Type:
1523.Em optional
1525.Sy Values:
1526.Em /path/to/executable <args>
1528.Sy Example:
1529.Dl startupitem.executable ${prefix}/bin/wonka
1530.It Ic startupitem.init
1531Shell code that will be executed prior to any of the options
1532startupitem.start, startupitem.stop and startupitem.restart.
1534.Sy Type:
1535.Em optional
1537.Sy Values:
1538.Em sh code
1540.Sy Example:
1541.Dl startupitem.init FOO=start
1542.It Ic startupitem.start
1543Shell code executed to start the daemon.
1545.Sy Type:
1546.Em optional
1548.Sy Values:
1549.Em sh code
1551.Sy Example:
1552.Dl startupitem.start ${prefix}/share/mysql/mysql.server start
1553.It Ic startupitem.stop
1554Shell code executed to stop the daemon.
1556.Sy Type:
1557.Em optional
1559.Sy Values:
1560.Em sh code
1562.Sy Example:
1563.Dl startupitem.stop ${prefix}/share/mysql/mysql.server stop
1564.It Ic startupitem.restart
1565Shell code executed to restart the daemon. In the absence
1566of this key, the daemon will be restarted by taking the
1567stop action, followed by taking the start action.
1569.Sy Type:
1570.Em optional
1572.Sy Values:
1573.Em sh code
1575.Sy Example:
1576.Dl startupitem.restart ${prefix}/share/mysql/mysql.server restart
1577.It Ic startupitem.pidfile
1578Specification for pidfile handling. This is particularly useful
1579in conjunction with the startupitem.executable key, because it is
1580important that the startupitem know how to track the executable.
1581This specifies whether the daemon generates its own pidfile (auto),
1582whether it generates its own but forgets to delete it, so that the
1583startupitem should delete it (clean), or whether it never generates
1584one, in which case the startupitem should manage the pidfile on its
1585own (manual), or whether no pidfile should be used at all (none).
1587.Sy Type:
1588.Em optional
1590.Sy Default:
1591.Em none "${prefix}/var/run/${name}.pid"
1593.Sy Values:
1594.Em none|auto|manual|clean [/path/to/pidfile]
1596.Sy Example:
1597.Dl startupitem.pidfile auto ${prefix}/var/run/${name}.pidfile
1598.It Ic startupitem.logfile
1599Path to a logfile for logging events about the lifetime of the
1600startupitem. Depending on the type of startupitem, and the manner
1601in which it is started, standard output from the daemon may also be
1602directed to the logfile.
1604.Sy Type:
1605.Em optional
1607.Sy Default:
1608.Em /dev/null
1610.Sy Values:
1611.Em path
1613.Sy Example:
1614.Dl startupitem.logfile ${prefix}/var/log/mydaemon.log
1615.It Ic startupitem.logevents
1616Control whether or not to log events to the log file. If logevents
1617is set, events with timestamps are logged to the logfile.
1619.Sy Type:
1620.Em optional
1622.Sy Default:
1623.Em no
1625.Sy Values:
1626.Em yes|no
1628.Sy Example:
1629.Dl startupitem.logevents yes
1630.It Ic startupitem.netchange
1631Control whether the startupitem should be restarted when a change in the
1632machine's network state is detected.
1634.Sy Type:
1635.Em optional
1637.Sy Default:
1638.Em no
1640.Sy Values:
1641.Em yes|no
1643.Sy Example:
1644.Dl startupitem.netchange yes
1647MacPorts can automatically check if the software has been updated
1648since the Portfile was modified and if some external changes require
1649an update to the Portfile. This helps maintainers have up-to-date
1650and working Portfiles.
1652Two checks are available. With distcheck, MacPorts can check that the
1653distfile(s) are still downloadable and did not change since the portfile
1654was modified.
1655With livecheck, MacPorts can query a resource to determine if a newer
1656version of the software is available.
1657.Bl -tag -width lc
1658.It Ic distcheck.check
1659This option can be used to disable distcheck. It specifies what kind
1660of check should be performed on distfiles:
1661.Em moddate
1662(check if the Portfile is older than the distfile) or
1663.Em none
1664(no check).
1666.Sy Type:
1667.Em optional
1669.Sy Default:
1670.Em moddate
1672.Sy Values:
1673.Em moddate none
1674.It Ic livecheck.type
1675What kind of check to perform to figure out if the software has been updated.
1676Can be
1677.Em freecode
1678(uses the date_updated tag of the freecode XML file),
1679.Em sourceforge
1680(uses the version of the latest file release of the project),
1681.Em googlecode
1682(uses the version of the latest file release of the project),
1683.Em moddate
1684(uses the modification date of some URL resource),
1685.Em regex
1686(retrieve the version by applying a regex to some URL resource),
1687.Em regexm
1688(retrieve the version by applying a multi-line regex to some URL resource),
1689.Em md5
1690(compares the md5 sum of some URL resource) or
1691.Em none
1692(no check).
1694.Sy Type:
1695.Em optional
1697.Sy Default:
1698.Em sourceforge
1700.Em googlecode
1701if the master_sites is one of these, else
1702.Em freecode
1704.Sy Values:
1705.Em freecode sourceforge googlecode moddate regex regexm md5 none
1706.It Ic
1707Name of the project for live checks (used for freecode, sourceforge, and googlecode checks).
1709.Sy Type:
1710.Em optional
1712.Sy Default:
1713.Em ${name}
1714or the sourceforge/freecode/googlecode project name if it can be guessed by looking at the master_sites.
1715.It Ic livecheck.distname
1716Name of the file release (used for sourceforge and googlecode checks).
1717For sourceforge releases use the name of the package release.
1718For googlecode releases use the name of the file download, including extension.
1719Replace the version part of the name with "(.*)".
1721.Sy Type:
1722.Em optional
1724.Sy Default:
1725.Em ${}
1726for sourceforge projects or the first entry in
1727.Em ${distfiles}
1728for googlecode projects
1729.It Ic livecheck.version
1730Version of the project for live checks (used for regex-based checks).
1732.Sy Type:
1733.Em optional
1735.Sy Default:
1736.Em ${version}
1737.It Ic livecheck.url
1738URL to query for the check.
1740.Sy Type:
1741.Em optional
1743.Sy Default:
1744.Em ${homepage}
1751.It Ic livecheck.regex
1752Regular expression to parse the resource for regex checks.
1753Be sure to use a regular expression grouping around the version component.
1755.Sy Type:
1756.Em optional
1757.It Ic livecheck.md5
1758md5 sum to use for md5 comparison.
1760.Sy Type:
1761.Em optional
1764MacPorts allows for conditional modification to be specified in a
1765.Nm ,
1766allowing for user-customization of a software's build-time settings.
1767.Bl -tag -width lc
1768.It Xo
1769.Ic variant
1770.Op Cm requires Ar variant
1771.Op Cm conflicts Ar variant
1772.Op Cm description Ar "description"
1774The value is usually a TCL script which modifies one or more
1776variables. Dependencies and conflicts with other variants in the same
1777port can be expressed with
1778.Cm requires
1780.Cm conflicts .
1781.Cm description
1782provides a means to supply a description of the variant for the user.
1784.Sy Type:
1785.Em optional
1787.Sy Example:
1788Add a "gnome" variant to a port.
1789.Bd -literal -offset indent -compact
1790variant gnome requires glib { configure.args-append --with-gnome \e\
1792    depends_lib-append port:gnome-session }
1794.It Ic default_variants
1795If variants are defined, then the
1796.Ic default_variants
1797value lists which variants are enabled by default.
1799.Sy Type:
1800.Em optional
1802.Sy Example:
1803.Dl default_variants +ssl +tcpd
1804.It Ic universal_variant
1805When using MacPorts on Mac OS X, a universal variant is defined and
1806the default behavior is to configure ports with universal flags
1807(see the
1809section above). The variant can be
1810overridden if the default code does not work. It can also be
1811suppressed if having a universal variant for the port does not make
1812sense. To suppress it, use the
1813.Ic universal_variant
1816.Sy Type:
1817.Em optional
1819.Sy Default:
1820.Em yes
1822.Sy Example:
1823.Dl universal_variant no
1826MacPorts allows for platform-specific conditional code to be
1827specified in a
1828.Nm ,
1829for handling differences between platforms and
1830versions of the same platform.
1831.Bl -tag -width lc
1832.It Xo
1833.Ic platform
1834.Ar platform
1835.Op Ar version
1836.Op Ar arch
1837.Ar body
1839The body is executed if the given platform/version/arch combination matches
1840os.platform or os.subplatform and/or os.major and/or os.arch.
1841The following examples are from the lang/php5, audio/flac and sysutils/getopt
1842.Nm Portfiles
1845.Sy Type:
1846.Em optional
1848.Sy Example:
1849.Bd -literal -offset indent -compact
1850platform darwin 10 { configure.env-append LIBS=-lresolv }
1853.Sy Example:
1854.Bd -literal -offset indent -compact
1855platform darwin i386 { configure.args-append --disable-asm-optimizations }
1858.Sy Example:
1859.Bd -literal -offset indent -compact
1860platform darwin 8 powerpc { configure.universal_ldflags-append -liconv }
1864To factorize the work with similar ports, MacPorts provides the notion of
1865.Nm PortGroup
1866that can be used to load definitions for a given class or group of ports. See
1867.Xr portgroup 7
1868for more details on the various PortGroup classes.
1870A number of TCL extensions are available for use in
1871.Nm Portfiles .
1873.Bl -tag -width lc
1874.Bl -tag -width lc -compact
1875.It Xo
1876.Ic xinstall
1877.Op Fl c
1878.Op Fl B Ar suffix
1879.Op Fl b
1880.Op Fl C
1881.Op Fl f Ar flags
1882.Op Fl g Ar group
1883.Op Fl M
1884.Op Fl m Ar mode
1885.Op Fl o Ar owner
1886.Op Fl p
1887.Op Fl S
1888.Op Fl s
1889.Op Fl W Ar dir
1890.Op Ar
1891.Ar destination
1893.It Xo
1894.Ic xinstall
1895.Fl d
1896.Op Fl B Ar suffix
1897.Op Fl b
1898.Op Fl C
1899.Op Fl f Ar flags
1900.Op Fl g Ar group
1901.Op Fl M
1902.Op Fl m Ar mode
1903.Op Fl o Ar owner
1904.Op Fl p
1905.Op Fl S
1906.Op Fl s
1907.Op Fl W Ar dir
1908.Ar directory
1910Install file(s) to a target file or directory. The options are
1911intended to be compatible with
1912.Xr install 1 :
1913.Bl -tag -width indent
1914.It Fl b
1915Backup any existing files with an
1916.Pa .old
1918.It Fl B
1919Specify a different backup suffix for the
1920.Fl b
1922.It Fl c
1923Install files (this is the default).
1924.It Fl C
1925Only copy a file if it is different.
1926.It Fl d
1927Create directories, including (if necessary) parent directories.
1928.It Fl f
1929Specify target flags, see
1930.Xr chflags 1
1931for details.
1932.It Fl g
1933Specify the group.
1934.It Fl M
1935Disable use of
1936.Xr mmap 2 .
1937.It Fl m
1938Specify an alternate mode. The default is 0755. See
1939.Xr chmod 1
1940for defails.
1941.It Fl p
1942Preserve the modification time.
1943.It Fl S
1944Copy safely, using a temporary file.
1945.It Fl s
1946Strip binaries using
1947.Xr strip 1 .
1948.It Fl W
1949Change to
1950.Ar dir
1951before working.
1954.It Xo
1955.Ic fs-traverse
1956.Op Fl depth
1957.Op Fl ignoreErrors
1958.Ar varname
1959.Ar target-list
1960.Ar body
1962Traverse the filesystem hierarchy rooted in each element of
1963.Ar target-list
1964and execute
1965.Ar body
1966for each found file/directory.
1967.Va varname
1968is set to the path of the file/directory. If
1969.Ic break
1970is called during execution, the filesystem traversal is stopped. If
1971.Ic continue
1972is called during execution, the current file and any children are skipped
1973and traversal continues with the next file/directory.
1974.Bl -tag -width indent
1975.It Fl depth
1976Equivalent to the
1977.Fl d
1978switch to
1979.Xr find 1 .
1980Please note that using
1981.Fl depth
1982means you cannot prune a directory with
1983.Ic continue
1984as it will be processed after its children.
1985.It Fl ignoreErrors
1987.Ic fs-traverse
1988to ignore any permissions/read errors encountered during processing.
1992.Nm fs-traverse
1993is called directly on a symbolic link, the link will be followed. All other
1994links encountered during traversal will not be followed.
1996.Nm fs-traverse
1997will not descend into directories that have a different device number than
1998the root of the descent.
2000If you remove the current directory during traversal, be aware that you must call
2001.Nm continue
2002to inform
2003.Nm fs-traverse
2004that the directory should not be descended into.
2005.It Xo
2006.Ic curl fetch
2007.Ar url
2008.Ar file
2010Fetch a resource at
2011.Ar url
2012and save it to
2013.Ar file .
2014.It Xo
2015.Ic curl isnewer
2016.Ar url
2017.Ar date
2019Determine if resource at
2020.Ar url
2021is newer than
2022.Ar date
2023(expressed in seconds since epoch).
2024.It Xo
2025.Ic adduser
2026.Ar username
2027.Op Cm uid Ns = Ns uid
2028.Op Cm gid Ns = Ns gid
2029.Op Cm passwd Ns = Ns passwd
2030.Op Cm realname Ns = Ns realname
2031.Op Cm home Ns = Ns home
2032.Op Cm shell Ns = Ns shell
2034Add a new local user to the system with the specified uid, gid,
2035password, real name, home directory and login shell. Note that it is usually
2036preferable to set the add_users option rather than call adduser directly,
2037since it may need to be called in multiple places to handle all cases (e.g.
2038installing from a binary archive).
2039.It Ic existsuser Ar username
2040Check if a local user exists.
2041.It Ic nextuid
2042Returns the highest used uid plus one.
2043.It Xo
2044.Ic addgroup
2045.Ar group
2046.Op Cm gid Ns = Ns gid
2047.Op Cm passwd Ns = Ns passwd
2048.Op Cm realname Ns = Ns realname
2049.Op Cm users Ns = Ns users
2051Add a new local group to the system, with the specified gid, password,
2052real name, and with a list users as members.
2053.It Ic existsgroup Ar group
2054Check if a local group exists and return the corresponding gid. This can be used
2055with adduser:
2056.Dl addgroup foo
2057.Dl adduser foo gid=[existsgroup foo]
2058.It Ic nextgid
2059Returns the highest used gid plus one.
2060.It Xo
2061.Ic reinplace
2062.Op Fl E
2063.Ar regex
2066Provide in-place
2067.Xr sed 1
2068like editing of a file.
2069The -E flag does the same thing as in
2070.Xr sed 1
2072.Sy Example:
2073.Dl reinplace \*qs|/usr/local|${prefix}|g\*q doc/manpage.1
2074.It Ic file
2075Standard TCL command to manipulate file names and attributes, recommended if you wish to preserve Mac OS
2076resource forks when destrooting ports on Mac OS X 10.3.x and Mac OS X 10.4.x . Use
2077.Nm xinstall
2078to also preserve Extended Attributes (i.e. Access Control Lists). See
2079.Xr file n
2080for more information on this command.
2081.It Ic copy
2082Built-in shorthand alternative to "file copy".
2083.It Ic move
2084Built-in shorthand alternative to "file rename".
2085.It Ic delete Ar
2086Deletes each of the given files/directories. Behaves similarly to
2087.Ic file delete -force
2088except that
2089.Ic file delete -force
2090will fail to delete directories properly on 10.3 systems.
2091.It Ic touch
2092Built-in command mimicking the BSD touch command.
2093.It Ic ln
2095Built-in command mimicking the BSD ln command.
2096.It Xo
2097.Ic system
2098.Op Fl W Ar dir
2099.Ar commandline
2101Execute a program. See
2102.Xr system 3 .
2103For calls to
2104.Xr install 1
2105please use
2106.Nm xinstall .
2107For calls to
2108.Xr mv 1 ,
2109.Xr cp 1 ,
2110.Xr rm 1
2111or similar, please use the built-in commands or
2112.Nm file
2113if they don't meet your requirements.
2114.Bl -tag -width indent
2115.It Fl W
2116Change to
2117.Ar dir
2118before working.
2120.It Ic variant_isset Ar variant
2121Checks if the given
2122.Ar variant
2123is being built.
2124.It Ic variant_set Ar variant
2125Set the given
2126.Ar variant .
2127.It Va variable Ns - Ns Ic append Ar item
2129.Ar item
2130to the
2131.Va variable .
2133.Sy Example:
2134.Dl configure.args-append --with-gnomedb
2135.It Va variable Ns - Ns Ic delete Ar item
2137.Ar item
2138from the
2139.Va variable .
2141.Sy Example:
2142.Dl configure.args-delete --with-gnomedb
2143.It Ic readdir Ar directory
2144Return the list of elements in a
2145.Ar directory ,
2147.Pa \&.
2149.Pa \&.. .
2150.It Ic strsed Ar string Ar pattern
2152.Xr ed 1 Ns / Ns
2153.Xr tr 1 Ns -like
2154search, replace, and transliteration on a string.
2155.It Ic mktemp Ar template
2156Create a temporary file using a
2157.Ar template .
2159.Xr mktemp 3 .
2160.It Ic mkstemp Ar template
2161Create a temporary file securely using a
2162.Ar template .
2164.Xr mkstemp 3 .
2165.It Ic mkdtemp Ar template
2166Create a temporary directory using a
2167.Ar template .
2169.Xr mkdtemp 3 .
2170.It Ic md5 Ar
2171Compute the MD5 hashes of the file(s).
2172.It Ic vercmp Ar versionA Ar versionB
2173Compare two EVR-format versions for equality.  The return value is like
2174strcmp(), returning -1, 0, or 1 when versionA is earlier, equal to, or
2175later than versionB, respectively.  Note that some comparisons featuring
2176floating-point notation may compare incorrectly, e.g. 2.101 is considered
2177later than 2.2 (101 is larger than 2) which may be incorrect per some
2178projects versioning methods (see ticket #11873).
2179.It Xo
2180.Ic lpush
2181.Ar varName
2182.Op Ar value \&...
2184Treats the variable given by
2185.Ar varName
2186as a list and appends each of the
2187.Ar value
2188arguments to that list as a separate element. If
2189.Ar varName
2190doesn't exist, it is created as a list with elements
2191given by the
2192.Ar value
2194Really just an alias for
2195.Xr lappend n .
2196.It Ic lpop Ar varName
2197Removes the last element from the list given by
2198.Ar varName
2199and returns it. If there are no elements in the list,
2200the empty string is returned. If
2201.Ar varName
2202doesn't exist, an exception is raised.
2203.It Xo
2204.Ic lunshift
2205.Ar varName
2206.Op Ar value \&...
2208Treats the variable given by
2209.Ar varName
2210as a list and prepends each of the
2211.Ar value
2212arguments to that list as a separate element. If
2213.Ar varName
2214doesn't exist, it is created as a list with elements
2215given by the
2216.Ar value
2218.It Ic lshift Ar varName
2219Removes the first element from the list given by
2220.Ar varName
2221and returns it. If there are no elements in the list,
2222the empty string is returned. If
2223.Ar varName
2224doesn't exist, an exception is raised.
2225.It Xo
2226.Ic ldindex
2227.Ar varName
2228.Op Ar index \&...
2230Treats the variable given by
2231.Ar varName
2232as a list and removes the element pointed to by the sequence of
2233.Ar index
2234arguments and returns it. If no
2235.Ar index
2236arguments are provided,
2237.Ar varName
2238is set to the empty string and the entire former value is returned.
2239Has the same usage semantics as
2240.Xr lindex n .
2241.It Xo
2242.Ic try
2243.Ar body
2245.Nm catch Nm {
2246.Ar type-list
2247.Op Ar ecvar
2248.Op Ar msgvar
2249.Op Ar infovar
2250.Nm }
2251.Ar body Ar \&...
2253.Op Nm finally Ar body
2255Implements a try-catch-finally block as defined in TIP #89.
2257.Sy Example:
2258Basic try-finally construct.
2259.Bd -literal -offset indent -compact
2260try {
2261    set fd [open $file r]
2262    # do stuff here
2263} finally {
2264    close $fd
2267.Sy Example:
2268Basic try-catch construct
2269.Bd -literal -offset indent -compact
2270try {
2271    set result [expr $num / $div]
2272} catch {{ARITH DIVZERO}} {
2273    set result -1
2276.Sy Example:
2277Basic try with multiple catches construct
2278.Bd -literal -offset indent -compact
2279try {
2280    set fd [open $file r]
2281    # do stuff here
2282} catch {{POSIX ENOENT} {} msgvar} {
2283    puts stderr $msgvar
2284} catch {*} {
2285    puts stderr "An error occurred while processing the file"
2286    close $fd
2287    throw
2290.It Xo
2291.Ic throw
2292.Op Ar type
2293.Op Ar message
2294.Op Ar info
2296Throws an exception. If given arguments, works just like
2297.Ic error
2298.Ar message
2299.Ar info
2300.Ar type .
2301If called with no arguments from within a
2302.Ic catch
2303block, re-throws the caught exception.
2306.Bl -tag -width lc -compact
2307.It Ic ui_debug Ar message
2308.It Ic ui_error Ar message
2309.It Ic ui_info Ar message
2310.It Ic ui_msg Ar message
2311.It Ic ui_warn Ar message
2312Display a
2313.Ar message
2314to the user, at various different levels.
2316.Sy Example:
2317.Dl ui_msg \*qAdd each user to the system using the clamav command\*q
2319.Sh SEE ALSO
2320.Xr port 1 ,
2321.Xr macports.conf 5 ,
2322.Xr portgroup 7 ,
2323.Xr portstyle 7 ,
2324.Xr porthier 7 ,
2325.Xr file n
2327.An "Landon Fuller" Aq
2328.An "Juan Manuel Palacios" Aq
2329.An "Mark Duling" Aq
2330.An "Kevin Van Vechten" Aq
2331.An "Jordan K. Hubbard" Aq
2332.An "Chris Ridd" Aq
2333.An "Kevin Ballard" Aq
2334.An "Markus W. Weissmann" Aq
Note: See TracBrowser for help on using the repository browser.