[BACK]Return to ports.html CVS log [TXT][DIR] Up to [local] / www

File: [local] / www / Attic / ports.html (download) (as text)

Revision 1.32, Thu Jun 15 16:48:50 2000 UTC (23 years, 11 months ago) by naddy
Branch: MAIN
Changes since 1.31: +3 -1 lines

mention cvsup and link to cvsup.html; ok espie@

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="resource-type" content="document">
<meta name="description" CONTENT="How OpenBSD can make use of the FreeBSD ports">
<meta name="keywords" content="openbsd,ports">
<meta name="distribution" content="global">
<meta name="copyright" content="copyright 1997-1999 by the OpenBSD project">

<title>OpenBSD Ports and Packages</title>
<link rev="made" HREF="mailto:www@openbsd.org">

<body text="#000000" bgcolor="#FFFFFF" link="#23238E">

<img height=30 width=141 src=images/smalltitle.gif alt="[OpenBSD]" >

<h2><font color=#e00000>The Ports &amp; Packages collection</font><hr></h2>

<h3><font color=#0000e0>Motivation</font></h3>

OpenBSD is a fairly complete system of its own, but still there is a lot
of software that one might want see added. However there is the problem
on where to draw the line as to what to include, as well as the occasional
licensing and export restriction problems.  As OpenBSD is supposed to be
a small stand-alone UNIX-like operating system, some things just can't be
shipped with the system.

<p>
<strong><font color=#e00000>
The ports &amp; packages collection does NOT go through the thorough security audit that OpenBSD follows.
Although we strive to keep the quality of the packages collection high, we just do not have enough human
resources to ensure the same level of robustness and security.
</font></strong>

<p>
The port collection, originally borrowed from
<a href="http://www.freebsd.org/">FreeBSD</a>, fills this gap.
The concept is to have, for each third-party software, a Makefile that
controls
<ul>
<li>where to fetch it,
<li>how to do the fetch,
<li>what it depends upon (if anything),
<li>how to alter the sources (if needed),
<li>and how to configure, build and install it.
</ul>
This information is kept in a directory hierarchy under the
/usr/ports directory.

<p>
Packages are the binary equivalent of ports.  A compiled port becomes
a package that can be registered into the system using pkg_add(1).

<p>
<strong><font color=#e00000>
Packages look like simple <code>.tar.gz</code> bundles, but they should always
be added using pkg_add(1), as there might be some extra information that only
pkg_add(1) knows how to handle.</font></strong>
Tip: you can distinguish between packages and .tar.gz bundles using pkg_info(1).

<h3><font color=#0000e0>Getting packages</font></h3>

A large collection of pre-compiled packages is available for most common
architectures.
<ul>
<li>On the CD-Rom (that you can pre-order <a href="orders.html">here</a>),
<li>On the <a href=ftp.html>ftp mirror sites</a>.
</ul>

Adding a package is as easy as 
<code>pkg_add pkgname.tar.gz</code>.
If you are grabbing packages off a single source (a package repository),
set PKG_PATH to that repository URL. 

<p>
For instance, to install the gimp package for the 2.7 release on an i386
machine off the ftp site (including dependencies), do:

<pre>
    # setenv PKG_PATH ftp://ftp.openbsd.org/pub/OpenBSD/2.7/packages/i386/
    # pkg_add gimp-1.17.tar.gz
</pre>

<h3><font color=#0000e0>Managing installed packages</font></h3>

The <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=packages&sektion=7&format=html">packages(7)</a>.
manual page holds useful information about ways to manage
installed packages, solve conflicts (files that already exist) and handle
dependencies.
<p>
As of OpenBSD 2.7, to update a package you must:
<ul>
<li>Remove the old package using pkg_delete(1)
<li>Add the new package using pkg_add(1)
</ul>
This is slightly inconvenient, as packages may trigger dependencies, and 
you may have to remove a large subset of packages for an update.

<h3><font color=#0000e0>Using ports</font></h3>

If a given package does not exist for your architecture, you may still
be able to compile the port. Besides, some users will want to compile
everything from source for various reasons.

