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

Annotation of www/ports.html, Revision 1.50

1.47      naddy       1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
1.11      deraadt     2: <html>
1.25      deraadt     3: <head>
                      4: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
                      5: <meta name="resource-type" content="document">
1.47      naddy       6: <meta name="description" content="The OpenBSD Ports and Packages Collection">
1.25      deraadt     7: <meta name="keywords" content="openbsd,ports">
                      8: <meta name="distribution" content="global">
1.47      naddy       9: <meta name="copyright" content="copyright 1997-2001 by the OpenBSD project">
1.27      brad       10: <title>OpenBSD Ports and Packages</title>
1.47      naddy      11: <link rev="made" href="mailto:www@openbsd.org">
1.43      jufi       12: </head>
1.25      deraadt    13:
                     14: <body text="#000000" bgcolor="#FFFFFF" link="#23238E">
                     15:
                     16: <img height=30 width=141 src=images/smalltitle.gif alt="[OpenBSD]" >
1.30      espie      17:
1.47      naddy      18: <h2><font color="#e00000">The Ports &amp; Packages collection</font></h2>
1.25      deraadt    19:
1.47      naddy      20: <hr>
                     21:
                     22: <h3><font color="#0000e0">Motivation</font></h3>
1.25      deraadt    23:
                     24: OpenBSD is a fairly complete system of its own, but still there is a lot
                     25: of software that one might want see added. However there is the problem
                     26: on where to draw the line as to what to include, as well as the occasional
                     27: licensing and export restriction problems.  As OpenBSD is supposed to be
                     28: a small stand-alone UNIX-like operating system, some things just can't be
                     29: shipped with the system.
                     30:
                     31: <p>
1.47      naddy      32: <strong><font color="#e00000">
1.31      espie      33: The ports &amp; packages collection does NOT go through the thorough security audit that OpenBSD follows.
                     34: Although we strive to keep the quality of the packages collection high, we just do not have enough human
                     35: resources to ensure the same level of robustness and security.
                     36: </font></strong>
1.25      deraadt    37:
                     38: <p>
1.31      espie      39: The port collection, originally borrowed from
                     40: <a href="http://www.freebsd.org/">FreeBSD</a>, fills this gap.
                     41: The concept is to have, for each third-party software, a Makefile that
1.25      deraadt    42: controls
                     43: <ul>
                     44: <li>where to fetch it,
                     45: <li>how to do the fetch,
                     46: <li>what it depends upon (if anything),
                     47: <li>how to alter the sources (if needed),
                     48: <li>and how to configure, build and install it.
                     49: </ul>
                     50: This information is kept in a directory hierarchy under the
                     51: /usr/ports directory.
1.31      espie      52:
                     53: <p>
                     54: Packages are the binary equivalent of ports.  A compiled port becomes
                     55: a package that can be registered into the system using pkg_add(1).
                     56:
                     57: <p>
1.47      naddy      58: <strong><font color="#e00000">
1.36      brad       59: Packages look like simple <code>.tgz</code> bundles, but they should
1.33      espie      60: always be added using
1.47      naddy      61: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=pkg_add&amp;sektion=1&amp;format=html">pkg_add(1)</a>,
1.33      espie      62: as there might be some extra information that only
1.47      naddy      63: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=pkg_add&amp;sektion=1&amp;format=html">pkg_add(1)</a>
1.33      espie      64: knows how to handle.</font></strong>
1.36      brad       65: Tip: you can distinguish between packages and <strong>.tgz</strong> bundles
1.33      espie      66: using
1.47      naddy      67: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=pkg_info&amp;sektion=1&amp;format=html">pkg_info(1)</a>.
1.31      espie      68:
1.47      naddy      69: <h3><font color="#0000e0">Getting packages</font></h3>
1.31      espie      70:
                     71: A large collection of pre-compiled packages is available for most common
                     72: architectures.
                     73: <ul>
1.34      jufi       74: <li>On the CD-Rom (that you can order <a href="orders.html">here</a>),
1.31      espie      75: <li>On the <a href=ftp.html>ftp mirror sites</a>.
1.40      beck       76: <li>Browsed and retrieved from the web package lists:
                     77: <ul>
