# Global Variables

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 in `${prefix}/etc/macports/macports.conf` —may be overridden on a per port basis. For example, aqua applications are installed in `/Applications/MacPorts`.

  Default: `/opt/local`

x11prefix

  Absolute path to X11.

libpath

  Path to the MacPorts TCL libraries.

binpath

  The directory search path for locating system executables (rsync, tar, etc.) during port installation. Only applications in these directories are available while ports are being installed even if other paths are specified by $PATH in a user's environment.

  Default: ${prefix}/bin:${prefix}/sbin:/bin:/sbin:/usr/bin:/usr/sbin:${x11prefix}/bin

  The binpath is implicitly defined, but it may be overwritten by defining the variable in macports.conf. However, using a non-default binpath is discouraged and should only be performed by advanced users.

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

  Identifies platform type (ie "darwin", "freebsd", etc).

os.arch

  Identifies hardware type (ie "powerpc", "intel").

os.version

  The version number of the host operating system (ie "8.0" for Darwin 8.0).

os.endian

  Endianness of the processor (ie "bigEndian").

os.major

  The major version number of the host operating system (ie "8" for Darwin 8.0).