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

Annotation of www/ports.html, Revision 1.72

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.62      horacio     9: <meta name="copyright" content="copyright 1997-2002 by OpenBSD.">
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:
1.68      jsyn       16: <a href="index.html"><img alt="[OpenBSD]" height="30" width="141" src="images/smalltitle.gif" border="0"></a>
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:
1.53      naddy      22: <h3><font color="#0000e0">Index</font></h3>
                     23: <ul>
                     24: <li><a href="#Motivation">Motivation</a></li>
                     25: <li><a href="#Get">Getting Packages</a></li>
                     26: <li><a href="#stable">Ports and Packages Update for an OpenBSD Release</a></li>
                     27: <li><a href="#Manage">Managing Installed Packages</a></li>
                     28: <li><a href="#Use">Using Ports</a></li>
                     29: <li><a href="#Life">Life Cycle of the Ports Tree</a></li>
                     30: <li><a href="#XFree86">Ports and XFree86</a></li>
1.55      heko       31: <li><a href="#Example">Example Use of the Ports Tree</a></li>
                     32: <li><a href="#Advanced">Advanced Usage of the Ports Tree</a></li>
1.53      naddy      33: <li><a href="#Create">Creating New Ports</a></li>
1.56      heko       34: <li><a href="#Lag">When a Port Is Lagging Behind the Mainstream Version</a></li>
1.53      naddy      35: <li><a href="#Help">Problems and Contacts</a></li>
                     36: </ul>
                     37:
                     38: <hr>
                     39:
                     40: <h3><font color="#0000e0"><a name="Motivation">Motivation</a></font></h3>
1.25      deraadt    41:
                     42: OpenBSD is a fairly complete system of its own, but still there is a lot
1.60      jcs        43: of software that one might want to see added. However, there is the problem
                     44: of where to draw the line as to what to include, as well as the occasional
1.25      deraadt    45: licensing and export restriction problems.  As OpenBSD is supposed to be
                     46: a small stand-alone UNIX-like operating system, some things just can't be
                     47: shipped with the system.
                     48:
                     49: <p>
1.47      naddy      50: <strong><font color="#e00000">
1.31      espie      51: The ports &amp; packages collection does NOT go through the thorough security audit that OpenBSD follows.
                     52: Although we strive to keep the quality of the packages collection high, we just do not have enough human
                     53: resources to ensure the same level of robustness and security.
                     54: </font></strong>
1.25      deraadt    55:
                     56: <p>
1.31      espie      57: The port collection, originally borrowed from
                     58: <a href="http://www.freebsd.org/">FreeBSD</a>, fills this gap.
                     59: The concept is to have, for each third-party software, a Makefile that
1.25      deraadt    60: controls
                     61: <ul>
                     62: <li>where to fetch it,
                     63: <li>how to do the fetch,
                     64: <li>what it depends upon (if anything),
                     65: <li>how to alter the sources (if needed),
                     66: <li>and how to configure, build and install it.
                     67: </ul>
                     68: This information is kept in a directory hierarchy under the
                     69: /usr/ports directory.
1.31      espie      70:
                     71: <p>
                     72: Packages are the binary equivalent of ports.  A compiled port becomes
1.55      heko       73: a package that can be registered into the system using
1.63      rohee      74: <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      75:
                     76: <p>
1.47      naddy      77: <strong><font color="#e00000">
1.36      brad       78: Packages look like simple <code>.tgz</code> bundles, but they should
1.33      espie      79: always be added using
1.47      naddy      80: <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      81: as there might be some extra information that only
1.47      naddy      82: <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      83: knows how to handle.</font></strong>
1.36      brad       84: Tip: you can distinguish between packages and <strong>.tgz</strong> bundles
1.33      espie      85: using
1.47      naddy      86: <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      87:
1.53      naddy      88: <h3><font color="#0000e0"><a name="Get">Getting Packages</a></font></h3>
1.31      espie      89:
                     90: A large collection of pre-compiled packages is available for most common
                     91: architectures.
                     92: <ul>
