dnl $OpenBSD: packages,v 1.40 2005/03/18 13:30:28 miod Exp $ As complete as your OpenBSD system is, you may want to add any of several excellent third party software applications. There are several ways to do this. You can: 1) Obtain the source code and build the application based upon whatever installation procedures are provided with the application. 2) Use the OpenBSD ``ports'' collection to automatically get any needed source file, apply any required patches, create the application, and install it for you. 3) Use the OpenBSD ``package'' collection to grab a pre-compiled and tested version of the application for your hardware. If you purchased the OpenBSD CD-ROM set you already have several popular ``packages'', and the ``ports'' collection. Instructions for installing applications from the various sources using the different installation methods follow. You should also refer to the packages(7) manual page. Installing applications from the CD-ROM package collection: The OpenBSD CD-ROM ships with several applications pre-built for various hardware architectures. The number of applications vary according to available disk space. Check the directory OSREV/packages/MACHINE_ARCH to see which packages are available for your hardware architecture. That directory will be on the same CD-ROM containing the OS installation files for your architecture. To install one or more of these packages you must: 1) become the superuser (root). 2) mount the appropriate CD-ROM. 3) use the ``pkg_add'' command to install the software. Example (in which we use su(1) to get superuser privileges, thus you have to be in group "wheel", see the manual page for su(1)). $ su Password: # mkdir -p /cdrom # mount /dev/cd0a /cdrom {:-#-:} pkg_add /cdrom/OSREV/packages/MACHINE_ARCH/ # # umount /cdrom Package names are usually the application name and version with .tgz appended, e.g. emacs-21.3.tgz Installing applications from the ftp.OpenBSD.org package collection: All available packages for your architecture have been placed on ftp.OpenBSD.org in the directory pub/OpenBSD/OSREV/packages/MACHINE_ARCH/ You may want to peruse this to see what packages are available. The packages are also on the OpenBSD FTP mirror sites. See http://www.OpenBSD.org/ftp.html for a list of current FTP mirror sites. Installation of a package is very easy. 1) become the superuser (root) 2) use the ``pkg_add'' command to install the software ``pkg_add'' is smart enough to know how to download the software from the OpenBSD FTP server. Example: $ su Password: # pkg_add \ ftp://ftp.OpenBSD.org/pub/OpenBSD/{:--:}OSREV/packages/MACHINE_ARCH/emacs-21.3.tgz Installing applications from the CD-ROM ports collection: The CD-ROM ``ports'' collection is a set of Makefiles, patches, and other files used to control the building and installation of an application from source files. Creating an application from sources can require a lot of disk space, sometimes 50 megabytes or more. The first step is to determine which of your disks has enough room. Once you've made this determination, read the file PORTS located on the CD-ROM which contains the ports tree. To build an application you must: 1) become the superuser (root) 2) have network access, or obtain the actual source files by some other means. 3) cd to the ports directory containing the port you wish to build. To build samba, for example, where you'd previously copied the ports files into the /usr/ports directory: cd /usr/ports/net/samba 4) make 5) make install 6) make clean Installing applications from the OpenBSD ports collection: See http://www.OpenBSD.org/ports.html for current instructions on obtaining and installing OpenBSD ports. You should also refer to the ports(7) manual page. dnl dnl If this architecture is also supported under FreeBSD or NetBSD, define dnl text that tells which ports collection you can try to tinker with. dnl define({:-PORTS-:}, {:-ifelse( MACHINE_ARCH,alpha,{:-FreeBSD ports or NetBSD pkgsrc-:}, MACHINE_ARCH,amd64,{:-FreeBSD ports or NetBSD pkgsrc-:}, MACHINE_ARCH,arm,{:-NetBSD pkgsrc-:}, dnl MACHINE_ARCH,hppa,{:-NetBSD dnl pkgsrc-:}, MACHINE_ARCH,i386,{:-FreeBSD ports or NetBSD pkgsrc-:}, MACHINE_ARCH,m68k,{:-NetBSD pkgsrc-:}, MACHINE_ARCH,powerpc,{:-NetBSD pkgsrc-:}, MACHINE_ARCH,sparc,{:-NetBSD pkgsrc-:}, MACHINE_ARCH,sparc64,{:-FreeBSD ports or NetBSD pkgsrc-:}, MACHINE_ARCH,vax,{:-NetBSD pkgsrc-:})-:})dnl dnl dnl If this architecture supports FreeBSD or NetBSD emulation by default, dnl define text that tells which binary packages you can try to run. dnl define({:-EMUL-:}, {:-ifelse( MACHINE_ARCH,alpha,{:-NetBSD-:}, MACHINE_ARCH,i386,{:-FreeBSD-:})-:})dnl dnl dnl Same as above, defining a manual page to check for more compat dnl information. dnl define({:-EMULMAN-:}, {:-ifelse( MACHINE_ARCH,i386,{:-compat_freebsd(8)-:})-:})dnl dnl Installing other applications: If an OpenBSD package or port does not exist for an application you're pretty much on your own. The first thing to do is ask if anyone is working on a port -- there may be one in progress. ifelse(PORTS,,,{:- If no such port exists, you might want to tinker with the PORTS. -:})dnl ifelse(EMUL,,,{:- It is also quite possible that the EMUL binary packages, if they exist, will work for you. Note that you will need to enable EMUL binaries emulation with sysctl(8) and set up a complete emulation environment.ifelse(EMULMAN,,,{:- Refer to the EMULMAN manual page for more information about this.-:}) -:})dnl If you can't find an existing port, try to make your own and feed it back to OpenBSD. That's how our ports collection grows. Some details can be found at http://www.OpenBSD.org/porting.html with more help coming from the mailing list, .