1.44      espie      78: <li><a href="http://www.openbsd.org/2.8_packages/">Packages for OpenBSD 2.8</a>
1.42      jufi       79: <li><a href="http://www.openbsd.org/2.7_packages/">Packages for OpenBSD 2.7</a>
1.40      beck       80: </ul>
1.31      espie      81: </ul>
                     82:
1.44      espie      83:
1.31      espie      84: Adding a package is as easy as
1.36      brad       85: <code>pkg_add pkgname.tgz</code>.
1.31      espie      86: If you are grabbing packages off a single source (a package repository),
1.39      espie      87: set PKG_PATH to that repository URL, in order to grab dependencies.
1.31      espie      88:
                     89: <p>
1.45      espie      90: For instance, to install the gimp package for the 2.8 release on an i386
1.31      espie      91: machine off the ftp site (including dependencies), do:
                     92:
                     93: <pre>
1.45      espie      94:     # setenv PKG_PATH ftp://ftp.openbsd.org/pub/OpenBSD/2.8/packages/i386/
                     95:     # pkg_add ${PKG_PATH}gimp-1.1.27.tgz
1.31      espie      96: </pre>
                     97:
1.47      naddy      98: <h3><a name="stable"><font color="#0000e0">Ports and packages update for an OpenBSD release</font></a></h3>
1.45      espie      99: <p>
                    100: The 2.7 release saw the introduction of a stable branch for the ports tree.
                    101: <p>
                    102: For instance, to grab the stable branch for the 2.8 release:
                    103: <pre>
                    104:     $ cd /usr/ports
                    105:     $ cvs -q -d anoncvs@some.anon.server:/cvs up -r OPENBSD_2_8 -Pd
                    106: </pre>
                    107: <p>
                    108: Starting with the 2.8 release, selected binary packages are also made
1.46      espie     109: available.  Thanks to
                    110: <a href="mailto:naddy@openbsd.org">Christian Weisgerber</a> for
                    111: handling the hard work of coordinating the stable branch changes.
                    112: Please refer to the
1.45      espie     113: <a href="pkg-stable.html">stable packages page</a> to find out about
                    114: updated packages and important updates to the stable branch.
                    115: </p>
                    116: <p>
                    117: Package names are <strong>always</strong> changed in case of a package
                    118: update, to avoid any risk of confusion between a package from the release
                    119: and a bug-fixed package.
                    120: </p>
                    121:
1.47      naddy     122: <h3><font color="#0000e0">Managing installed packages</font></h3>
1.31      espie     123:
1.47      naddy     124: The <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=packages&amp;sektion=7&amp;format=html">packages(7)</a>
1.31      espie     125: manual page holds useful information about ways to manage
                    126: installed packages, solve conflicts (files that already exist) and handle
                    127: dependencies.
                    128: <p>
1.45      espie     129: As of OpenBSD 2.8, to update a package you must:
1.31      espie     130: <ul>
1.33      espie     131: <li>Remove the old package using
1.47      naddy     132: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=pkg_delete&amp;sektion=1&amp;format=html">pkg_delete(1)</a>
1.33      espie     133: <li>Add the new package using
1.47      naddy     134: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=pkg_add&amp;sektion=1&amp;format=html">pkg_add(1)</a>
1.31      espie     135: </ul>
                    136: This is slightly inconvenient, as packages may trigger dependencies, and
                    137: you may have to remove a large subset of packages for an update.
                    138:
1.47      naddy     139: <h3><font color="#0000e0">Using ports</font></h3>
1.31      espie     140:
                    141: If a given package does not exist for your architecture, you may still
                    142: be able to compile the port. Besides, some users will want to compile
                    143: everything from source for various reasons.
                    144:
1.25      deraadt   145: <p>
1.27      brad      146: You can ftp the release version from the pub/OpenBSD/[version] (where
                    147: [version] is the release number) directory on any of the
                    148: <a href=ftp.html>ftp mirror sites</a>.
                    149: The release versions are the ones we ship on our CDROM, and have gone
                    150: through more testing than any snapshot.
