Marcos Laufer wrote:
> Hello ,
> 
> Has anyone had luck in making ImageMagick work into the www chroot
> environment?

Yes, run the following script and you are done.

#!/bin/sh


CHROOT="/var/www"


# Make dirs
[ ! -d "$CHROOT/bin" ]              && mkdir -p $CHROOT/bin
[ ! -d "$CHROOT/usr/local/bin" ]    && mkdir -p $CHROOT/usr/local/bin
[ ! -d "$CHROOT/usr/local/lib" ]    && mkdir -p $CHROOT/usr/local/lib
[ ! -d "$CHROOT/usr/lib" ]          && mkdir -p $CHROOT/usr/lib
[ ! -d "$CHROOT/usr/X11R6/lib" ]    && mkdir -p $CHROOT/usr/X11R6/lib/
[ ! -d "$CHROOT/usr/libexec" ]      && mkdir -p $CHROOT/usr/libexec
[ ! -d "$CHROOT/var/run" ]          && mkdir -p $CHROOT/var/run


SH="/bin/sh"
if [ -x $SH ]; then
    cp -f $SH $CHROOT/$SH
else
    echo "No shit. $SH not found! :)"
fi


LD_HINTS="/var/run/ld.so.hints"
if [ -f $LD_HINTS ]; then
    cp $LD_HINTS $CHROOT/$LD_HINTS
else
    echo "$LD_HINTS not found. Still wondering thou."
fi


CONVERT=$(which convert | awk '{print $1}')
if [ ! -z $CONVERT ] && [ -x $CONVERT ]; then
    cp -f $CONVERT $CHROOT/$CONVERT
    for i in $(ldd $CONVERT | awk '{if ($3 == "rlib") {print $7}}'); do
        if [ -f $i ]; then
            cp -f $i $CHROOT/$i
        fi
    done
else
    echo "convert not found."
    exit 1
fi


COMPOSITE=$(which composite | awk '{print $1}')
if [ ! -z $COMPOSITE ] && [ -x $COMPOSITE ]; then
    cp -f $COMPOSITE $CHROOT/$COMPOSITE
    for i in $(ldd $COMPOSITE | awk '{if ($3 == "rlib") {print $7}}'); do
        if [ -f $i ]; then
            cp -f $i $CHROOT/$i
        fi
    done
else
    echo "composite not found."
    exit 1
fi


IDENTIFY=$(which identify | awk '{print $1}')
if [ ! -z $IDENTIFY ] && [ -x $IDENTIFY ]; then
    cp -f $IDENTIFY $CHROOT/$IDENTIFY
    for i in $(ldd $IDENTIFY | awk '{if ($3 == "rlib") {print $7}}'); do
        if [ -f $i ]; then
            cp -f $i $CHROOT/$i
        fi
    done
else
    echo "identify not found."
    exit 1
fi

HTH,
    Aiko
-- 
Aiko Barz <[EMAIL PROTECTED]>
Web: http://www.haeckser.de

Reply via email to