#!/bin/sh

. config/options

PKG_DIR=`find $PACKAGES -type d -name $1`

#Fonts
$SCRIPTS/install encodings
$SCRIPTS/install font-xfree86-type1
$SCRIPTS/install font-bitstream-type1
$SCRIPTS/install font-misc-misc

#Server
$SCRIPTS/install xorg-server
$SCRIPTS/install xkeyboard-config
$SCRIPTS/install xkbcomp
#$SCRIPTS/install setxkbmap

#Drivers
$SCRIPTS/install xf86-input-evdev
$SCRIPTS/install xf86-input-synaptics

[ "$XORG_DRIVERS" = all ] && XORG_DRIVERS="`find $ROOT/$PACKAGES/ -name "xf86-video-*" | sed s/.*xf86-video-//`"
for drv in $XORG_DRIVERS; do
  $SCRIPTS/install xf86-video-$drv
done


#$SCRIPTS/install xf86-video-openchrome
#$SCRIPTS/install xf86-video-vesa
#$SCRIPTS/install xf86-video-nv

#+for drv in `ls $INSTALL/usr/lib/xorg/modules/drivers/*_drv.so`; do
#+  echo "$drv"|sed -e 's,.*/,,;s,_drv.so,,' >> $INSTALL/etc/X11/drivers
#+done

#Tools
#$SCRIPTS/install xrandr
#$SCRIPTS/install xresprobe
#$SCRIPTS/install read-edid
$SCRIPTS/install xinit
#+$SCRIPTS/install pciutils
#$SCRIPTS/install evilwm-ewmh
#$SCRIPTS/install ratpoison
$SCRIPTS/install openbox

mkdir -p $INSTALL/usr/bin
#cp $PKG_DIR/scripts/oe_wrapper $INSTALL/usr/bin
#cp $PKG_DIR/scripts/startx $INSTALL/usr/bin

#+mkdir -p $INSTALL/etc/X11
#+cp $PKG_DIR/config/X.cfg.sample $INSTALL/etc/X11
#+cp $PKG_DIR/config/xorg.default $INSTALL/etc/X11

exit 0
