Ajout variable manquante HV_FONTS_DIR
[hvlinux.git] / stage3 / cis-xfree86
index b3b54f9..fe95b2c 100755 (executable)
@@ -1,4 +1,6 @@
 #!/bin/sh
+set -o errexit
+
 # First argument of this script is the package name
 
 # Reading system configuration informations, functions and package versions.
@@ -7,9 +9,9 @@ source ../functions
 source ../packages-list
 
 # Applying patches (if any)
-apply_patches ${1} &&
+apply_patches ${1}
 
-cd ${LFS_TMP}/${1} &&
+cd ${LFS_TMP}/${1}
 
 # Xfree86 may have a problem with sys/kd.h installed with some recent versions of
 # Glibc. This has recently been fixed in LFS SVN. Execute the following commands
@@ -18,19 +20,19 @@ cd ${LFS_TMP}/${1} &&
 grep "__undef_LINUX" \
     /usr/include/sys/kd.h 2>&1 > /dev/null || \
     sed -i.bak '/X.h/i #include <linux/types.h>' \
-    programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c &&
+    programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c
 
 # When building XFree86, you should create a shadow directory of symbolic links for the compiled code:
-make -C config/util -f Makefile.ini lndir &&
+make -C config/util -f Makefile.ini lndir
 
 # Now create the shadow tree:
-cd ../${1}-build &&
-../${1}/config/util/lndir ../${1} &&
+cd ../${1}-build
+../${1}/config/util/lndir ../${1}
 
 # Creating host.def
 # Although XFree86 will compile without a host.def file, the following file is
 # recommended for customizing the installation.
-cat > config/cf/host.def << "EOF" &&
+cat > config/cf/host.def << "EOF"
 /* host.def */
 /* System Related Information. */
 #define DefaultGcc2i386Opt -O2 -fomit-frame-pointer -march=_MACHINE_ARCHITECTURE_
@@ -116,58 +118,28 @@ $(FONTDIR)/TrueType,$(FONTDIR)/CID,$(FONTDIR)/Speedo
 #define BuildSpecsDocs     NO
 EOF
 
-sed -i -e "s!_MACHINE_ARCHITECTURE_!${MACHINE_ARCHITECTURE}!g" config/cf/host.def &&
-sed -i -e "s!_XF86_CARD_DRIVER_!${XF86_CARD_DRIVER}!g" config/cf/host.def &&
+sed -i -e "s!_MACHINE_ARCHITECTURE_!${MACHINE_ARCHITECTURE}!g" config/cf/host.def
+sed -i -e "s!_XF86_CARD_DRIVER_!${XF86_CARD_DRIVER}!g" config/cf/host.def
 
 sed -i 's:^.*asm.*$:# define PAGE_MASK   (~(getpagesize() - 1)):' \
-    ../${1}/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.c &&
+    ../${1}/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.c
 
 sed -i -e "s@^#include <linux/config.h>@/* & */@" \
-    `grep -lr linux/config.h ../${1}` &&
-echo "make World" &&
-make World &&
-echo "make install" &&
-make install &&
-echo "make install.man" &&
-make install.man &&
-ldconfig &&
-
-ln -svf /usr/X11R6/bin /usr/bin/X11 &&
-ln -svf /usr/X11R6/lib/X11 /usr/lib/X11 &&
-ln -svf /usr/X11R6/include/X11 /usr/include/X11 &&
-
-cat > /usr/X11R6/lib/pkgconfig/xrender.pc << "EOF" &&
-prefix=/usr/X11R6
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include
-
-Name: Xrender
-Description: X Render Library
-Version: 0.8.3
-Cflags: -I${includedir} -I/usr/X11R6/include
-Libs: -L${libdir} -lXrender  -L/usr/X11R6/lib -lX11
-EOF
-
-cat > /usr/X11R6/lib/pkgconfig/xextensions.pc << "EOF" &&
-prefix=/usr/X11R6
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include
-
-Name: XExtensions
-Description: Sundry X extension headers
-Version: 1.0.1
-Cflags: -I${includedir}
-EOF
-
+    `grep -lr linux/config.h ../${1}`
+echo "make World"
+make World
+
+echo "make install"
+make install
+echo "make install.man"
+make install.man
+ldconfig
 
