LIBVER=4.6.27 crunch() { LIBDIR=$1 LIBPREFIX=$2 for f in $LIBDIR/$LIBPREFIX.so.$LIBVER do bname=`basename $f` cp $f $LIBDIR/t$bname || exit 1 rm -f $f mv $LIBDIR/t$bname $f done } crunch lib libc; crunch lib libm; # Better have a static 'ln' ;^) if [ -x /bin/sln ]; then ( cd lib ; sln libc.so.$LIBVER libc.so.4 ) ( cd lib ; sln libm.so.$LIBVER libm.so.4 ) else ( cd lib ; ln -sf libc.so.$LIBVER libc.so.4 ) ( cd lib ; ln -sf libm.so.$LIBVER libm.so.4 ) fi # Move any old shared libs into /tmp for LIBS in lib/libc.so.*.*.* ; do if [ ! "$LIBS" = "lib/libc.so.$LIBVER" ]; then mv $LIBS tmp fi done for LIBS in lib/libm.so.*.*.* ; do if [ ! "$LIBS" = "lib/libm.so.$LIBVER" ]; then mv $LIBS tmp fi done ( cd lib ; rm -rf libcurses.so.0 ) ( cd lib ; ln -sf libcurses.so.0.1.2 libcurses.so.0 )