#!/bin/sh # $RedRiver: fill_chroot,v 1.13 2008/09/17 20:08:17 andrew Exp $ CHROOT=${CHROOT:=/home/andrew/www} export CHROOT _find="-name *.so.* -o -name *.so -o ( -name perl -a -type f )" install -d -m 1750 -o www -g bin ${CHROOT}/tmp for d in ${CHROOT}/{bin,sbin,usr,var,dev}/ \ ${CHROOT}/var/run/ \ ${CHROOT}/usr/{lib,bin,sbin,libexec,local}/ \ ${CHROOT}/usr/local/{lib,bin,sbin,share}/\ ; do install -d -m 0555 -o root -g wheel $d done echo Making devices cd ${CHROOT}/dev /dev/MAKEDEV std cd ${OLDPWD} echo Installing perl into ${CHROOT} perl_to_chroot if [ -e /usr/local/sbin/femail ]; then echo Installing femail into ${CHROOT} echo pax -r -w -L -p e /usr/local/sbin/femail ${CHROOT} pax -r -w -L -p e /usr/local/sbin/femail ${CHROOT} else echo femail not installed! Please install it and link it to echo " ${CHROOT}/usr/sbin/sendmail" fi if [ -e ${CHROOT}/usr/local/sbin/femail ]; then echo Installing sendmail symlink to femail cd ${CHROOT}/usr/sbin/ ln -sf ../local/sbin/femail sendmail cd ${OLDPWD} fi if [ -e /usr/local/bin/aspell ]; then echo Installing aspell into ${CHROOT} for d in \ /usr/local/bin/aspell \ /usr/local/lib/aspell \ /usr/local/share/aspell \ ; do echo pax -r -w -L -p e $d ${CHROOT} pax -r -w -L -p e $d ${CHROOT} done _find="${_find} -o ( -name aspell -a -type f )" fi echo Installing dependencies into ${CHROOT} find ${CHROOT}/usr ${_find} | xargs find_depends | \ sort -u | \ { local _d while read _d; do echo pax -r -w -L -p e ${_d##${CHROOT}} ${CHROOT} pax -r -w -L -p e ${_d##${CHROOT}} ${CHROOT} done } echo Fixing ldconfig \(/var/run/ld.so.hints\) fix_ldconfig