NX_PREFIX=${INSTALL_ROOT}/usr/lib/NX
NX_LIB=${NX_PREFIX}/lib
NX_BIN=${NX_PREFIX}

mkdir -p  ${NX_PREFIX}/lib  &&
cp  -a  ${SPELL_DIRECTORY}/nxagent  ${INSTALLROOT}/usr/bin  &&
ln  -snf  nxagent  ${INSTALLROOT}/usr/bin/nxproxy   &&

cp  -a  ${SOURCE_DIRECTORY}/nxcomp/libXcomp.so.${VERSION}  ${NX_LIB}  &&
ln  -sf        libXcomp.so.${VERSION}  ${NX_LIB}/libXcomp.so  &&
ln  -sf        libXcomp.so.${VERSION}  ${NX_LIB}/libXcomp.so.3  &&

cp  -a  ${SOURCE_DIRECTORY}/nxcompext/libXcompext.so.${VERSION}  ${NX_LIB}  &&
ln  -sf           libXcompext.so.${VERSION}  ${NX_LIB}/libXcompext.so  &&
ln  -sf           libXcompext.so.${VERSION}  ${NX_LIB}/libXcompext.so.3  &&

cp  -a  ${SOURCE_DIRECTORY}/nxcompshad/libXcompshad.so.${VERSION}  ${NX_LIB}  &&
ln  -sf           libXcompshad.so.${VERSION}  ${NX_LIB}/libXcompshad.so  &&
ln  -sf           libXcompshad.so.${VERSION}  ${NX_LIB}/libXcompshad.so.3  &&

cp  -a  ${SOURCE_DIRECTORY}/nx-X11/lib/X11/libX11.so.6.2  ${NX_LIB}  &&
ln  -sf                libX11.so.6.2  ${NX_LIB}/libX11.so  &&
ln  -sf                libX11.so.6.2  ${NX_LIB}/libX11.so.6  &&

cp  -a  ${SOURCE_DIRECTORY}/nx-X11/lib/Xext/libXext.so.6.4  ${NX_LIB}  &&
ln  -sf                 libXext.so.6.4  ${NX_LIB}/libXext.so  &&
ln  -sf                 libXext.so.6.4  ${NX_LIB}/libXext.so.6  &&

cp  -a  ${SOURCE_DIRECTORY}/nx-X11/lib/Xrender/libXrender.so.1.2.2  ${NX_LIB}  &&
ln  -sf                    libXrender.so.1.2.2  ${NX_LIB}/libXrender.so  &&
ln  -sf                    libXrender.so.1.2.2  ${NX_LIB}/libXrender.so.1  &&

install  -m  755  nx-X11/programs/Xserver/nxagent  ${NX_BIN}  &&
install  -m  755  nxproxy/nxproxy                  ${NX_BIN}
#install  -m  755  nxviewer/nxpasswd/nxpasswd       ${INSTALLROOT}/usr/bin/