1.34      jufi       93: <li>On the CD-Rom (that you can order <a href="orders.html">here</a>),
1.31      espie      94: <li>On the <a href=ftp.html>ftp mirror sites</a>.
1.40      beck       95: <li>Browsed and retrieved from the web package lists:
                     96: <ul>
1.70      brad       97: <li><a href="http://www.openbsd.org/3.2_packages/">Packages for OpenBSD 3.2</a>
1.67      brad       98: <li><a href="http://www.openbsd.org/3.1_packages/">Packages for OpenBSD 3.1</a>
1.65      beck       99: <li><a href="http://www.openbsd.org/3.0_packages/">Packages for OpenBSD 3.0</a>
1.61      brad      100: <li><a href="http://www.openbsd.org/2.9_packages/">Packages for OpenBSD 2.9</a>
1.44      espie     101: <li><a href="http://www.openbsd.org/2.8_packages/">Packages for OpenBSD 2.8</a>
1.42      jufi      102: <li><a href="http://www.openbsd.org/2.7_packages/">Packages for OpenBSD 2.7</a>
1.40      beck      103: </ul>
1.31      espie     104: </ul>
                    105:
1.44      espie     106:
1.31      espie     107: Adding a package is as easy as
1.36      brad      108: <code>pkg_add pkgname.tgz</code>.
1.71      ian       109: If you are grabbing packages from a single source (a package repository),
1.39      espie     110: set PKG_PATH to that repository URL, in order to grab dependencies.
1.31      espie     111:
                    112: <p>
1.70      brad      113: For instance, to install the Gimp package for the 3.2 release on an i386
1.31      espie     114: machine off the ftp site (including dependencies), do:
                    115:
                    116: <pre>
1.70      brad      117:     # setenv PKG_PATH ftp://ftp.openbsd.org/pub/OpenBSD/3.2/packages/i386/
                    118:     # pkg_add ${PKG_PATH}gimp-1.2.3.tgz
1.31      espie     119: </pre>
                    120:
1.53      naddy     121: <h3><font color="#0000e0"><a name="stable">Ports and Packages Update for an OpenBSD Release</a></font></h3>
1.45      espie     122: <p>
                    123: The 2.7 release saw the introduction of a stable branch for the ports tree.
                    124: <p>
1.70      brad      125: For instance, to grab the stable branch for the 3.2 release:
1.45      espie     126: <pre>
                    127:     $ cd /usr/ports
1.70      brad      128:     $ cvs -q -d anoncvs@some.anon.server:/cvs up -r OPENBSD_3_2 -Pd
1.45      espie     129: </pre>
                    130: <p>
                    131: Starting with the 2.8 release, selected binary packages are also made
1.69      naddy     132: available.
1.46      espie     133: Please refer to the
1.45      espie     134: <a href="pkg-stable.html">stable packages page</a> to find out about
                    135: updated packages and important updates to the stable branch.
                    136: </p>
                    137: <p>
                    138: Package names are <strong>always</strong> changed in case of a package
                    139: update, to avoid any risk of confusion between a package from the release
                    140: and a bug-fixed package.
                    141: </p>
                    142:
1.53      naddy     143: <h3><font color="#0000e0"><a name="Manage">Managing Installed Packages</a></font></h3>
1.31      espie     144:
1.47      naddy     145: 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     146: manual page holds useful information about ways to manage
                    147: installed packages, solve conflicts (files that already exist) and handle
                    148: dependencies.
                    149: <p>
1.45      espie     150: As of OpenBSD 2.8, to update a package you must:
1.31      espie     151: <ul>
1.33      espie     152: <li>Remove the old package using
1.47      naddy     153: <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     154: <li>Add the new package using
1.47      naddy     155: <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     156: </ul>
                    157: This is slightly inconvenient, as packages may trigger dependencies, and
                    158: you may have to remove a large subset of packages for an update.
                    159:
1.53      naddy     160: <h3><font color="#0000e0"><a name="Use">Using Ports</a></font></h3>
1.31      espie     161:
                    162: If a given package does not exist for your architecture, you may still
                    163: be able to compile the port. Besides, some users will want to compile
                    164: everything from source for various reasons.
                    165:
