cp -dRv "$SOURCE_DIRECTORY/anywhere/$INSTALL_ROOT/usr" "$INSTALL_ROOT/" &&

if [[ -f "$SOURCE_DIRECTORY/spell-tmp/pydcop.py" ]]; then
  cp "$SOURCE_DIRECTORY/spell-tmp/pydcop.py" "$PYPATH"
fi &&

# gettext
install -vm 755 "$SOURCE_DIRECTORY"/Tools/i18n/{pygettext.py,msgfmt.py} \
                "$INSTALL_ROOT/usr/bin" &&

local PYVER=`echo ${VERSION}|cut -d . -f 1,2` &&

# Ensure existence of /usr/bin/python2 and /usr/bin/python2-config
# symlinks, as they are not created with altinstall.
# See https://mail.python.org/pipermail/python-dev/2011-March/108971.html
# and the surrounding thread for fun.
ln -sf python$PYVER "$INSTALL_ROOT/usr/bin/python"
ln -sf python$PYVER "$INSTALL_ROOT/usr/bin/python2" &&
ln -sf python$PYVER-config "$INSTALL_ROOT/usr/bin/python2-config" &&

if [ -d "${INSTALL_ROOT}/usr/lib/python${PYVER}/plat-linux2" ];then
   cp -r "${INSTALL_ROOT}/usr/lib/python${PYVER}/plat-linux2" \
   "${INSTALL_ROOT}/usr/lib/python${PYVER}/plat-linux3"
else
   cp -r "${INSTALL_ROOT}/usr/lib/python${PYVER}/plat-linux3" \
   "${INSTALL_ROOT}/usr/lib/python${PYVER}/plat-linux2"
fi
