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