Tuesday, April 1, 2008

The MacPorts Project -- Download & Installation

The MacPorts Project -- Download & Installation
Installing MacPorts

MacPorts version 1.6.0 is available in various formats for download and installation:


* “dmg” disk images for Leopard (Universal), Tiger (Universal) and Panther (PowerPC)
as a legacy platform, containing pkg installers for use with the Mac OS X Installer. By far the simplest installation
procedure that most users should follow after meeting the requirements listed
below.

* In source form as either a tar.bz2 package or a
tar.gz one for manual compilation, if you intend to customize your installation
in any way.

* SVN checkout of the unpackaged sources, if you wish to follow MacPorts development.

* The selfupdate target of the port(1) command, for users who already have
MacPorts installed and wish to upgrade to a newer release.

Checksums for our packaged downloads are contained in the corresponding checksums file.

Please note that in order to install and run MacPorts on Mac OS X, your system must have installations of the following
components:

1. Apple's
Xcode 3.0 Developer Tools for the Leopard platform or 2.4.1 for Tiger, found at the
Apple Developer Connection site or on your Mac OS X installation CDs/DVD.

2. The X11 windowing environment (A.K.A. “X11 User”) and its related SDK package (“X11SDK”)
for ports that depend on the functionality they provide to compile and run.

* the “X11 User” package is an optional installation on your system CDs/DVD for Panther and
Tiger, enabled through the “Customize” button of the installer, whereas it is included by default
on Leopard.

* the “X11 SDK” package from the Xcode installer will be automatically selected if “X11
User” is already installed, so be sure to install that first.

Mac OS X Package (.pkg) Installer
The easiest way to install MacPorts on a Mac OS X system is by downloading the dmg for Leopard (Universal), Tiger (Universal) or Panther (PowerPC), respectively, and running the system's Installer by double-clicking on the pkg contained therein,
following the on-screen instructions until completion.

This procedure will place a fully-functional and default MacPorts installation on your host system, ready for usage.
If needed your shell configuration files will be adapted by
the installer to include the necessary settings to run MacPorts and the programs it installs, but you may need to
open a new shell for these changes to take effect.

The MacPorts “selfupdate” command will also be run for you by the installer to ensure you have our
latest available release and the latest revisions to the “Portfiles” that contain the instructions employed
in the building and installation of ports. After installation is done, it is recommended that you run this step manually
on a regular basis to to keep your MacPorts system always current:

sudo port -v selfupdate

At this point you should be ready to enjoy MacPorts!

Type “man port” at the command line prompt and/or browse over to our Guide to find out more information about using MacPorts. Help is also available.

Source Installation

If on the other hand you decide to install MacPorts from source, there are still a couple of things you will need to do
after downloading the tarball before you can start installing ports, namely compiling and installing MacPorts itself:

1. “cd” into the directory where you downloaded the package and run “tar xjvf
MacPorts-1.6.0.tar.bz2” or
“tar xzvf MacPorts-1.6.0.tar.gz”,
depending on whether you downloaded the bz2 tarball or the gz one, respectively.

2. Build and install the recently unpacked sources:

* cd MacPorts-1.6.0

* ./configure && make && sudo make install

Optionally:

* cd ../

* rm -rf MacPorts-1.6.0*

These steps need to be perfomed from an administrator account, for which “sudo” will ask the
password upon installation. This procedure will install a pristine MacPorts system and, if the optional steps are taken,
remove the as of now unnecessary MacPorts-1.6.0 source directory and corresponding tarball.

To customize your installation you should read the output of “./configure --help | more” and
pass the appropriate options for the settings you wish to tweak to the configuration script in the steps detailed above.

You will need to manually adapt your shell's environment to work with MacPorts and your chosen installation
prefix (the value passed to configure's --prefix flag, defaulting to /opt/local):

* Add ${prefix}/bin and ${prefix}/sbin to the start of your PATH environment variable
so that MacPorts-installed programs take precedence over system-provided programs of the same name.

* If a standard MANPATH environment variable already exists (that is, one that doesn't contain any empty
components), add the ${prefix}/share/man path to it so that MacPorts-installed man pages are found by your
shell.

* For Tiger and earlier only, add an appropriate X11 DISPLAY environment variable to run X11-dependent
programs, as Leopard takes care of this requirement on its own.

Lastly, you need to synchronize your installation with the MacPorts rsync server:

sudo port -v selfupdate

Upon completion MacPorts will be ready to install ports!

It is recommended to run the above command on a regular basis to keep your installation current. Type “man
port” at the command line prompt and/or browse over to our Guide to
find out more information about using MacPorts. Help is also available.

No comments: