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