5 Stage Two: Ports Installation

Note: It is also possible to install the (precompiled) packages at this stage, instead of compiling ports. In this case, stage_2.sh would be nothing more than a list of pkg_add commands. I trust you know how to write such a script. Here we concentrate on the more flexible and traditional way of using the ports.

The following stage_2.sh script is how I install my favorite ports. It can be run any number of times and will skip all ports that are already installed. It supports the dryrun option (-n) to just show what would be done. You run it like stage_1.sh with exactly one argument to denote a config file, e.g.

# ./stage_2.sh default

which will read the list of ports from stage_2.conf.default.

The list of ports consists of lines with two or more space separated words: the category and the port, optionally followed by an installation command that will compile and install the port (default: make install BATCH=yes < /dev/null). Empty lines and lines starting with # are ignored. Most of the time it suffices to only name category and port. A few ports however can be fine tuned by specifying make variables, e.g.:

www mozilla make WITHOUT_MAILNEWS=yes WITHOUT_CHATZILLA=yes install

In fact you can specify arbitrary shell commands, so you are not restricted to simple make invocations:

java linux-sun-jdk13 yes | make install
news inn-stable CONFIGURE_ARGS="--enable-uucp-rnews --enable-setgid-inews" make install

Note that the line for news/inn-stable is an example for a one-shot shell variable assignment to CONFIGURE_ARGS. The port Makefile will use this as an initial value and augment some other essential args. The difference to specifying a make variable on the command line with

news inn-stable make CONFIGURE_ARGS="--enable-uucp-rnews --enable-setgid-inews" install

is that the latter will override instead of augment. It depends on the particular port which method you want.

Be careful that your ports do not use an interactive install, i.e. they should not try to read from stdin other than what you explicitly give them on stdin. If they do, they will read the next line(s) from your list of ports in the here-document and get confused. If stage_2.sh mysteriously skips a port or stops processing, this is likely the reason.

Below is stage_2.conf.default. A log file named LOGDIR/category+port is created for each port it actually installs.

# vim: syntax=sh
# $Id: stage_2.conf.default,v 1.2 2004/03/06 12:50:30 toor Exp toor $
# $FreeBSD: doc/en_US.ISO8859-1/articles/fbsd-from-scratch/stage_2.conf.default,v 1.3 2004/07/19 20:42:13 schweikh Exp $
shells zsh
devel gettext make BATCH=yes install
lang perl5.8 make install; use.perl port
archivers unzip
archivers zip
security sudo
x11-servers XFree86-4-Server
x11 wrapper
x11 XFree86-4-clients
x11 XFree86-4-documents
x11-fonts XFree86-4-font75dpi
x11-fonts XFree86-4-font100dpi
x11-fonts XFree86-4-fontScalable
x11-fonts urwfonts
x11-fonts webfonts make WITH_NETSCAPE_ALIASES=yes install
x11-toolkits open-motif
x11-wm ctwm
security openssh-askpass
astro xplanet
astro xephem
editors vim
print ghostscript-gnu make A4=yes BATCH=yes install
print psutils-a4
print a2ps-a4
print gv
print acroread5
print transfig
print teTeX
# NOTE: jdk14 needs linprocfs(5) mounted or it will hang indefinitely.
java linux-sun-jdk14 mount -a linproc; yes | make install
java jdk14 mount -a linproc; make -DNODEBUG install
www apache2
www weblint
www amaya
www firefox make BATCH=yes install
www mozilla make WITHOUT_MAILNEWS=yes WITHOUT_COMPOSER=yes WITHOUT_LDAP=yes WITHOUT_CHATZILLA=yes WITHOUT_XMLTERM=yes install
www checkbot
www privoxy
graphics xfig
graphics xv
multimedia xawtv
graphics graphviz
lang expect
lang gawk
lang TenDRA unset MAKEOBJDIRPREFIX; make install
news tin
net freebsd-uucp
net cvsup-without-gui
net pathchar make NO_CHECKSUM=yes install
ftp wget
textproc ispell
german ispell-neu
german ispell-alt
textproc docproj make JADETEX=no HAVE_MOTIF=yes BATCH=yes install < /dev/null
sysutils samefile
sysutils lsof
sysutils pstree
sysutils cdrtools
sysutils grub
sysutils smartmontools
sysutils vobcopy
devel ddd
devel gindent
devel ctags
devel ElectricFence
devel strace
devel perltidy
mail procmail make BATCH=yes install
mail metamail
mail mutt-devel
emulators mtools
sysutils portupgrade
news inn-stable CONFIGURE_ARGS="--enable-uucp-rnews --enable-setgid-inews" make install
misc figlet-fonts
security gpa
mail spamoracle
multimedia mplayer make WITHOUT_RUNTIME_CPUDETECTION=yes WITH_GUI=yes BATCH=yes install
multimedia mplayer-fonts
audio wavplay
games xmahjongg
games xdemineur
editors openoffice-1.1

Download stage_2.conf.default.

This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.

Hosting by: Hurra Communications Ltd.
Generated: 2007-01-26 17:58:39