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

Annotation of www/ports.html, Revision 1.88

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