=================================================================== RCS file: /cvs/openbsd/fill_chroot/fill_chroot,v retrieving revision 1.13 retrieving revision 1.21 diff -u -r1.13 -r1.21 --- openbsd/fill_chroot/fill_chroot 2008/09/17 21:08:17 1.13 +++ openbsd/fill_chroot/fill_chroot 2019/11/04 01:13:18 1.21 @@ -1,18 +1,24 @@ #!/bin/sh -# $RedRiver: fill_chroot,v 1.12 2008/09/16 22:38:35 andrew Exp $ +# $AFresh1: fill_chroot,v 1.20 2012/06/10 03:29:42 andrew Exp $ CHROOT=${CHROOT:=/home/andrew/www} +CHROOT=`echo $CHROOT | sed -e 's,/*$,,'` export CHROOT +BINDIR=$( dirname $( readlink -f $0 ) ) -_find="-name '*.so.*' -o -name '*.so' -o ( -name perl -a -type f )" +_find="-type f -a (" +_find="${_find} -name *.so.* -o -name *.so" +_find="${_find} -o -path */usr/bin/* -o -path */usr/sbin/*" +_find="${_find} -o -path */usr/local/bin/* -o -path */usr/local/sbin/*" +echo Installing Directory Structure install -d -m 1750 -o www -g bin ${CHROOT}/tmp -for d in ${CHROOT}/{bin,sbin,usr,var,dev}/ \ +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 + install -d -m 0555 -o root -g wheel $_d done echo Making devices @@ -21,8 +27,16 @@ cd ${OLDPWD} echo Installing perl into ${CHROOT} -perl_to_chroot +for _f in /usr/bin/perl \ + /usr/libdata/perl5 \ + /usr/local/libdata/perl5 \ + ; do + echo pax -r -w -L -p e $_f ${CHROOT} + pax -r -w -L -p e $_f ${CHROOT} + +done + if [ -e /usr/local/sbin/femail ]; then echo Installing femail into ${CHROOT} echo pax -r -w -L -p e /usr/local/sbin/femail ${CHROOT} @@ -41,26 +55,59 @@ if [ -e /usr/local/bin/aspell ]; then echo Installing aspell into ${CHROOT} - for d in \ + for _f 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} + echo pax -r -w -L -p e $_f ${CHROOT} + pax -r -w -L -p e $_f ${CHROOT} done - _find="${_find} -o ( -name aspell -a -type f )" + _find="${_find} -o -name aspell" fi -echo Installing dependencies into ${CHROOT} -for d in `find ${CHROOT}/usr ${_find} | \ - xargs find_depends | \ - sort -u `; do +if [ -e /usr/local/bin/speedy ]; then + echo Installing speedycgi into ${CHROOT} + for _f in \ + /usr/local/bin/speedy \ + /usr/local/bin/speedy_backend \ + ; do + echo pax -r -w -L -p e $_f ${CHROOT} + pax -r -w -L -p e $_f ${CHROOT} + done - echo pax -r -w -L -p e $d ${CHROOT} - pax -r -w -L -p e $d ${CHROOT} -done + _find="${_find} -o -name speedy*" +fi +if [ -e ${CHROOT}/cgi-bin/cvsweb ]; then + echo Installing cvsweb depends + for _f in \ + /usr/bin/{co,cvs,diff,perl,rcsdiff,rlog,uname} \ + ; do + echo pax -r -w -L -p e $_f ${CHROOT} + pax -r -w -L -p e $_f ${CHROOT} + done + +elif [ -e ${CHROOT}/usr/bin/cvs ]; then + _f=/usr/bin/cvs + echo Installing cvs + echo pax -r -w -L -p e $_f ${CHROOT} + pax -r -w -L -p e $_f ${CHROOT} +fi + +_find="${_find} )" +echo Installing dependencies into ${CHROOT} +find ${CHROOT}/usr ${_find} -print0 | + xargs -0 "${BINDIR}"/find_depends | \ + sort -u | \ +{ + local _f + while read _f; do + echo pax -r -w -L -p e ${_f##${CHROOT}} ${CHROOT} + pax -r -w -L -p e ${_f##${CHROOT}} ${CHROOT} + done +} + echo Fixing ldconfig \(/var/run/ld.so.hints\) -fix_ldconfig +"${BINDIR}"/fix_ldconfig