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

Last change on this file since 60075 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
Line 
1.\" portfile.7
2.\"
3.\" Copyright (c) 2002 Apple Computer, Inc.
4.\" All rights reserved.
5.\"
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.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
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
36.Sh DESCRIPTION
37A complete reference of all available
38.Nm
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.
45.Pp
46The
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.
51.Pp
52A
53.Nm
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.
57.Sh PORTSYSTEM
58Portfiles must begin with a PortSystem line that defines which version of the
59Portfile interpreter should be used.
60.br
61.Sy Synopsis:
62.Dl PortSystem 1.0
63.Sh MAIN VARIABLES
64All ports are required to set certain variables.
65.Bl -tag -width lc
66.It Ic name
67Full name of port.
68.br
69.Sy Type:
70.Em required
71.br
72.Sy Example:
73.Dl name XFree86
74.It Ic version
75Upstream version of software.
76.br
77.Sy Type:
78.Em required
79.br
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.
89.br
90.Sy Type:
91.Em optional
92.br
93.Sy Default:
94.Em 0
95.br
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.
104.br
105.Sy Type:
106.Em required
107.br
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.
116.br
117.Sy Type:
118.Em required
119.br
120.Sy Example:
121.Bd -literal -offset indent -compact
122long_description The GNU Image Manipulation Program \e\
123
124    (GIMP) is a powerful tool for the preparation and \e\
125
126    manipulation of digital images. The GIMP provides \e\
127
128    the user with a wide variety of image manipulation, \e\
129
130    painting, processing, and rendering tools.
131.Ed
132.It Ic revision
133Local revision number of
134.Nm .
135Increment for port revisions which would change its installation in any way.
136.br
137.Sy Type:
138.Em optional
139.br
140.Sy Default:
141.Em 0
142.br
143.Sy Example:
144.Dl revision 1
145.It Ic categories
146Categories to which this port belongs.
147.br
148.Sy Type:
149.Em required
150.br
151.Sy Example:
152.Dl categories spelling textproc
153.It Ic maintainers
154E-mail address(es) of port maintainer(s).
155.br
156.Sy Type:
157.Em required
158.br
159.Sy Example:
160.Dl maintainers landonf@macports.org
161.It Ic platforms
162Declares which platforms are supported by the port.
163.br
164.Sy Type:
165.Em required
166.br
167.Sy Values:
168.Em darwin freebsd
169.br
170.Sy Example:
171.Dl platforms darwin
172.It Ic homepage
173Project homepage for the port.
174.br
175.Sy Type:
176.Em required
177.br
178.Sy Example:
179.Dl http://wireshark.org
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.
186.br
187.Sy Type:
188.Em required
189.br
190.Sy Example:
191.Bd -literal -offset indent -compact
192master_sites ftp://ftp.cdrom.com/pub/magic \e\
193
194    sourceforge
195.Ed
196.It Ic worksrcdir
197Path to source directory relative to
198.Ic workpath .
199.br
200.Sy Type:
201.Em optional
202.br
203.Sy Default:
204.Em ${distname}
205.br
206.Sy Example:
207.Dl worksrcdir ${distname}-src-${version}
208.It Ic distname
209Name of distribution file, without the
210.Cm extract.suffix .
211.br
212.Sy Type:
213.Em optional
214.br
215.Sy Default:
216.Em ${name}-${version}
217.br
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 ...
223.Xc
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.
231.br
232.Sy Type:
233.Em required
234.br
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
239.Ed
240.br
241.Sy Example (ledit 1.11):
242.Bd -literal -offset indent -compact
243checksums md5 a2d38ba641682509c1e964ad699a9dd2 \e\
244        sha1 1fb6443b5fdf3c83787953f06282d256477c1288
245.Ed
246.br
247.Sy Example (ssldump 0.9b3):
248.Bd -literal -offset indent -compact
249checksums md5 ac8c28fe87508d6bfb06344ec496b1dd \e\
250        sha1 a633a9a811a138eac5ed440d583473b644135ef5 \e\
251        rmd160 941cf8f2ef8459ec4f9ce65772e134505d46566
252.Ed
253.It Ic macosx_deployment_target
254Value for MACOSX_DEPLOYMENT_TARGET environment variable when invoking the configure script.
255.br
256.Sy Type:
257.Em optional
258.br
259.Sy Default:
260.Em (current OS version)
261.br
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
270.br
271.Sy Default:
272.Em no
273.br
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
280.Pa Makefile.in
281files for use by
282.Pa configure .
283.br
284.Sy Type:
285.Em optional
286.br
287.Sy Default:
288.Em no
289.br
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.
298.br
299.Sy Type:
300.Em optional
301.br
302.Sy Default:
303.Em no
304.br
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.
311.br
312.Sy Type:
313.Em optional
314.br
315.Sy Default:
316.Em yes
317.br
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
322.br
323.Sy Type:
324.Em optional
325.br
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
331declaration.
332.br
333.Sy Type:
334.Em optional
335.br
336.Sy Default:
337.Em none (empty)
338.br
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.
345.br
346.Sy Type:
347.Em optional
348.br
349.Sy Default:
350.Em none (empty)
351.br
352.Sy Example:
353.Dl replaced_by xorg-renderproto
354.El
355.Sh TARGET HOOKS
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 ,
366and
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.
374.br
375.Sy Example:
376.Dl install.asroot yes
377.It Va target Ns Ic .dir
378Directory in which to run the
379.Va target .
380.br
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
387.Nm
388basis.
389.br
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.
394.br
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
401.Nm
402basis.
403.br
404.Sy Example:
405.Dl configure.args --enable-fooble
406.It Va target Ns Ic .post_args
407Additional arguments passed after the main arguments.
408.br
409.Sy Example:
410.Dl extract.post_args | tar xf -
411.El
412.Sh RUNTIME VARIABLES
413Read-only access to the MacPorts configuration is provided.
414.Bl -tag -width lc
415.It Ic prefix
416Install prefix
417.br
418.Sy Type:
419.Em optional
420.br
421.Sy Default:
422.Em /opt/local
423.It Ic libpath
424Location of ports-specific TCL libraries.
425.br
426.Sy Type:
427.Em read-only
428.It Ic portpath
429Full path to the Portfile location.
430.br
431.Sy Type:
432.Em read-only
433.br
434.Sy Default:
435.Em work
436.It Ic workpath
437Full path to work directory.
438.br
439.Sy Type:
440.Em read-only
441.br
442.Sy Default:
443.Em ${portbuildpath}/work
444.It Ic worksrcpath
445Full path to working sources (where port has unpacked itself).
446.br
447.Sy Type:
448.Em read-only
449.br
450.Sy Default:
451.Em ${workpath}/${worksrcdir}
452.It Ic filesdir
453Path to port files relative to
454.Ic portpath .
455.br
456.Sy Type:
457.Em read-only
458.br
459.Sy Default:
460.Em files
461.It Ic filespath
462Full path to the port files location.
463.br
464.Sy Type:
465.Em read-only
466.br
467.Sy Default:
468.Em ${portpath}/${filesdir}
469.It Ic distpath
470Location to store downloaded distfiles.
471.br
472.Sy Type:
473.Em read-only
474.br
475.Sy Default:
476.Em ${sysportpath}/distfiles/${dist_subdir}/
477.It Ic os.arch
478Identifies hardware type (e.g. "powerpc").
479.br
480.Sy Type:
481.Em read-only
482.It Ic os.version
483Version number of operating system (e.g. "7.0").
484.br
485.Sy Type:
486.Em read-only
487.It Ic os.endian
488Endianness of the processor (e.g. "bigEndian").
489.br
490.Sy Type:
491.Em read-only
492.It Ic os.platform
493Operating system name (e.g. "darwin").
494.br
495.Sy Type:
496.Em read-only
497.It Ic install.user
498User for MacPorts installation (e.g.
499.Pa root )
500.br
501.Sy Type:
502.Em read-only
503.It Ic install.group
504Group for MacPorts installation (e.g.
505.Pa wheel )
506.br
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).
512.br
513.Sy Type:
514.Em read-only
515.br
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).
521.br
522.Sy Type:
523.Em read-only
524.br
525.Sy Default:
526.Em ${prefix}/Library/Frameworks
527.El
528.Sh DEPENDENCY OPTIONS
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
534.El
535.Pp
536Where
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
542format:
543.Bl -tag -width lc
544.It Ar type Ns : Ns Ao filename Ac Ns : Ns Ao port Ac
545.El
546.Pp
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.
553.br
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 ,
563and
564.Cm package
565targets.
566.br
567.Sy Type:
568.Em optional
569.br
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
576and
577.Cm package
578targets.
579.br
580.Sy Type:
581.Em optional
582.br
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 ,
591and
592.Cm package
593targets.
594.br
595.Sy Type:
596.Em optional
597.br
598.Sy Example:
599.Dl depends_lib port:libfetch
600.El
601.Sh FETCH OPTIONS
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
606master_sites.
607.br
608.Sy Type:
609.Em optional
610.br
611.Sy Default:
612.Em ${name}
613.br
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.
620.br
621.Sy Type:
622.Em optional
623.br
624.Sy Default:
625.Em ${master_sites}
626.br
627.Sy Example:
628.Dl patch_sites ftp://ftp.patchcityrepo.com/pub/magic/patches
629.It Ic patch_sites.mirror_subdir
630Subdirectory to append to all mirror sites for any list specified in
631.Ic patch_sites .
632.br
633.Sy Type:
634.Em optional
635.br
636.Sy Default:
637.Em ${name}
638.br
639.Sy Example:
640.Dl patch_sites.mirror_subdir       magic
641.It Ic extract.suffix
642Suffix to append to
643.Ic distname .
644.br
645.Sy Type:
646.Em optional
647.br
648.Sy Default:
649.Em .tar.gz
650.br
651.Sy Example:
652.Dl extract.suffix .tgz
653.It Ic distfiles
654List of distribution files to fetch from
655.Ic master_sites .
656.br
657.Sy Type:
658.Em optional
659.br
660.Sy Default:
661.Em [suffix ${distname}]
662.br
663.Sy Example:
664.Dl distfiles magicsource.tar.gz cluebat.tar.bz2
665.It Ic patchfiles
666List of patches to fetch and apply.
667.br
668.Sy Type:
669.Em optional
670.br
671.Sy Example:
672.Dl patchfiles japanese-widechar-fix.diff japanese-localization.diff
673.It Ic use_zip
674Use zip.
675.br
676Sets extract.suffix to: .zip
677.br
678Sets extract.cmd to: unzip
679.br
680Sets extract.pre_args to: -q
681.br
682Sets extract.post_args to: "-d ${workpath}"
683.br
684.Sy Type:
685.Em optional
686.br
687.Sy Example:
688.Dl use_zip yes
689.It Ic use_bzip2
690Use bzip2.
691.br
692Sets extract.suffix to: .bz2
693.br
694Sets extract.cmd to: bzip2
695.br
696.Sy Type:
697.Em optional
698.br
699.Sy Example:
700.Dl use_bzip2 yes
701.It Ic use_lzma
702Use lzma.
703.br
704Sets extract.suffix to: .lzma
705.br
706Sets extract.cmd to: lzma
707.br
708.Sy Type:
709.Em optional
710.br
711.Sy Example:
712.Dl use_lzma yes
713.It Ic use_xz
714Use xz.
715.br
716Sets extract.suffix to: .xz
717.br
718Sets extract.cmd to: xz
719.br
720.Sy Type:
721.Em optional
722.br
723.Sy Example:
724.Dl use_xz yes
725.It Ic use_7z
726Use 7z (7zip).
727.br
728Sets extract.suffix to: .7z
729.br
730Sets extract.cmd to: 7za
731.br
732.Sy Type:
733.Em optional
734.br
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.
741.br
742.Sy Type:
743.Em optional
744.br
745.Sy Default:
746.Em ${name}
747.br
748.Sy Example:
749.Dl dist_subdir vim${version}
750.El
751.Ss ADVANCED FETCH OPTIONS
752Some mirrors require special options for a resource to be properly
753fetched.
754.Bl -tag -width lc
755.It Ic fetch.user
756HTTP or FTP user to fetch the resource.
757.br
758.Sy Type:
759.Em optional
760.It Ic fetch.password
761HTTP or FTP password to fetch the resource.
762.br
763.Sy Type:
764.Em optional
765.It Ic fetch.use_epsv
766Whether to use EPSV command for FTP transfers.
767.br
768.Sy Type:
769.Em optional
770.br
771.Sy Default:
772.Em yes
773.br
774.It Ic fetch.ignore_sslcert
775Whether to ignore the host SSL certificate (for HTTPS).
776.br
777.Sy Type:
778.Em optional
779.br
780.Sy Default:
781.Em no
782.br
783.El
784.Ss FETCHING FROM CVS
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.
791.br
792.Sy Type:
793.Em optional
794.br
795.Sy Default:
796.Em none
797.br
798.Sy Example:
799.Dl cvs.root :pserver:anonymous@cvs.sv.gnu.org:/sources/emacs
800.It Ic cvs.tag
801Specify a CVS tag identifying the code to checkout.
802.br
803.Sy Type:
804.Em optional
805.br
806.Sy Default
807.Em none
808.br
809.Sy Example:
810.Dl cvs.tag HEAD
811.It Ic cvs.date
812A date that identifies the CVS code set to checkout.
813.br
814.Sy Type:
815.Em optional
816.br
817.Sy Default
818.Em none
819.br
820.Sy Example:
821.Dl cvs.date \*q12-April-2005\*q
822.It Ic cvs.module
823A CVS module from which to check out the code.
824.br
825.Sy Type:
826.Em optional
827.br
828.Sy Default
829.Em none
830.br
831.Sy Example:
832.Dl cvs.module Sources
833.El
834.Ss FETCHING FROM SUBVERSION
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.
841.br
842.Sy Type:
843.Em required
844.br
845.Sy Default:
846.Em none
847.br
848.Sy Example:
849.Dl svn.url http://www.domain.com/svn-repo/mydirectory
850      svn.url svn://www.domain.com/svn-repo/mydirectory
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
856quotes.
857.br
858.Sy Type:
859.Em optional
860.br
861.Sy Default:
862.Em none
863.br
864.Sy Example:
865.Dl svn.tag 37192
866      svn.tag \\{\\"2006-02-17 15:30 +0230\\"\\}
867.El
868.Ss FETCHING FROM GIT
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
875.br
876.Sy Type:
877.Em required
878.br
879.Sy Default:
880.Em none
881.br
882.Sy Example:
883.Dl git.url git://git.kernel.org/pub/scm/git/git.git
884      git.url http://www.kernel.org/pub/scm/git/git.git
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/.
888.br
889.Sy Type:
890.Em optional
891.br
892.Sy Default:
893.Em none
894.br
895.Sy Example:
896.Dl git.branch 72bf1c8
897      git.branch origin/next
898.El
899.Sh EXTRACT OPTIONS
900Extract all compressed/archived files.
901.Bl -tag -width lc
902.It Ic extract.only
903List of files to extract into
904.Ic workpath .
905.br
906.Sy Type:
907.Em optional
908.br
909.Sy Default:
910.Em ${distfiles}
911.br
912.Sy Example:
913.Dl extract.only worksrc-1.4.4.tar.gz
914.It Ic extract.cmd
915Command to perform the extraction.
916.br
917.Sy Type:
918.Em optional
919.br
920.Sy Default:
921.Em gzip
922.br
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.
930.br
931.Sy Type:
932.Em optional
933.br
934.Sy Default:
935.Em no
936.br
937.Sy Example:
938.Dl extract.mkdir yes
939.El
940.Sh CONFIGURE OPTIONS
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.
945.br
946.Sy Type:
947.Em optional
948.br
949.Sy Default:
950.Em -O2
951.br
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.
956.br
957.Sy Type:
958.Em optional
959.br
960.Sy Default:
961.Em ${configure.optflags}
962.br
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.
967.br
968.Sy Type:
969.Em optional
970.br
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.
975.br
976.Sy Type:
977.Em optional
978.br
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.
983.br
984.Sy Type:
985.Em optional
986.br
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.
991.br
992.Sy Type:
993.Em optional
994.br
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.
999.br
1000.Sy Type:
1001.Em optional
1002.br
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.
1007.br
1008.Sy Type:
1009.Em optional
1010.br
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.
1015.br
1016.Sy Type:
1017.Em optional
1018.br
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.
1023.br
1024.Sy Type:
1025.Em optional
1026.It Ic configure.cc
1027C-compiler to put in the CC environment variable when invoking the configure script.
1028.br
1029.Sy Type:
1030.Em optional
1031.br
1032.Sy Example:
1033.Dl configure.cc /usr/bin/gcc
1034.It Ic configure.cpp
1035C-preprocessor to put in the CPP environment variable when invoking the configure script.
1036.br
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.
1041.br
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.
1046.br
1047.Sy Type:
1048.Em optional
1049.br
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.
1054.br
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.
1059.br
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.
1064.br
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.
1069.br
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.
1087.br
1088.Sy Type:
1089.Em optional
1090.br
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
1093.br
1094.Sy Example:
1095.Dl configure.compiler gcc-4.0
1096.\" FOOBAR
1097.El
1098.Ss UNIVERSAL TARGET HOOKS
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.
1103.br
1104.Sy Type:
1105.Em optional
1106.br
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.
1111.br
1112.Sy Type:
1113.Em optional
1114.br
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.
1119.br
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.
1124.br
1125.Sy Type:
1126.Em optional
1127.br
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.
1132.br
1133.Sy Type:
1134.Em optional
1135.br
1136.Sy Default:
1137.Em -arch i386 -arch ppc
1138.El
1139.Sh BUILD OPTIONS
1140Execute necessary build commands.
1141.Bl -tag -width lc
1142.It Ic build.cmd
1143Make command to run relative to
1144.Ic worksrcdir .
1145.br
1146.Sy Type:
1147.Em optional
1148.br
1149.Sy Default:
1150.Em make
1151.br
1152.Sy Example:
1153.Dl build.cmd pbxbuild
1154.It Ic build.type
1155Defines which 'make' is required, either 'gnu' or 'bsd'.
1156Sets
1157.Ic build.cmd
1158to either
1159.Pa gnumake
1160or
1161.Pa bsdmake
1162accordingly.
1163.br
1164.Sy Type:
1165.Em optional
1166.br
1167.Sy Default:
1168.Em gnu
1169.br
1170.Sy Example:
1171.Dl build.type bsd
1172.It Ic build.target
1173Target passed to
1174.Ic build.cmd .
1175.br
1176.Sy Type:
1177.Em optional
1178.br
1179.Sy Default:
1180.Em all
1181.br
1182.Sy Example:
1183.Dl build.target all-src
1184.El
1185.Sh DESTROOT OPTIONS
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 .
1192.br
1193.Sy Type:
1194.Em optional
1195.br
1196.Sy Default:
1197.Em ${build.cmd}
1198.br
1199.Sy Example:
1200.Dl destroot.cmd pbxbuild
1201.It Ic destroot.type
1202Defines which 'make' is required, either 'gnu' or 'bsd'.
1203Sets
1204.Ic destroot.cmd
1205to either
1206.Pa gnumake
1207or
1208.Pa bsdmake
1209accordingly.
1210.br
1211.Sy Type:
1212.Em optional
1213.br
1214.Sy Default:
1215.Em ${build.type}
1216.br
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.
1224.br
1225.Sy Type:
1226.Em optional
1227.br
1228.Sy Default:
1229.Em DESTDIR=${destroot}
1230.br
1231.Sy Example:
1232.Dl destroot.destdir prefix=${destroot}${prefix}
1233.It Ic destroot.target
1234Install target to pass to
1235.Ic destroot.cmd .
1236.br
1237.Sy Type:
1238.Em optional
1239.br
1240.Sy Default:
1241.Em install
1242.br
1243.Sy Example:
1244.Dl destroot.target install-src
1245.It Ic destroot.umask
1246Umask to use during destroot.
1247.br
1248.Sy Type:
1249.Em optional
1250.br
1251.Sy Default:
1252.Em 022
1253.br
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
1259completion.
1260.br
1261.Sy Type:
1262.Em optional
1263.br
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 .
1269.br
1270.Sy Type:
1271.Em optional
1272.br
1273.Sy Values:
1274.Em yes no
1275.br
1276.Sy Default:
1277.Em no
1278.El
1279.Sh TEST OPTIONS
1280Execute commands to run test suites bundled with a port.
1281.Bl -tag -width lc
1282.It Ic test.run
1283Enable running test suites bundled with a port.
1284.br
1285.Sy Type:
1286.Em optional
1287.br
1288.Sy Example:
1289.Dl test.run     yes
1290.It Ic test.cmd
1291Test command to run relative to
1292.Ic worksrcdir .
1293.br
1294.Sy Type:
1295.Em optional
1296.br
1297.Sy Default:
1298.Em ${build.cmd}
1299.br
1300.Sy Example:
1301.Dl test.cmd checks.sh
1302.It Ic test.target
1303Test target to pass to
1304.Ic test.cmd .
1305.br
1306.Sy Type:
1307.Em optional
1308.br
1309.Sy Default:
1310.Em test
1311.br
1312.Sy Example:
1313.Dl test.target checks
1314.El
1315.Sh STARTUPITEM OPTIONS
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.
1323.br
1324.Sy Type:
1325.Em optional
1326.br
1327.Sy Default:
1328.Em no
1329.br
1330.Sy Values:
1331.Em yes no
1332.br
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.
1340.br
1341.Sy Type:
1342.Em optional
1343.br
1344.Sy Default:
1345.Em default
1346.br
1347.Sy Values:
1348.Em SystemStarter launchd default rcNG
1349.br
1350.Sy Example
1351.Dl startupitem.type launchd
1352.It Ic startupitem.name
1353Displayed name of the startup item.
1354.br
1355.Sy Type:
1356.Em required
1357.br
1358.Sy Example:
1359.Dl startupitem.name 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.
1368.br
1369.Sy Type:
1370.Em optional
1371.br
1372.Sy Values:
1373.Em /path/to/executable <args>
1374.br
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.
1380.br
1381.Sy Type:
1382.Em optional
1383.br
1384.Sy Values:
1385.Em sh code
1386.br
1387.Sy Example:
1388.Dl startupitem.init FOO=start
1389.It Ic startupitem.start
1390Shell code executed to start the daemon.
1391.br
1392.Sy Type:
1393.Em optional
1394.br
1395.Sy Values:
1396.Em sh code
1397.br
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.
1402.br
1403.Sy Type:
1404.Em optional
1405.br
1406.Sy Values:
1407.Em sh code
1408.br
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.
1415.br
1416.Sy Type:
1417.Em optional
1418.br
1419.Sy Values:
1420.Em sh code
1421.br
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).
1433.br
1434.Sy Type:
1435.Em optional
1436.br
1437.Sy Default:
1438.Em none "${prefix}/var/run/${name}.pid"
1439.br
1440.Sy Values:
1441.Em none|auto|manual|clean [/path/to/pidfile]
1442.br
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.
1450.br
1451.Sy Type:
1452.Em optional
1453.br
1454.Sy Default:
1455.Em /dev/null
1456.br
1457.Sy Values:
1458.Em path
1459.br
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.
1465.br
1466.Sy Type:
1467.Em optional
1468.br
1469.Sy Default:
1470.Em no
1471.br
1472.Sy Values:
1473.Em yes|no
1474.br
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.
1480.br
1481.Sy Type:
1482.Em optional
1483.br
1484.Sy Default:
1485.Em no
1486.br
1487.Sy Values:
1488.Em yes|no
1489.br
1490.Sy Example:
1491.Dl startupitem.netchange yes
1492.El
1493.Sh DISTCHECK AND LIVECHECK OPTIONS
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.
1498.br
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).
1512.br
1513.Sy Type:
1514.Em optional
1515.br
1516.Sy Default:
1517.Em moddate
1518.br
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).
1540.br
1541.Sy Type:
1542.Em optional
1543.br
1544.Sy Default:
1545.Em sourceforge
1546or
1547.Em googlecode
1548if the master_sites is one of these, else
1549.Em freshmeat
1550.br
1551.Sy Values:
1552.Em freshmeat sourceforge googlecode moddate regex regexm md5 none
1553.It Ic livecheck.name
1554Name of the project for live checks (used for freshmeat, sourceforge, and googlecode checks).
1555.br
1556.Sy Type:
1557.Em optional
1558.br
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 "(.*)".
1567.br
1568.Sy Type:
1569.Em optional
1570.br
1571.Sy Default:
1572.Em ${livecheck.name}
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).
1578.br
1579.Sy Type:
1580.Em optional
1581.br
1582.Sy Default:
1583.Em ${version}
1584.It Ic livecheck.url
1585URL to query for the check.
1586.br
1587.Sy Type:
1588.Em optional
1589.br
1590.Sy Default:
1591.Em ${homepage}
1592or
1593.Em http://freshmeat.net/projects-xml/${livecheck.name}/${livecheck.name}.xml
1594or
1595.Em http://sourceforge.net/export/rss2_projfiles.php?project=${livecheck.name}
1596or
1597.Em http://code.google.com/p/${livecheck.name}/downloads/list
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.
1601.br
1602.Sy Type:
1603.Em optional
1604.It Ic livecheck.md5
1605md5 sum to use for md5 comparison.
1606.br
1607.Sy Type:
1608.Em optional
1609.El
1610.Sh VARIANT OPTIONS
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"
1620.Xc
1621The value is usually a TCL script which modifies other port's
1622.Nm
1623variables. Dependencies and conflicts with other variants in the same
1624port can be expressed with
1625.Cm requires
1626and
1627.Cm conflicts .
1628.Cm description
1629provides a means to supply a description of the variant for the user.
1630.br
1631.Sy Type:
1632.Em optional
1633.br
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\
1638
1639    depends_lib-append lib:gnome-session:gnome-session }
1640.Ed
1641.It Ic default_variants
1642If variants are defined, then the
1643.Ic default_variants
1644value lists which variants are enabled by default.
1645.br
1646.Sy Type:
1647.Em optional
1648.br
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
1655.Ic UNIVERSAL TARGET HOOKS
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
1661option.
1662.br
1663.Sy Type:
1664.Em optional
1665.br
1666.Sy Default:
1667.Em yes
1668.br
1669.Sy Example:
1670.Dl universal_variant no
1671.El
1672.Sh PLATFORM OPTIONS
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
1684.Xc
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
1688respectively.
1689.br
1690.Sy Type:
1691.Em optional
1692.br
1693.Sy Example:
1694.Bd -literal -offset indent -compact
1695platform darwin 6 { configure.args-append   --enable-tcl \e\
1696
1697        --with-tcl=/System/Library/Tcl/8.3 }
1698.Ed
1699.br
1700.Sy Example:
1701.Bd -literal -offset indent -compact
1702platform darwin powerpc { configure.args-append \e\
1703
1704        --host=${os.arch}-apple-rhapsody${os.version} }
1705platform darwin i386 { configure.args-append \e\
1706
1707        --host=i386-gnu-rhapsody${os.version} }
1708.Ed
1709.El
1710.Sh PORTGROUP
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.
1716.Sh TCL EXTENSIONS
1717A number of TCL extensions are available for use in
1718.Nm Portfiles .
1719.Pp
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
1739.Xc
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
1756.Xc
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
1764extension.
1765.It Fl B
1766Specify a different backup suffix for the
1767.Fl b
1768flag.
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.
1799.El
1800.El
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
1808.Xc
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
1833Causes
1834.Ic fs-traverse
1835to ignore any permissions/read errors encountered during processing.
1836.El
1837.Pp
1838If
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.
1842.Pp
1843.Nm fs-traverse
1844will not descend into directories that have a different device number than
1845the root of the descent.
1846.Pp
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
1856.Xc
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
1865.Xc
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
1880.Xc
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
1894.Xc
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
1908.Ar
1909.Xc
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
1915.br
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
1938.br
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
1962Append
1963.Ar item
1964to the
1965.Va variable .
1966.br
1967.Sy Example:
1968.Dl configure.args-append --with-gnomedb
1969.It Va variable Ns - Ns Ic delete Ar item
1970Delete
1971.Ar item
1972from the
1973.Va variable .
1974.br
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 ,
1980excluding
1981.Pa \&.
1982and
1983.Pa \&.. .
1984.It Ic strsed Ar string Ar pattern
1985Perform
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 .
1992See
1993.Xr mktemp 3 .
1994.It Ic mkstemp Ar template
1995Create a temporary file securely using a
1996.Ar template .
1997See
1998.Xr mkstemp 3 .
1999.It Ic mkdtemp Ar template
2000Create a temporary directory using a
2001.Ar template .
2002See
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 \&...
2017.Xc
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
2027arguments.
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 \&...
2041.Xc
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
2051arguments.
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 \&...
2063.Xc
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
2078.Oo
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 \&...
2086.Oc
2087.Op Nm finally Ar body
2088.Xc
2089Implements a try-catch-finally block as defined in TIP #89.
2090.br
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
2099}
2100.Ed
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
2108}
2109.Ed
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
2122}
2123.Ed
2124.It Xo
2125.Ic throw
2126.Op Ar type
2127.Op Ar message
2128.Op Ar info
2129.Xc
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.
2138.El
2139.Pp
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.
2149.br
2150.Sy Example:
2151.Dl ui_msg \*qAdd each user to the system using the clamav command\*q
2152.El
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
2160.Sh AUTHORS
2161.An "Landon Fuller" Aq landonf@macports.org
2162.An "Juan Manuel Palacios" Aq jmpp@macports.org
2163.An "Mark Duling" Aq markd@macports.org
2164.An "Kevin Van Vechten" Aq kevin@opendarwin.org
2165.An "Jordan K. Hubbard" Aq jkh@macports.org
2166.An "Chris Ridd" Aq cjr@opendarwin.org
2167.An "Kevin Ballard" Aq eridius@macports.org
2168.An "Markus W. Weissmann" Aq mww@macports.org
Note: See TracBrowser for help on using the repository browser.