NAME
/sys/ports/, ports/install, ports/update, ports/setup – Contributed programs and management

SYNOPSIS
ports/install [ –p ] portname

ports/update

/sys/ports/*

DESCRIPTION
Ports and related programs allow users and administrators to install, manage, and fetch programs and sources to programs. Each port contains whats needed to fetch, build, install, and uninstall each program automatically. Ports keeps track of dependencies that need to be installed before a port is installed and what ports are installed on the system. Ports also keep a short synopsis and versioning information for each port ease finding and upgrading programs.

UTILITIES
Ports has a few utilities to help in using the ports tree.
ports/install

This utility allows users to install ports without having to go to the ports tree and can pretend to install to see if the port works.
p    Pretends to install the port. Really installs it to /tmp/ports–overlay.
ports/update

This utility updates the ports tree.
ports/setup

This utility does the initial setup for ports to allow users to start using ports. This must be run after a new installation of 9front if you want the ports tree.

TARGETS
Some of the targets work recursively through the subdirectories of the ports tree or each category. This lets you install the entire ports tree, or all of the ports in a single category automatically. The targets that do this are fetch, build, install, reinstall, and uninstall

The following targets are available for all mkfiles in the ports tree. The order that they're in is the order they should be run in to install or reinstall a program:
fetch
Fetch all of the files needed to build and install the port.
build
Compiles the port and does other things required to install the port.
install
Installs the port and registers it in the ports database. It will fail if the port already exists in the database.
reinstall
Installs the port but does not register it in the ports database. It will not fail if the port already exists in the database.
clean
Cleans the port, usually removing object files and files generated during the build and installation.
nukeRemoves all downloaded files and all files generated during build an install. After a port is nuked, fetch should be run before running any other target.
uninstall
Uninstalls all files installed during the install. Requires that the port defines $UNINSTALL, $UNINSTALLCOMMAND, or has an uninstall file.

Targets the only exist in the root mkfile or category mkfiles:
testRuns the ports tree test scripts.
db    Creates the ports database (must be run after you install the ports tree).
update
Updates the ports tree against the ports mercurial repository.

ENVIRONMENT
The ports tree's environment is defined by ports.conf , ports.mk.conf , and each port's mkfile

Variables that are available in ports.conf
BINFILES
Defines where executable binaries are installed.
LIBFILES
Defines where library binaries and archives are installed.
PORTS
Defines where the root of the ports tree is.
CATEGORY
Defines the available categories in the ports tree.

Variables that are available in ports.mk.conf :
CATEGORY
Mirror of CATEGORY in ports.conf

Variables that are available in a port's mkfile :
PORTNAME
Name of the port
DESCRIPTION
Some short information about the port, usually info about what it does.
OWNER
The port's maintainer. If the port is orphaned then this has information about being orphaned
WEBSOURCE
URL to download the ports files
WORKFILE
Filename that $WEBSOURCE outputs to.
EXTRACTCOMMAND
Command to extract the $WORKFILE.
CONTRIBSOURCE
A directory in Plan 9's contrib. Must be full path including /n/sources/. Copied to work/ using dircp.
FCONTRIBSOURCE
Exactly the same as $CONTRIBSOURCE, but gets the files from 9front's contrib (contrib.9front.org).
HGSOURCE
Mercurial repository containing the port's files.
DEPSPorts that this ports depends on. These will be installed before this port.
PATCHES
Directory where patches are (if any).
BUILDPATH
The path where $BUILDCOMMAND, $INSTALLCOMMAND, and $CLEANCOMMAND get executed.
BUILDCOMMAND
Command run to build the port.
INSTALLCOMMAND
Command run to install the port.
MESSAGE
List of strings that are output to the user at the end of installation.
CLEANCOMMAND
Command run to clean the port
VERSION
Identifier to differentiate between version of a port.
UNINSTALL
List of files that the port installs.
UNINSTALLCOMMAND
Command to run that will uninstall the port.

FILES
/sys/ports – The ports root
/sys/ports/Config/ports.conf – rc config file
/sys/ports/Config/ports.mk.conf – mk config file
/sys/ports/Config/ports.db – Installed port database
/sys/ports/Mk/* – Global ports files

SEE ALSO
pkg(1), mk(1), rc(1), regexp(6)

HISTORY
Ports initially appeared in BSD. We stole the idea.
Appeared in 9front around June 2015.

AUTHORS
Matthew Veety <mveety@mveety.com>
Nick Owens <mischief@offblast.org>
Jens Staal

BUGS
Yes.