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

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

Revision 1.39, Tue Sep 19 18:44:23 2000 UTC (23 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.38: +3 -3 lines

Give a pkg_add example that works.

<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>.tgz</code> bundles, but they should 
always be added using 
<a href="http://www.openbsd.org/cgi-bin/man.cgi?query=pkg_add&sektion=1&format=html">pkg_add(1)</a>, 
as there might be some extra information that only
<a href="http://www.openbsd.org/cgi-bin/man.cgi?query=pkg_add&sektion=1&format=html">pkg_add(1)</a> 
knows how to handle.</font></strong>
Tip: you can distinguish between packages and <strong>.tgz</strong> bundles 
using 
<a href="http://www.openbsd.org/cgi-bin/man.cgi?query=pkg_info&sektion=1&format=html">pkg_info(1)</a>.

<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 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.tgz</code>.
If you are grabbing packages off a single source (a package repository),
set PKG_PATH to that repository URL, in order to grab dependencies.

<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 ${PKG_PATH}gimp-1.1.17.tgz
</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 
<a href="http://www.openbsd.org/cgi-bin/man.cgi?query=pkg_delete&sektion=1&format=html">pkg_delete(1)</a> 
<li>Add the new package using 
<a href="http://www.openbsd.org/cgi-bin/man.cgi?query=pkg_add&sektion=1&format=html">pkg_add(1)</a> 
</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 current ports tree <strong>may not</strong> be used with the previous
release once the switch to tracking OpenBSD-current occurs.  This is due
to changes, typically with the port make process, that require code
based upon the OpenBSD-current source tree.   To get the latest version of
the ports tree that will work with the previous release:
<ul>
<li>Determine the cut-off date.   Example, the cut-off between 2.7 and
    2.8 was indicated by a message to ports@openbsd.org on Aug 16, 2000.
<li>Check out a version of the ports tree as of the cut-off date.  The
    steps are (assuming your ports tree came from anoncvs and live in
    /usr/ports):
<pre>
    $ cd /usr/ports
    $ cvs -q -d anoncvs@some.anon.server:/cvs up -D 08/15/00 -Pd
</pre>
    Change the name of the server and cut-off date to fit your needs.
</ul>
<p>
The ports that build with the 2.7 release have also been put into a
branch of their own.  Instead of grabbing the ports by date you can:
<pre>
    $ cd /usr/ports
    $ cvs -q -d anoncvs@some.anon.server:/cvs up -r OPENBSD_2_7 -Pd
</pre>
The OPENBSD_2_7 tag does not imply these ports are in any way `stable', only
that the ports will build on a 2.7 system.  Security fixes may be added
to this branch.
<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
<code>source-changes@openbsd.org</code> or
<code>tech@openbsd.org</code> 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>Ports and XFree</font></h3>
There is some special magic in the OpenBSD XFree configuration files
that allows the ports tree to install imake-based applications under
/usr/local.

<p>OpenBSD currently does not ship with XFree 4.0.x for various reasons. 
This ports magic does not work with the XFree 4.0.x distribution. 
You will need to apply the patch in
<code>/usr/ports/infrastructure/patches/patch-xfree-4.0</code>
to a default binary XFree 4.0.x distribution for it to work with the OpenBSD
ports tree.

<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 <strong>unzip</strong>.  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.39 2000/09/19 18:44:23 espie Exp $</small>
</body>
</html>