Annotation of www/ports.html, Revision 1.38
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">
9:
1.27 brad 10: <title>OpenBSD Ports and Packages</title>
1.25 deraadt 11: <link rev="made" HREF="mailto:www@openbsd.org">
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>.
73: </ul>
74:
75: Adding a package is as easy as
1.36 brad 76: <code>pkg_add pkgname.tgz</code>.
1.31 espie 77: If you are grabbing packages off a single source (a package repository),
78: set PKG_PATH to that repository URL.
79:
80: <p>
81: For instance, to install the gimp package for the 2.7 release on an i386
82: machine off the ftp site (including dependencies), do:
83:
84: <pre>
85: # setenv PKG_PATH ftp://ftp.openbsd.org/pub/OpenBSD/2.7/packages/i386/
1.36 brad 86: # pkg_add gimp-1.1.17.tgz
1.31 espie 87: </pre>
88:
89: <h3><font color=#0000e0>Managing installed packages</font></h3>
90:
1.33 espie 91: The <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=packages&sektion=7&format=html">packages(7)</a>
1.31 espie 92: manual page holds useful information about ways to manage
93: installed packages, solve conflicts (files that already exist) and handle
94: dependencies.
95: <p>
96: As of OpenBSD 2.7, to update a package you must:
97: <ul>
1.33 espie 98: <li>Remove the old package using
99: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=pkg_delete&sektion=1&format=html">pkg_delete(1)</a>
100: <li>Add the new package using
101: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=pkg_add&sektion=1&format=html">pkg_add(1)</a>
1.31 espie 102: </ul>
103: This is slightly inconvenient, as packages may trigger dependencies, and
104: you may have to remove a large subset of packages for an update.
105:
106: <h3><font color=#0000e0>Using ports</font></h3>
107:
108: If a given package does not exist for your architecture, you may still
109: be able to compile the port. Besides, some users will want to compile
110: everything from source for various reasons.
111:
1.25 deraadt 112: <p>
1.27 brad 113: You can ftp the release version from the pub/OpenBSD/[version] (where
114: [version] is the release number) directory on any of the
115: <a href=ftp.html>ftp mirror sites</a>.
116: The release versions are the ones we ship on our CDROM, and have gone
117: through more testing than any snapshot.
1.30 espie 118: Further information is available in the
119: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ports&sektion=7&format=html">ports(7)</a> man page.
120:
121: <h3><font color=#0000e0>Ports update for an OpenBSD release</font></h3>
1.27 brad 122:
123: <p>
1.31 espie 124: The ports tree, like the rest of OpenBSD, is constantly changing.
1.30 espie 125: The normal life cycle of the ports tree is as follows:
126: <ul>
127: <li>Track the latest release of OpenBSD for a few months after the release
128: comes out.
129: <li>Switch to tracking OpenBSD-current about two months before the next
130: release.
131: </ul>
132: The change of status will be widely publicized on the
133: <a href=mail.html>Mailing lists</a>.
134:
1.37 marc 135: <p>
136: The current ports tree <strong>may not</strong> be used with the previous
137: release once the switch to tracking OpenBSD-current occurs. This is due
138: to changes, typically with the port make process, that require code
139: based upon the OpenBSD-current source tree. To get the latest version of
140: the ports tree that will work with the previous release:
141: <ul>
142: <li>Determine the cut-off date. Example, the cut-off between 2.7 and
143: 2.8 was indicated by a message to ports@openbsd.org on Aug 16, 2000.
144: <li>Check out a version of the ports tree as of the cut-off date. The
145: steps are (assuming your ports tree came from anoncvs and live in
146: /usr/ports):
147: <pre>
148: $ cd /usr/ports
149: $ cvs -q -d anoncvs@some.anon.server:/cvs up -D 08/15/00 -Pd
150: </pre>
151: Change the name of the server and cut-off date to fit your needs.
152: </ul>
1.38 ! marc 153: <p>
! 154: The ports that build with the 2.7 release have also been put into a
! 155: branch of their own. Instead of grabbing the ports by date you can:
! 156: <pre>
! 157: $ cd /usr/ports
! 158: $ cvs -q -d anoncvs@some.anon.server:/cvs up -r OPENBSD_2_7 -Pd
! 159: </pre>
! 160: The OPENBSD_2_7 tag does not imply these ports are in any way `stable', only
! 161: that the ports will build on a 2.7 system. Security fixes may be added
! 162: to this branch.
1.30 espie 163: <p>The ports tree works as a single entity. Updating a single directory is
164: not guaranteed to work, as package dependencies may force you to update
165: and recompile vast portions of the ports tree.
1.31 espie 166: It is strongly suggested that people don't track ports-current unless
1.30 espie 167: they're prepared to deal with various problems.
1.33 espie 168: <a href=mail.html>Mailing lists</a> such as
169: <code>source-changes@openbsd.org</code> or
170: <code>tech@openbsd.org</code> will probably be invaluable.
1.27 brad 171:
172: <p>
1.29 espie 173: The ports-current tree can be retrieved via:
1.25 deraadt 174: <ul>
175: <li><a href=anoncvs.html>Anonymous CVS</a> (see link). The command is
176: essentially <strong>cvs get ports</strong>.
177: <li>Anonymous ftp from
178: <a href="ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/ports.tar.gz">
179: ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/ports.tar.gz</a>.
1.19 marc 180: This archive is updated nightly.
1.32 naddy 181: <li><a href="cvsup.html">CVSup</a>. See the example for using CVSup in
182: <a href="cvsup.html#checkout">checkout mode</a>.
1.25 deraadt 183: <li>Your web browser using the
184: <a href="http://www.openbsd.org/cgi-bin/cvsweb/ports/">CVS
1.20 marc 185: web interface</a>.
1.25 deraadt 186: </ul>
187:
1.35 espie 188: <h3><font color=#0000e0>Ports and XFree</font></h3>
189: There is some special magic in the OpenBSD XFree configuration files
190: that allows the ports tree to install imake-based applications under
191: /usr/local.
192:
193: <p>OpenBSD currently does not ship with XFree 4.0.x for various reasons.
194: This ports magic does not work with the XFree 4.0.x distribution.
195: You will need to apply the patch in
196: <code>/usr/ports/infrastructure/patches/patch-xfree-4.0</code>
197: to a default binary XFree 4.0.x distribution for it to work with the OpenBSD
198: ports tree.
199:
1.25 deraadt 200: <h3><font color=#0000e0>Example use of the Ports tree</font></h3>
201:
202: <p>
203: Let's say you managed to get a ports tree and you want to compile and
1.33 espie 204: install the archiving utility <strong>unzip</strong>. You should be able to
1.23 espie 205: do something like this:
1.31 espie 206:
1.11 deraadt 207: <pre>
1.31 espie 208: % cd /usr/ports/archivers/unzip
209: % su
210: # make
211: # make install
212: # exit
1.11 deraadt 213: </pre>
1.25 deraadt 214:
1.31 espie 215: Easy, huh ? Especially considering all that happened in the background:
216: <ul>
217: <li>Fetch unzip sources from an ftp site,
218: <li>Check the source archive integrity,
219: <li>Extract the unzip source,
220: <li>Apply OpenBSD specific patches,
221: <li>Configure and build the program,
222: <li>Create a binary package under /usr/ports/packages,
223: <li>Install that package.
224: </ul>
1.25 deraadt 225:
226: <p>
1.31 espie 227: In OpenBSD 2.7, a large proportion of the ports automatically build
228: packages when installing.
229: In OpenBSD current, almost all ports follow that standard.
230:
231: <p>
232: As ports get built, the /usr/ports/distfiles directory gets filled with
233: program sources, and /usr/ports/packages gets filled with binary packages.
234: Users with low connectivity may refer to mirror-distfiles(7) for
235: an efficient way to grab all distfiles at once.
236: Note that the OpenBSD CD only include the ports tree and selected packages.
237: If you wish to have the distfiles, you will have to get them through an
238: independent way.
1.25 deraadt 239:
240: <h3><font color=#0000e0>Creating new ports</font></h3>
241: <p>
242: If you are interested in helping to expand the OpenBSD ports tree
243: you should first read <a href="porting.html">porting.html</a>.
244: That page references the porting section of the
245: <a href="http://www.freebsd.org/handbook/">FreeBSD handbook</a>
246: as well as OpenBSD specific policies and hints.
247:
248: <h3><font color=#0000e0>Problems and contacts</font></h3>
249:
250: <p>
1.31 espie 251: If you have trouble with existing ports, or need information about creating new ports,
252: please send e-mail to the OpenBSD
1.27 brad 253: ports mailing list, <a href="mailto:ports@openbsd.org">ports@openbsd.org</a>.
1.25 deraadt 254: Corrections are always welcome, but in any case do please provide:
255: <ul>
256: <li>The output of <code>uname -a</code>,
257: <li>Your OpenBSD version, including any patches you may have applied,
258: <li>A complete description of the problem.
259:
260: </ul>
261:
262: <hr>
263: <a href="index.html"><img height=24 width=24 src=back.gif border=0 alt=OpenBSD></a>
264: <a href=mailto:www@openbsd.org>www@openbsd.org</a>
1.38 ! marc 265: <br><small>$OpenBSD: ports.html,v 1.37 2000/09/07 22:19:45 marc Exp $</small>
1.25 deraadt 266: </body>
1.11 deraadt 267: </html>