1. Introduction
2. Installing MacPorts
2.1. Install X11
2.2. Install Xcode
2.3. Install MacPorts
2.4. MacPorts Upgrade
2.5. Uninstall
2.6. 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
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. MacPorts Membership
7.5. The PortMgr Team
8. MacPorts Guide Terms
Glossary
Single Page Chunked

Here we list the individual Portfile components for an application that conforms to the standard configure, make, and make install steps of most open source application installs.

  1. Modeline

    This should be the first line of a Portfile. It sets the correct editing options for vim and emacs. See Port Style for more information. Its use is optional and up to the port maintainer.

    # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
  2. Subversion ID tag line

    This must be a Portfile's second line (or the first, if a modeline is not used). When a port is committed to the repository, ID tags are expanded to include the filename and the revision number, date and time, and author of the last commit.

    # $Id$
  3. PortSystem line

    This statement is required for all ports.

    PortSystem          1.0
  4. Port name

    name                rrdtool
  5. Port version

    version             1.2.23
  6. Port categories

    A port may belong to more than one category, but the first (primary) category should match the directory name in the ports tree where the Portfile is to reside.

    categories          net
  7. Platform statement

    platforms           darwin
  8. Port maintainers

    A port's maintainers are the people who have agreed to take responsibility for keeping the port up-to-date. The maintainers keyword lists the maintainers' email addresses, preferrably in the obfuscated form which hides them from spambots. For more, see the full explanation of the maintainers keyword in the Global Keywords section of the Portfile Reference chapter.

    maintainers         jdoe \
                        example.org:julesverne
  9. Port description

    description         Round Robin Database
  10. Port long_description

    long_description    RRDtool is a system to store and display time-series \
                        data
  11. A port's application homepage

    homepage            http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
  12. A port's download URLs

    master_sites        http://oss.oetiker.ch/rrdtool/pub/ \
                        ftp://ftp.pucpr.br/rrdtool/
  13. Port checksums

    The checksums specified in a Portfile are checked with the fetched tarball for security. For the best security, use rmd160 and sha256 checksum types.

    checksums               rmd160  7bbfce4fecc2a8e1ca081169e70c1a298ab1b75a \
                            sha256  2829fcb7393bac85925090b286b1f9c3cd3fbbf8e7f35796ef4131322509aa53

    To find the correct checksums for a port's distribution file, follow this example:

    %% openssl rmd160 rrdtool-1.2.23.tar.gz
    %% openssl sha256 rrdtool-1.2.23.tar.gz
    RIPEMD160( ... rrdtool-1.2.23.tar.gz)= 7bbfce4fecc2a8e1ca081169e70c1a298ab1b75a
    
    SHA256( ... rrdtool-1.2.23.tar.gz)= 2829fcb7393bac85925090b286b1f9c3cd3fbbf8e7f35796ef4131322509aa53
  14. Port dependencies

    A port's dependencies are ports that must be installed before another port is installed.

    depends_lib         port:perl5.8 \
                        port:tcl \
                        port:zlib
  15. Port configure arguments (optional)

    configure.args      --enable-perl-site-install \
                        --mandir=${prefix}/share/man