MacPorts can pre-compile ports into binaries so applications need not be compiled when installing on a target system. MacPorts may create two types of binaries: archives and packages.
Binary archives can only be used on a target system running MacPorts. Binary archives allow MacPorts utilities to begin installation after the destroot phase and install and activate a port on the target system. Binary archives are created whenever a port is installed, and can also be downloaded from a server.
%%sudo port -d archive logrotate
Debug output is shown below.
---> Creating logrotate-3.7_0.i386.tbz2 [ ... trimmed ... ] DEBUG: ./ ./+COMMENT ./+CONTENTS ./+DESC ./+PORTFILE ./+STATE ./opt/ ./opt/local/ ./opt/local/etc/ ./opt/local/etc/logrotate.conf ./opt/local/man/ ./opt/local/man/man8/ ./opt/local/man/man8/logrotate.8 ./opt/local/sbin/ ./opt/local/sbin/logrotate ---> Archive logrotate-3.7_0.i386.tbz2 packaged DEBUG: Executing archive_finish ---> Archive for logrotate 3.7_0 packaged
Binary archive files are placed in
${prefix}/var/macports/software/. The archive file
type is set in the macports.conf file. The default
format is .tbz2; other options are: tar, tbz, tbz2, tgz, tlz, txz, xar, zip, cpgz,
cpio.
Binary packages are standalone binary installers that are precompiled; they do not require MacPorts on the target system. Binary files created with MacPorts may be either .pkg (Mac OS X Installer Packages), or RPM (RPM Package Manager) format. MacPorts may also process a .pkg package into a Mac OS X .dmg disk image file. You may create binary packages with the port command as shown in these examples.
%%sudo port pkg pstree
You may create a Mac OS X .dmg disk image file as shown.
%%sudo port dmg pstree
You can also create a metapackage containing packages of a port and all its dependencies:
%%sudo port mpkg gimp2
Just as with a single package, a metapackage can also be wrapped in a .dmg.
%%sudo port mdmg gimp2
You may compile a port into an RPM file as shown, in order to install it onto a target that has RPM utilities or a full package management system that can install RPMs.
%%sudo port rpm pstree
All packages are placed in a port's work directory.
Source packages are bundles consisting of a
Portfile, patches if needed, and any other files
required to install the port. Port source packages are mainly used by
developers of package management and port submission frameworks. Port
source packages may be in either .portpkg (XAR) or .nosrc.rpm (SRPM)
format.