1.30      espie     151: Further information is available in the
1.47      naddy     152: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ports&amp;sektion=7&amp;format=html">ports(7)</a> man page.
1.30      espie     153:
1.47      naddy     154: <h3><font color="#0000e0">Life cycle of the ports tree</font></h3>
1.27      brad      155:
                    156: <p>
1.31      espie     157: The ports tree, like the rest of OpenBSD, is constantly changing.
1.30      espie     158: The normal life cycle of the ports tree is as follows:
                    159: <ul>
                    160: <li>Track the latest release of OpenBSD for a few months after the release
                    161: comes out.
                    162: <li>Switch to tracking OpenBSD-current about two months before the next
                    163: release.
                    164: </ul>
                    165: The change of status will be widely publicized on the
1.47      naddy     166: <a href=mail.html>mailing lists</a>.
1.30      espie     167:
1.37      marc      168: <p>
                    169: The current ports tree <strong>may not</strong> be used with the previous
                    170: release once the switch to tracking OpenBSD-current occurs.  This is due
                    171: to changes, typically with the port make process, that require code
1.45      espie     172: based upon the OpenBSD-current source tree.
1.30      espie     173: <p>The ports tree works as a single entity. Updating a single directory is
                    174: not guaranteed to work, as package dependencies may force you to update
                    175: and recompile vast portions of the ports tree.
1.31      espie     176: It is strongly suggested that people don't track ports-current unless
1.30      espie     177: they're prepared to deal with various problems.
1.33      espie     178: <a href=mail.html>Mailing lists</a> such as
1.47      naddy     179: <code>ports-changes@openbsd.org</code> or
1.33      espie     180: <code>tech@openbsd.org</code> will probably be invaluable.
1.27      brad      181:
1.48      naddy     182: <p>A list of <a href="portsplus/index.html">daily changes</a> to ports
1.47      naddy     183: and ports-current is available.
                    184:
1.27      brad      185: <p>
1.29      espie     186: The ports-current tree can be retrieved via:
1.25      deraadt   187: <ul>
                    188: <li><a href=anoncvs.html>Anonymous CVS</a> (see link).  The command is
                    189: essentially <strong>cvs get ports</strong>.
                    190: <li>Anonymous ftp from
                    191: <a href="ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/ports.tar.gz">
                    192: ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/ports.tar.gz</a>.
1.19      marc      193:        This archive is updated nightly.
1.32      naddy     194: <li><a href="cvsup.html">CVSup</a>. See the example for using CVSup in
                    195:     <a href="cvsup.html#checkout">checkout mode</a>.
1.25      deraadt   196: <li>Your web browser using the
                    197: <a href="http://www.openbsd.org/cgi-bin/cvsweb/ports/">CVS
1.20      marc      198:        web interface</a>.
1.25      deraadt   199: </ul>
                    200:
1.47      naddy     201: <h3><font color="#0000e0">Ports and XFree</font></h3>
1.35      espie     202: There is some special magic in the OpenBSD XFree configuration files
                    203: that allows the ports tree to install imake-based applications under
                    204: /usr/local.
                    205:
1.49      espie     206: <p>As of 2.9, OpenBSD ships with XFree 4.0.3.
                    207: If you are using a previous distribution, together with XFree binaries
                    208: from the XFree project, you may need to apply the patch in
1.35      espie     209: <code>/usr/ports/infrastructure/patches/patch-xfree-4.0</code>
                    210: to a default binary XFree 4.0.x distribution for it to work with the OpenBSD
                    211: ports tree.
                    212:
1.47      naddy     213: <h3><font color="#0000e0">Example use of the Ports tree</font></h3>
1.25      deraadt   214:
                    215: <p>
                    216: Let's say you managed to get a ports tree and you want to compile and
1.33      espie     217: install the archiving utility <strong>unzip</strong>.  You should be able to
1.23      espie     218:        do something like this:
1.31      espie     219:
1.11      deraadt   220: <pre>
1.31      espie     221:     % cd /usr/ports/archivers/unzip
                    222:     % su
                    223:     # make
                    224:     # make install
                    225:     # exit