1.25      deraadt   166: <p>
1.27      brad      167: You can ftp the release version from the pub/OpenBSD/[version] (where
                    168: [version] is the release number) directory on any of the
                    169: <a href=ftp.html>ftp mirror sites</a>.
                    170: The release versions are the ones we ship on our CDROM, and have gone
                    171: through more testing than any snapshot.
1.30      espie     172: Further information is available in the
1.47      naddy     173: <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     174:
1.53      naddy     175: <h3><font color="#0000e0"><a name="Life">Life Cycle of the Ports Tree</A></font></h3>
1.27      brad      176:
                    177: <p>
1.31      espie     178: The ports tree, like the rest of OpenBSD, is constantly changing.
1.37      marc      179: <p>
                    180: The current ports tree <strong>may not</strong> be used with the previous
1.59      espie     181: release.  This is due to changes, typically with the port make process,
                    182: that require code based upon the OpenBSD-current source tree.
1.30      espie     183: <p>The ports tree works as a single entity. Updating a single directory is
                    184: not guaranteed to work, as package dependencies may force you to update
                    185: and recompile vast portions of the ports tree.
1.31      espie     186: It is strongly suggested that people don't track ports-current unless
1.30      espie     187: they're prepared to deal with various problems.
1.33      espie     188: <a href=mail.html>Mailing lists</a> such as
1.47      naddy     189: <code>ports-changes@openbsd.org</code> or
1.33      espie     190: <code>tech@openbsd.org</code> will probably be invaluable.
1.27      brad      191:
1.59      espie     192: <p>You are advised to track ports-stable on a production machine:
                    193: we will try to keep the stable ports tree up-to-par with respect to
                    194: problems, and to provide timely binary updates as well.
                    195:
                    196: <p>Note that vanishing distfiles is not an issue, as
                    197: ftp.openbsd.org holds the complete repository. Even changing checksums is
                    198: not an issue: you can issue the command
                    199: <pre>
                    200:        make checksum REFETCH=true
                    201: </pre>
                    202: to make sure you are grabbing the correct distfile for your ports tree.
                    203:
                    204: For definitions of <i>current</i> and <i>stable</i>, see the
                    205: <a href="faq/upgrade-minifaq.html#1.1">Upgrade
                    206: Mini-FAQ</a>.
                    207:
                    208:
1.48      naddy     209: <p>A list of <a href="portsplus/index.html">daily changes</a> to ports
1.47      naddy     210: and ports-current is available.
                    211:
1.27      brad      212: <p>
1.29      espie     213: The ports-current tree can be retrieved via:
1.25      deraadt   214: <ul>
                    215: <li><a href=anoncvs.html>Anonymous CVS</a> (see link).  The command is
                    216: essentially <strong>cvs get ports</strong>.
                    217: <li>Anonymous ftp from
                    218: <a href="ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/ports.tar.gz">
                    219: ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/ports.tar.gz</a>.
1.19      marc      220:        This archive is updated nightly.
1.32      naddy     221: <li><a href="cvsup.html">CVSup</a>. See the example for using CVSup in
                    222:     <a href="cvsup.html#checkout">checkout mode</a>.
1.25      deraadt   223: <li>Your web browser using the
                    224: <a href="http://www.openbsd.org/cgi-bin/cvsweb/ports/">CVS
1.20      marc      225:        web interface</a>.
1.25      deraadt   226: </ul>
                    227:
1.53      naddy     228: <h3><font color="#0000e0"><a name="XFree86">Ports and XFree86</a></font></h3>
                    229: There is some special magic in the OpenBSD XFree86 configuration files
1.35      espie     230: that allows the ports tree to install imake-based applications under
                    231: /usr/local.
                    232:
1.53      naddy     233: <p>As of 2.9, OpenBSD ships with XFree86 4.0.3.
                    234: If you are using a previous distribution, together with XFree86 binaries
                    235: from the XFree86 project, you may need to apply the patch in
