!/bin/sh # # ident "@(#)postinstall.src 1.2 05/03/23 SMI" # # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # This script is to be run on linux only. It creates # /opt/SUNWut/lib/xkb by creating a shadow directory # of /usr/X11R6/lib/X11/xkb (ie., symlinks). It then # overlays sun-specific xkb files and recreates the # .dir files. PATH=/bin:/usr/bin:/sbin:/usr/sbin XKBDIR=/usr/share/X11/xkb if [ -z "$BASEDIR" ]; then BASEDIR="/opt"; fi cd $XKBDIR DIRS=`find . -type d` FILES=`find . -type f` LINKS=`find . -type l` cd $BASEDIR/SUNWut/lib mkdir xkb cd xkb for d in $DIRS do if [ "$d" != "." ] ; then mkdir $d fi done for f in $FILES do cp $XKBDIR/$f $f done for l in $LINKS do cp $XKBDIR/$l $l done cd ../xkbfiles SUNSTUFF=`find . -type f` cd ../xkb for s in $SUNSTUFF do rm -rf $s done cd ../xkbfiles tar -cf - . | (cd ../xkb ; tar -xf -) cd ../xkb cat << EOF > /opt/SUNWut/lib/xkb/xkbcomp #!/bin/bash /usr/bin/xkbcomp -I/opt/SUNWut/lib/xkb "\$@" EOF chmod a+rx /opt/SUNWut/lib/xkb/xkbcomp mkdir -p /var/lib/xkb ln -s /var/lib/xkb compiled rm geometry.dir keycodes.dir keymap.dir symbols.dir cd geometry ; /usr/bin/xkbcomp -lfhlpR -o geometry.dir '*' ; mv geometry.dir .. cd ../keycodes ; /usr/bin/xkbcomp -lfhlpR -o keycodes.dir '*' ; mv keycodes.dir .. cd ../keymap ; /usr/bin/xkbcomp -lfhlpR -o keymap.dir '*' ; mv keymap.dir .. cd ../symbols ; /usr/bin/xkbcomp -lfhlpR -o symbols.dir '*' ; mv symbols.dir .. exit 0