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