1.35      espie     236: <code>/usr/ports/infrastructure/patches/patch-xfree-4.0</code>
1.53      naddy     237: to a default binary XFree86 4.0.x distribution for it to work with the OpenBSD
1.35      espie     238: ports tree.
                    239:
1.55      heko      240: <h3><a name="Example"></a><font color="#0000e0">Example Use of the Ports Tree</font></h3>
1.54      lebel     241:
                    242: <p>
1.25      deraadt   243: Let's say you managed to get a ports tree and you want to compile and
1.33      espie     244: install the archiving utility <strong>unzip</strong>.  You should be able to
1.23      espie     245:        do something like this:
1.31      espie     246:
1.11      deraadt   247: <pre>
1.31      espie     248:     % cd /usr/ports/archivers/unzip
                    249:     % su
                    250:     # make
                    251:     # make install
                    252:     # exit
1.11      deraadt   253: </pre>
1.25      deraadt   254:
1.31      espie     255: Easy, huh ? Especially considering all that happened in the background:
                    256: <ul>
                    257: <li>Fetch unzip sources from an ftp site,
                    258: <li>Check the source archive integrity,
                    259: <li>Extract the unzip source,
                    260: <li>Apply OpenBSD specific patches,
                    261: <li>Configure and build the program,
                    262: <li>Create a binary package under /usr/ports/packages,
                    263: <li>Install that package.
                    264: </ul>
1.25      deraadt   265:
                    266: <p>
1.61      brad      267: With OpenBSD 3.0, almost all ports automatically build
1.31      espie     268: packages when installing.
                    269:
                    270: <p>
                    271: As ports get built, the /usr/ports/distfiles directory gets filled with
                    272: program sources, and /usr/ports/packages gets filled with binary packages.
1.55      heko      273: Users with low connectivity may refer to
1.64      rohee     274: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=mirroring-ports&amp;sektion=7&amp;format=html">mirroring-ports(7)</a> for
1.45      espie     275: an efficient way to grab all distfiles at once.  In OpenBSD-current, you
1.46      espie     276: can use the script /usr/ports/infrastructure/fetch/clean-old to track
                    277: old distfiles.
1.72    ! avsm      278: Note that the OpenBSD CD only includes the ports tree and selected packages.
1.31      espie     279: If you wish to have the distfiles, you will have to get them through an
                    280: independent way.
1.25      deraadt   281:
1.55      heko      282: <h3><font color="#0000e0"><a name="Advanced"></a>Advanced Usage of the Ports Tree</font></h3>
                    283:
                    284: <p>
                    285: Ports tree has many features for the advanced user that make it a valuable
                    286: tool beyond basic installation. Advanced users may wish to tamper with
                    287: the makefiles (you should read the
1.63      rohee     288: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=make&amp;sektion=1&amp;format=html">make(1)</a>
1.72    ! avsm      289: manual page first) or set various variables from the make command-line or in
1.55      heko      290: <tt>/etc/mk.conf</tt>. These variables are described in detail in the
1.63      rohee     291: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=bsd.port.mk&amp;sektion=5&amp;format=html">bsd.port.mk(5)</a>
1.55      heko      292: manual page, and the porting documents below.
                    293: </p>
                    294:
1.53      naddy     295: <h3><font color="#0000e0"><a name="Create">Creating New Ports</a></font></h3>
1.25      deraadt   296: <p>
                    297: If you are interested in helping to expand the OpenBSD ports tree
                    298: you should first read <a href="porting.html">porting.html</a>.
1.50      naddy     299: That page references the
1.66      jufi      300: <a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/index.html">
                    301: FreeBSD Porter's Handbook</a>
