#if the pkg created in packages-woof has something wrong, this file is a last
#resort to fix it. Current-dir is where this file FIXUPHACK is located.

[ -f usr/bin/X ] && mv usr/bin/X usr/bin/X-ORIG
ln -s Xorg usr/bin/X


#100416 ubuntu lucid has moved libGL.so* to /usr/lib/mesa (why oh why!!!???)...
#note, but not libGLU.so*
if [ -e usr/lib/mesa/libGL.so.1 ];then
 ln -s mesa/libGL.so.1 usr/lib/libGL.so.1
 ln -s mesa/libGL.so usr/lib/libGL.so
 ln -s mesa/libGL.so.1.2 usr/lib/libGL.so.1.2
fi

#120406 gxmessage pkg creates xmessage symlink to it (in pinstall.sh). get real xmessage out of the way...
if [ -f usr/bin/xmessage ];then
 if [ ! -h usr/bin/xmessage  ];then
  mkdir -p usr/X11R7/bin
  mv -f usr/bin/xmessage usr/X11R7/bin/
 fi
fi

#gentoo have usr/share/X11/xkb, but i think some scripts still expect it at /etc/X11...
if [ ! -d etc/X11/xkb ];then
 if [ -d usr/share/X11/xkb ];then
  mv -f usr/share/X11/xkb etc/X11/
  sync
  ln -s ../../../etc/X11/xkb usr/share/X11/xkb
 fi
fi
