I use a Makefile to customize my installs for each different box. My
install.site script is just a wrapper for the install.site.${BOX} script. A snippet from that Makefile
Code:
install.site: install.site.${BOX}
@echo --- Creating ${.TARGET}
@echo "#!/bin/sh" >${.TARGET}
@echo ". ./install.site.${BOX} 2>&1 | tee ./install.report" >>${.TARGET}
@chmod u+x ${.TARGET}
install.site.${BOX}: ${SCRIPT}
@echo --- Creating ${.TARGET}
@cat ${.ALLSRC} >${.TARGET}
When the value of $BOX is "protogoras" the
install.site target will create this install.site script
Code:
#!/bin/sh
. ./install.site.protogoras 2>&1 | tee ./install.report
That way I have a log of everything
install.site.protogoras has done. in the file
./install.report.
Note the
chmod u+x command to make the file executable.
The following is what I use to add packages
Code:
# --- configure shared library cache with code stolen from "/etc/rc"
if [ -f /sbin/ldconfig ]; then
echo 'creating runtime link editor directory cache.'
if [ -d /usr/local/lib ]; then
shlib_dirs="/usr/local/lib $shlib_dirs"
fi
if [ -d /usr/X11R6/lib ]; then
shlib_dirs="/usr/X11R6/lib $shlib_dirs"
fi
ldconfig $shlib_dirs
fi
# ---
export PKG_PATH="ftp://mirror.hostfuss.com/pub/OpenBSD/snapshots/packages/i386/"
export PKG_CACHE=/home/packages
mkdir -p ${PKG_CACHE}
PACKAGES="fetchmail-6.3.8p0.tgz ghostscript-8.54p1-a4-no_x11.tgz a2ps-4.13bp4-a4.tgz apsfilter-7.2.8p0.tgz courier-imap-4.1.1p2.tgz "
echo Installing the following packages from $PKG_PATH
echo $PACKAGES | tr ' ' '\n'
echo -------------------------------------------------
pkg_add -v $PACKAGES
Last time I I used all this stuff was in October 2007, so YMMV