-# Creation of ~/.xinitrc
-cat > ~/.xinitrc << "EOF" &&
-exec wmaker
-EOF
+ln -svfT /usr/X11R6/bin /usr/bin/X11
+ln -svfT /usr/X11R6/lib/X11 /usr/lib/X11
+ln -svfT /usr/X11R6/include/X11 /usr/include/X11
 
-cat > /etc/X11/XF86Config << "EOF" &&
+cat > /etc/X11/XF86Config << "EOF"
 # XF86Config
 #
 # **********************************************************************
@@ -175,9 +147,7 @@ cat > /etc/X11/XF86Config << "EOF" &&
 # **********************************************************************
 Section "Files"
        RgbPath      "/usr/X11R6/lib/X11/rgb"
-
        ModulePath   "/usr/X11R6/lib/modules"      # Module search path
-
        FontPath     "_HV_FONTS_PATH_/TrueType"
 
         # Standard XFree86 Fonts
@@ -223,10 +193,11 @@ Section "InputDevice"
        Option      "XkbRules"   "xfree86"
        Option      "XkbModel"   "pc105"
        Option      "XkbLayout"  "_XF86_KEYBOARD_LAYOUT_"
+       Option      "XkbVariant" "_XF86_KEYBOARD_VARIANT_"
+       Option      "XkbOptions" "_XF86_KEYBOARD_OPTIONS_"
        Option      "AutoRepeat" "500 30"
 EndSection
 
-# With kernel 2.6, all mouse are supported through "/dev/input/mice" 
 Section "InputDevice"
        Identifier  "Mouse1"
        Driver      "mouse"
@@ -284,26 +255,44 @@ EndSection
 EOF
 
 # The ! character is the SED delimiter
-sed -i -e "s!_HV_FONTS_PATH_!${HV_FONTS_PATH}!g" /etc/X11/XF86Config &&
-sed -i -e "s!_VIDEO_CARD_DRIVER_!${XF86_CARD_DRIVER}!g" /etc/X11/XF86Config &&
-sed -i -e "s!_XF86_KEYBOARD_LAYOUT_!${HV_XF86_KEYBOARD_LAYOUT}!g" /etc/X11/XF86Config &&
+sed -i -e "s!_HV_FONTS_PATH_!${HV_FONTS_PATH}!g" /etc/X11/XF86Config
+sed -i -e "s!_VIDEO_CARD_DRIVER_!${XF86_CARD_DRIVER}!g" /etc/X11/XF86Config
+sed -i -e "s!_XF86_KEYBOARD_LAYOUT_!${HV_XF86_KEYBOARD_LAYOUT}!g" /etc/X11/XF86Config
+sed -i -e "s!_XF86_KEYBOARD_VARIANT_!${HV_XF86_KEYBOARD_VARIANT}!g" /etc/X11/XF86Config
+sed -i -e "s!_XF86_KEYBOARD_OPTIONS_!${HV_XF86_KEYBOARD_OPTIONS}!g" /etc/X11/XF86Config
 
-cat > /etc/skel/.xinitrc << "EOF" &&
+cat > /etc/skel/.xinitrc << "EOF"
 # ~/.xinitrc
 
 exec wmaker
 EOF
 
-cat > /etc/skel/.Xdefaults << "EOF" &&
-xterm*background: rgb:BB/AA/99
+cat > /etc/skel/.Xdefaults << "EOF"
 xterm*scrollBar: false
 xterm*rightScrollBar: false
 xterm*saveLines: 1000
 xterm*geometry: 120x45+70+50
-emacs*geometry:85x45+10+10
+xterm*background: #000000
+xterm*foreground: #A8A8A8
+xterm*color0:  #000000
+xterm*color1:  #A80000
+xterm*color2:  #00A800
+xterm*color3:  #A85400
+xterm*color4:  #0000A8
+xterm*color5:  #A800A8
+xterm*color6:  #00A8A8
+xterm*color7:  #A8A8A8
+xterm*color8:  #545054
+xterm*color9:  #F85450
+xterm*color10: #50FC50
+xterm*color11: #F2FC50
+xterm*color12: #5054F8
+xterm*color13: #F854F8
+xterm*color14: #50FCF8
+xterm*color15: #F8FCF8
 EOF
 