<p>
You can ftp the release version from the pub/OpenBSD/[version] (where
[version] is the release number) directory on any of the
<a href=ftp.html>ftp mirror sites</a>.
The release versions are the ones we ship on our CDROM, and have gone
through more testing than any snapshot.
Further information is available in the 
<a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ports&sektion=7&format=html">ports(7)</a> man page.

<h3><font color=#0000e0>Ports update for an OpenBSD release</font></h3>

<p>
The ports tree, like the rest of OpenBSD, is constantly changing.  
The normal life cycle of the ports tree is as follows:
<ul>
<li>Track the latest release of OpenBSD for a few months after the release
comes out.
<li>Switch to tracking OpenBSD-current about two months before the next
release.
</ul>
The change of status will be widely publicized on the 
<a href=mail.html>Mailing lists</a>.

<p>The ports tree works as a single entity. Updating a single directory is
not guaranteed to work, as package dependencies may force you to update
and recompile vast portions of the ports tree.
It is strongly suggested that people don't track ports-current unless
they're prepared to deal with various problems.
<a href=mail.html>Mailing lists</a> such as source-changes or tech will
probably be invaluable.

<p>
The ports-current tree can be retrieved via:
<ul>
<li><a href=anoncvs.html>Anonymous CVS</a> (see link).  The command is
essentially <strong>cvs get ports</strong>.
<li>Anonymous ftp from
<a href="ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/ports.tar.gz">
ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/ports.tar.gz</a>.
	This archive is updated nightly.
<li><a href="cvsup.html">CVSup</a>. See the example for using CVSup in
    <a href="cvsup.html#checkout">checkout mode</a>.
<li>Your web browser using the 
<a href="http://www.openbsd.org/cgi-bin/cvsweb/ports/">CVS
	web interface</a>.
</ul>

<h3><font color=#0000e0>Example use of the Ports tree</font></h3>

<p>
Let's say you managed to get a ports tree and you want to compile and
install the archiving utility <code>unzip</code>.  You should be able to
	do something like this:

<pre>
    % cd /usr/ports/archivers/unzip
    % su
    # make
    # make install
    # exit
</pre>

Easy, huh ? Especially considering all that happened in the background:
<ul>
<li>Fetch unzip sources from an ftp site,
<li>Check the source archive integrity,
<li>Extract the unzip source,
<li>Apply OpenBSD specific patches,
<li>Configure and build the program,
<li>Create a binary package under /usr/ports/packages,
<li>Install that package.
</ul>

<p>
In OpenBSD 2.7, a large proportion of the ports automatically build
packages when installing.  
In OpenBSD current, almost all ports follow that standard.

<p>
As ports get built, the /usr/ports/distfiles directory gets filled with 
program sources, and /usr/ports/packages gets filled with binary packages.  
Users with low connectivity may refer to mirror-distfiles(7) for 
an efficient way to grab all distfiles at once.
Note that the OpenBSD CD only include the ports tree and selected packages.
If you wish to have the distfiles, you will have to get them through an
independent way.

<h3><font color=#0000e0>Creating new ports</font></h3>
<p>
If you are interested in helping to expand the OpenBSD ports tree
you should first read <a href="porting.html">porting.html</a>.
That page references the porting section of the
<a href="http://www.freebsd.org/handbook/">FreeBSD handbook</a>
as well as OpenBSD specific policies and hints.

<h3><font color=#0000e0>Problems and contacts</font></h3>

<p>
If you have trouble with existing ports, or need information about creating new ports,
please send e-mail to the OpenBSD
ports mailing list, <a href="mailto:ports@openbsd.org">ports@openbsd.org</a>.
Corrections are always welcome, but in any case do please provide:
<ul>
<li>The output of <code>uname -a</code>,
<li>Your OpenBSD version, including any patches you may have applied,
<li>A complete description of the problem.

</ul>

<hr>
<a href="index.html"><img height=24 width=24 src=back.gif border=0 alt=OpenBSD></a> 
<a href=mailto:www@openbsd.org>www@openbsd.org</a>
<br><small>$OpenBSD: ports.html,v 1.32 2000/06/15 16:48:50 naddy Exp $</small>
</body>
</html>