1.25      deraadt   302: as well as OpenBSD specific policies and hints.
1.56      heko      303:
                    304: <h3><font color="#0000e0"><a name="Lag">When a Port Is Lagging Behind the Mainstream Version</a></font></h3>
                    305:
                    306: <p>
                    307: The ports collection is a volunteer project. Sometimes the project simply
                    308: doesn't have the developer resources to keep everything up-to-date.
                    309: Developers pretty much pick up what they consider interesting and can
                    310: test in their environment. Your <a href="goals.html#funding">donations</a>
                    311: count for what platforms the ports can be tested on.
                    312: </p>
                    313:
                    314: <p>
                    315: Some individual ports may lag behind the mainstream versions because of this.
                    316: The ports collection may have a version back of a program from January while a new
                    317: version of the program has been released by its developers in May three months ago.
                    318: Often this is a conscious decision; the new version may have problems in it on
                    319: OpenBSD that the maintainer is trying to solve, or that have simply made the
                    320: application worse than the old version: OpenBSD may have different
                    321: <a href="goals.html">goals</a> than the mainstream developers in other projects,
                    322: which sometimes results in features and design or implementation choices
                    323: that are undesirable from OpenBSD developers' point of view. The update may also be
                    324: postponed because the new version is not considered a crucial update.
                    325: </p>
                    326:
                    327: <p>
                    328: If you really need a new version of a port, you should ask the <tt>MAINTAINER</tt>
                    329: of the port to update the port (see <a href="#Help">below</a> on how to find out who
                    330: the maintainer is); if you can send patches for this, all the better. To create proper
                    331: patches, you should refer to the <a href="porting.html">documentation on building
                    332: ports</a>.
                    333: </p>
1.25      deraadt   334:
1.53      naddy     335: <h3><font color="#0000e0"><a name="Help">Problems and Contacts</a></font></h3>
1.25      deraadt   336:
                    337: <p>
1.54      lebel     338: If you have trouble with an existing port, please send e-mail to the
                    339: port maintainer. To see who is the maintainer of the port, type, for
                    340: example:
                    341: <pre>
                    342:        % cd /usr/ports/archivers/unzip
                    343:        % make show VARNAME=MAINTAINER
                    344: </pre>
                    345: Alternatively, if there is no maintainer, or you can't reach
                    346: him/her, send mail to the OpenBSD
1.27      brad      347: ports mailing list, <a href="mailto:ports@openbsd.org">ports@openbsd.org</a>.
1.54      lebel     348: Please don't use the misc@openbsd.org mailing list for questions about ports.
1.25      deraadt   349: Corrections are always welcome, but in any case do please provide:
                    350: <ul>
                    351: <li>The output of <code>uname -a</code>,
                    352: <li>Your OpenBSD version, including any patches you may have applied,
                    353: <li>A complete description of the problem.
1.45      espie     354: </ul>
                    355: For ports that don't build correctly, a complete build transcript is almost
1.54      lebel     356: always required. You can use the portslogger script, found in
                    357: /usr/ports/infrastructure/build, for this. A sample run of portslogger
                    358: might be:
                    359:
                    360: <pre>
                    361:        % cd /usr/ports/archivers/unzip
                    362:        % su
                    363:        # mkdir -p ~/portslogs
1.63      rohee     364:        # make clean install 2>&amp;1 | /usr/ports/infrastructure/build/portslogger \
1.54      lebel     365:                ~/portslogs
                    366: </pre>
                    367:
                    368: After this, you should have a logfile of the build in your ~/portslogs directory
                    369: that you can send to the port maintainer. Also, make sure you are not using
                    370: any special options in your build, for example in /etc/mk.conf.
                    371:
                    372: <p>
                    373: Alternatively, you can
1.45      espie     374: <ul>
1.47      naddy     375: <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.
                    376:     <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.
                    377:     <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     378: the gcc mailing-list. It does save time if you follow their direction, and
                    379: provide at least the various files produced by <tt>gcc -save-temps</tt>.
1.25      deraadt   380: </ul>
                    381:
                    382: <hr>
                    383: <a href="index.html"><img height=24 width=24 src=back.gif border=0 alt=OpenBSD></a>
1.47      naddy     384: <a href="mailto:www@openbsd.org">www@openbsd.org</a>
1.72    ! avsm      385: <br><small>$OpenBSD: ports.html,v 1.71 2002/12/10 00:29:07 ian Exp $</small>
1.25      deraadt   386: </body>
1.11      deraadt   387: </html>