1. Introduction
2. Installing MacPorts
2.1. Install Xcode
2.2. Install MacPorts
2.3. MacPorts Upgrade
2.4. Uninstall
2.5. MacPorts and the Shell
3. Using MacPorts
3.1. The port Command
3.2. Port Variants
3.3. Common Tasks
3.4. Port Binaries
4. Portfile Development
4.1. Portfile Introduction
4.2. Creating a Portfile
4.3. Example Portfiles
4.4. Port Variants
4.5. Patch Files
4.6. Local Portfile Repositories
4.7. Portfile Best Practices
4.8. MacPorts' buildbot
5. Portfile Reference
5.1. Global Keywords
5.2. Global Variables
5.3. Port Phases
5.4. Dependencies
5.5. Variants
5.6. Tcl Extensions & Useful Tcl Commands
5.7. StartupItems
5.8. Livecheck / Distcheck
5.9. PortGroups
6. MacPorts Internals
6.1. File Hierarchy
6.2. Configuration Files
6.3. Port Images
6.4. APIs and Libs
6.5. The MacPorts Registry
7. MacPorts Project
7.1. Using Trac for Tickets
7.2. Contributing to MacPorts
7.3. Port Update Policies
7.4. Updating Documentation
7.5. MacPorts Membership
7.6. The PortMgr Team
8. MacPorts Guide Terms
Glossary

Global variables are variables available to any Portfile. For a list of additional variables available to ports that are assigned to a MacPorts Portgroup, see portgroup(7).

All of these variables except prefix are read-only!

prefix

Installation prefix, set at compile time and displayed in ${prefix}/etc/macports/macports.conf —- may be overridden on a per-port basis, for example to install into a wholly-contained subdirectory of ${prefix}, but most ports should have no reason to do so.

Default: /opt/local

libpath

Path to the MacPorts Tcl libraries.

portpath

Full path to the Portfile of the port being executed. Portfile repositories are defined in the file sources.conf.

Default: ${prefix}/var/macports/sources/rsync.macports.org/release/ports/<category>/<portname>/

filesdir

Path to files directory relative to ${portpath}.

Value: files

filespath

Full path to files directory.

Value: ${portpath}/${filesdir}

workpath

Full path to work directory.

Value: ${portbuildpath}/work

worksrcpath

Full path to extracted source code.

Value: ${workpath}/${worksrcdir}

destroot

Full path into which software will be destrooted.

Value: ${workpath}/destroot

distpath

Location to store downloaded distfiles.

Value: ${sysportpath}/distfiles/${dist_subdir}/

install.user

The Unix user at the time of port installation.

install.group

The Unix group at the time of port installation.

os.platform

The underlying operating system platform (e.g., darwin on OS X, freebsd, etc.).

os.arch

The hardware architecture -- either powerpc or i386.

os.version

The version number of the host operating system (e.g., 12.3.0 for Darwin 12.3.0 a.k.a. OS X 10.8.3).

os.endian

Endianness of the processor -- either big (on PowerPC systems) or little (on Intel systems).

os.major

The major version number of the host operating system (e.g., 12 for Darwin 12.x).