1.11      deraadt   226: </pre>
1.25      deraadt   227:
1.31      espie     228: Easy, huh ? Especially considering all that happened in the background:
                    229: <ul>
                    230: <li>Fetch unzip sources from an ftp site,
                    231: <li>Check the source archive integrity,
                    232: <li>Extract the unzip source,
                    233: <li>Apply OpenBSD specific patches,
                    234: <li>Configure and build the program,
                    235: <li>Create a binary package under /usr/ports/packages,
                    236: <li>Install that package.
                    237: </ul>
1.25      deraadt   238:
                    239: <p>
1.45      espie     240: With OpenBSD 2.8, almost all ports automatically build
1.31      espie     241: packages when installing.
                    242:
                    243: <p>
                    244: As ports get built, the /usr/ports/distfiles directory gets filled with
                    245: program sources, and /usr/ports/packages gets filled with binary packages.
                    246: Users with low connectivity may refer to mirror-distfiles(7) for
1.45      espie     247: an efficient way to grab all distfiles at once.  In OpenBSD-current, you
1.46      espie     248: can use the script /usr/ports/infrastructure/fetch/clean-old to track
                    249: old distfiles.
1.31      espie     250: Note that the OpenBSD CD only include the ports tree and selected packages.
                    251: If you wish to have the distfiles, you will have to get them through an
                    252: independent way.
1.25      deraadt   253:
1.47      naddy     254: <h3><font color="#0000e0">Creating new ports</font></h3>
1.25      deraadt   255: <p>
                    256: If you are interested in helping to expand the OpenBSD ports tree
                    257: you should first read <a href="porting.html">porting.html</a>.
1.50    ! naddy     258: That page references the
        !           259: <a href="http://www.freebsd.org/porters-handbook/">FreeBSD Porter's Handbook</a>
1.25      deraadt   260: as well as OpenBSD specific policies and hints.
                    261:
1.47      naddy     262: <h3><font color="#0000e0">Problems and contacts</font></h3>
1.25      deraadt   263:
                    264: <p>
1.31      espie     265: If you have trouble with existing ports, or need information about creating new ports,
                    266: please send e-mail to the OpenBSD
1.27      brad      267: ports mailing list, <a href="mailto:ports@openbsd.org">ports@openbsd.org</a>.
1.25      deraadt   268: Corrections are always welcome, but in any case do please provide:
                    269: <ul>
                    270: <li>The output of <code>uname -a</code>,
                    271: <li>Your OpenBSD version, including any patches you may have applied,
                    272: <li>A complete description of the problem.
1.45      espie     273: </ul>
                    274: For ports that don't build correctly, a complete build transcript is almost
                    275: always required. Some ports may have configuration issues linked to what
                    276: is already on your machine.
                    277: <ul>
1.47      naddy     278: <li>Use <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=script&amp;sektion=1&amp;format=html">script(1)</a> to create a complete build transcript. Don't remove the configure information.
                    279:     <li>Attach the output of <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=pkg_info&amp;sektion=1&amp;format=html">pkg_info(1)</a> if it seems even remotely relevant.
                    280:     <li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=gcc&amp;sektion=1&amp;format=html">gcc(1)</a> internal  compiler errors do ask you to report the bug to
1.45      espie     281: the gcc mailing-list. It does save time if you follow their direction, and
                    282: provide at least the various files produced by <tt>gcc -save-temps</tt>.
1.25      deraadt   283: </ul>
                    284:
                    285: <hr>
                    286: <a href="index.html"><img height=24 width=24 src=back.gif border=0 alt=OpenBSD></a>
1.47      naddy     287: <a href="mailto:www@openbsd.org">www@openbsd.org</a>
1.50    ! naddy     288: <br><small>$OpenBSD: ports.html,v 1.49 2001/05/03 15:29:27 espie Exp $</small>
1.25      deraadt   289: </body>
1.11      deraadt   290: </html>