-cat > /etc/skel/.xsession << "EOF" &&
+cat > /etc/skel/.xsession << "EOF"
 #!/bin/sh
 # ~/.xsession
 
@@ -336,7 +325,7 @@ case $# in
     1)
        case $1 in
            kde)
-               exec startkde
+               exec dbus-launch --exit-with-session startkde
                ;;
            twm)
                xsetroot -solid rgb:33/33/55 &
@@ -344,46 +333,54 @@ case $# in
                opera -geometry 1100x950+150+10 -iconic -title "Opera 6.0 TP3" &
                emacs -geometry 140x60-5+100 -iconic -title "Emacs" &
                xterm -ls -geometry 160x60+25-25 -title "xterm" &
-               exec twm
+               exec dbus-launch --exit-with-session twm
                ;;
            wmaker)
-               exec wmaker
+               exec dbus-launch --exit-with-session wmaker
                ;;
            failsafe)
                exec xterm -geometry 80x24-0-0
                ;;
            default)
-               exec wmaker
+               exec dbus-launch --exit-with-session wmaker
                ;;
            *)
-               exec wmaker
+               exec dbus-launch --exit-with-session wmaker
                ;;
        esac
        ;;
     *)
-        exec wmaker
+        exec dbus-launch --exit-with-session wmaker
        ;;
 esac
 
 exit 0
 EOF
 
-chmod 755 /etc/skel/.xsession &&
+chmod 755 /etc/skel/.xsession
 
-cp /etc/skel/.{xinitrc,Xdefaults,xsession} /root &&
+cp /etc/skel/.{xinitrc,Xdefaults,xsession} /root
+cp /etc/skel/.{xinitrc,Xdefaults,xsession} /home/${REGUSER}
 
-var_add_path "PATH" /etc/profile "/usr/X11R6/bin" &&
+var_add_path "PATH" /etc/profile "/usr/X11R6/bin"
 
-var_add_path "PKG_CONFIG_PATH" /etc/profile "/usr/X11R6/lib/pkgconfig" &&
-var_export   "PKG_CONFIG_PATH" /etc/profile &&
+var_add_path "PKG_CONFIG_PATH" /etc/profile "/usr/X11R6/lib/pkgconfig"
+var_export   "PKG_CONFIG_PATH" /etc/profile
 
-var_add_path "MANPATH" /etc/profile "/usr/X11R6/man" &&
-var_export   "MANPATH" /etc/profile &&
+var_add_path "MANPATH" /etc/profile "/usr/X11R6/man"
+var_export   "MANPATH" /etc/profile
 
-var_add_shadow "ENV_SUPATH" /etc/login.defs "/usr/X11R6/bin" &&
+var_add_shadow "ENV_SUPATH" /etc/login.defs "/usr/X11R6/bin"
 
-string_add "/usr/X11R6/lib" /etc/ld.so.conf &&
-ldconfig
+string_add "/usr/X11R6/lib" /etc/ld.so.conf
+
+if [ "x${INST_TYPE}" = "xltsp-server" ]; then
+    # Enable remote xdm login for LTSP clients
+    sed -i -e "s@^\(DisplayManager.requestPort.*\)@!\1@g" /etc/X11/xdm/xdm-config
+    chmod 644 /etc/X11/xdm/Xaccess
+    sed -i -e "s@^#\(\*[\t ]*#any host can get a login window\)@\1@g" /etc/X11/xdm/Xaccess
+    chmod 444 /etc/X11/xdm/Xaccess
+fi
 
 # When needed, XFree86 creates the directory /tmp/.ICE-unix if it does not
 # exist. If this directory is not owned by root, XFree86 delays startup by a
@@ -396,5 +393,5 @@ ldconfig
 #/tmp/.ICE-unix dir 1777 root root
 #EOF
 
-# Return last error
 exit $?