Ports::Port(3)

NAME
FreeBSD::Ports::Port - Deal with individual ports from FreeBSD's ports collection

WARNING!
This is a very early version of this module. The interface to the class may be changed in the future. The documentation needs improving.

Consequently, suggestions, comments and patches are extremely welcome! I think the correct place to discuss this module is the freebsd-doc mailing list at freebsd-doc@freebsd.org.

SYNOPSIS
  # Who maintains the 'arc-5.21e' port?
  # NOTE: Normally the FreeBSD::Ports module is used to do this.
  use FreeBSD::Ports::Port;
  use IO::File;
  my $index = IO::File->new('/usr/ports/INDEX', 'r') or die;
  my $port = FreeBSD::Ports::Port->new('arc-5.21e', $index);
  print $port->maintainer,"\n";

DESCRIPTION
`FreeBSD::Ports::Port' is a simple interface for parsing lines in FreeBSD's ports INDEX file.

For further information, or to obtain the latest version of this module, see <URL:http://people.FreeBSD.org/~tom/portpm/>.

METHODS
Constructor method to create a new FreeBSD::Ports::Port object. This method is usually called within FreeBSD::Ports. Most programmers will rarely need to call this method.

`$port_proto' may either be the name of a port, or a complete line from an INDEX file. If the name of a port is given, then `$handle' should be a seekable handle for an INDEX. Such a handle is typically created using IO::File.

`$port' is an object representing the specified port. Describe the port in ASCII text format. `$text' contains a description of the port. `$name' is the name of the port. `$path' is the location on a FreeBSD filesystem where this port is found. `$prefix' is the area of the filesystem where this port is installed, usually /usr/local or /usr/X11R6. `$comment' is a brief comment describing the port. `$descr_file' is the name of a file which contains a longer description of the port. `$maintainer' is the e-mail address of the person who maintains the port. `$www_url' is the URL of a resource containing further information about the software included in the port. `$primary_category' is the name of the primary category for the port. A primary category is the first category in which a port is listed. This represents the directory under /usr/ports in which a port is stored. Returns a list of categories which the port is in, excluding its primary category.

If called in array context, `@categories' is sorted alphabetically and case insensitively. In scalar context, `$categories' is a reference to a hash. The keys of the hash are names of categories. No importance should be attached to the values of the hash. Returns a list of categories which the port is in, including its primary category.

If called in array context, `@categories' is sorted alphabetically and case insensitively. In scalar context, `$categories' is a reference to a hash, in the same style as the `categories' method. Returns a list of other ports which are required to build the port.

If called in array context, `@depends' is sorted alphabetically and case insensitively. In scalar context, `$depends' is a reference to a hash, in the same style as the `categories' method. Returns a list of other ports which are required to run the port.

If called in arrary context, `@depends' is sorted alphabetically and case insensitively. In scalar context, `$depends' is a reference to a hash, in the same style as the `categories' method. Returns a list of other ports which are required by the port in any way. At present, this means other ports which are required to build or run the port.

If called in arrary context, `@depends' is sorted alphabetically and case insensitively. In scalar context, `$depends' is a reference to a hash, in the same style as the `categories' method.

CREDITS
This module is written by Tom Hukins <tom@FreeBSD.org>.

Thanks to Nik Clayton for encouragement and assistance.

COPYRIGHT
This module is distributed under the same license as FreeBSD <http://www.FreeBSD.org/copyright/freebsd-license.html>.