summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Baergen <joshuabaergen@gentoo.org>2006-05-02 17:24:08 +0000
committerJoshua Baergen <joshuabaergen@gentoo.org>2006-05-02 17:24:08 +0000
commitcd9f0a0e7c73cd8044d841b3b519987b62398faf (patch)
tree99d055828aa8f6a36f8bdb486369dc93674a14a4
parentStable on sparc (diff)
downloadgentoo-2-cd9f0a0e7c73cd8044d841b3b519987b62398faf.tar.gz
gentoo-2-cd9f0a0e7c73cd8044d841b3b519987b62398faf.tar.bz2
gentoo-2-cd9f0a0e7c73cd8044d841b3b519987b62398faf.zip
Security bump and remove all affected versions. Please see Bug #130979 for details.
(Portage version: 2.1_pre10-r2)
-rw-r--r--x11-base/xorg-server/ChangeLog12
-rw-r--r--x11-base/xorg-server/files/CVE-2006-1526-xrender-mitri.patch26
-rw-r--r--x11-base/xorg-server/files/digest-xorg-server-1.0.2-r49
-rw-r--r--x11-base/xorg-server/files/digest-xorg-server-1.0.99.902-r16
-rw-r--r--x11-base/xorg-server/xorg-server-1.0.2-r4.ebuild196
-rw-r--r--x11-base/xorg-server/xorg-server-1.0.99.902-r1.ebuild283
6 files changed, 531 insertions, 1 deletions
diff --git a/x11-base/xorg-server/ChangeLog b/x11-base/xorg-server/ChangeLog
index e3363c5e7f2b..5d1383de0840 100644
--- a/x11-base/xorg-server/ChangeLog
+++ b/x11-base/xorg-server/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for x11-base/xorg-server
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/ChangeLog,v 1.112 2006/04/30 19:03:45 spyderous Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/ChangeLog,v 1.113 2006/05/02 17:24:08 joshuabaergen Exp $
+
+*xorg-server-1.0.99.902-r1 (02 May 2006)
+*xorg-server-1.0.2-r4 (02 May 2006)
+
+ 02 May 2006; Joshua Baergen <joshuabaergen@gentoo.org>
+ +files/CVE-2006-1526-xrender-mitri.patch, -xorg-server-1.0.2-r3.ebuild,
+ +xorg-server-1.0.2-r4.ebuild, -xorg-server-1.0.99.902.ebuild,
+ +xorg-server-1.0.99.902-r1.ebuild:
+ Security bump and remove all affected versions. Please see Bug #130979 for
+ details.
30 Apr 2006; Donnie Berkholz <spyderous@gentoo.org>;
-files/1.0.99.901-fix-kdrive-build.patch,
diff --git a/x11-base/xorg-server/files/CVE-2006-1526-xrender-mitri.patch b/x11-base/xorg-server/files/CVE-2006-1526-xrender-mitri.patch
new file mode 100644
index 000000000000..a832b8d9f667
--- /dev/null
+++ b/x11-base/xorg-server/files/CVE-2006-1526-xrender-mitri.patch
@@ -0,0 +1,26 @@
+Index: render/mitri.c
+===================================================================
+RCS file: /cvs/xorg/xserver/xorg/render/mitri.c,v
+retrieving revision 1.5
+diff -u -r1.5 mitri.c
+--- xserver/xorg/render/mitri.c 3 Jul 2005 07:02:08 -0000 1.5
++++ xserver/xorg/render/mitri.c 18 Apr 2006 22:34:08 -0000
+@@ -145,7 +145,7 @@
+ if (npoint < 3)
+ return;
+ ntri = npoint - 2;
+- tris = ALLOCATE_LOCAL (ntri & sizeof (xTriangle));
++ tris = ALLOCATE_LOCAL (ntri * sizeof (xTriangle));
+ if (!tris)
+ return;
+ for (tri = tris; npoint >= 3; npoint--, points++, tri++)
+@@ -177,7 +177,7 @@
+ if (npoint < 3)
+ return;
+ ntri = npoint - 2;
+- tris = ALLOCATE_LOCAL (ntri & sizeof (xTriangle));
++ tris = ALLOCATE_LOCAL (ntri * sizeof (xTriangle));
+ if (!tris)
+ return;
+ first = points++;
+
diff --git a/x11-base/xorg-server/files/digest-xorg-server-1.0.2-r4 b/x11-base/xorg-server/files/digest-xorg-server-1.0.2-r4
new file mode 100644
index 000000000000..b2e8218ffcfa
--- /dev/null
+++ b/x11-base/xorg-server/files/digest-xorg-server-1.0.2-r4
@@ -0,0 +1,9 @@
+MD5 2f35e003812df5817ebec8fc3c6943e8 1.0.2-overlay-window.patch.bz2 6388
+RMD160 f1223f88da72461585ff72e5cc3c0e15cd9a1306 1.0.2-overlay-window.patch.bz2 6388
+SHA256 99653c8f59a3d3dd2bd6979e4a52cfb81a32dd3d8bead0bd06274bad57823a67 1.0.2-overlay-window.patch.bz2 6388
+MD5 7674d2c603b5834259e4e5a820cefd5b MesaLib-6.4.2.tar.bz2 2913009
+RMD160 6bf1afc0d3bd3f5e3b5c1a019838f40603446509 MesaLib-6.4.2.tar.bz2 2913009
+SHA256 bc84da436f9d92485dfa1c6670689c6807950a8372637c9952f689a1e1f9aa86 MesaLib-6.4.2.tar.bz2 2913009
+MD5 5cd3316f07ed32a05cbd69e73a71bc74 xorg-server-1.0.2.tar.bz2 6006486
+RMD160 ee47746009fa7c36e692bf4bae629ccd1bd0d4b4 xorg-server-1.0.2.tar.bz2 6006486
+SHA256 b30c57271d147c1f45ba7f15fcc7e7917b61c6dfb97d514e25c7bc91ddd970ba xorg-server-1.0.2.tar.bz2 6006486
diff --git a/x11-base/xorg-server/files/digest-xorg-server-1.0.99.902-r1 b/x11-base/xorg-server/files/digest-xorg-server-1.0.99.902-r1
new file mode 100644
index 000000000000..d1df5f286323
--- /dev/null
+++ b/x11-base/xorg-server/files/digest-xorg-server-1.0.99.902-r1
@@ -0,0 +1,6 @@
+MD5 61beda590bfc5b4a12e979d5f2d70d7a MesaLib-6.5.tar.bz2 3062363
+RMD160 6006bfdfed8a2425059c31ee699b5aca4d5f57cd MesaLib-6.5.tar.bz2 3062363
+SHA256 dcacf4c18af89b57e66dc7ba39e24c3b74ff6f83b8745bcc1390170a4190eebd MesaLib-6.5.tar.bz2 3062363
+MD5 643633bbc7038643b29a373aa3a2413e xorg-server-1.0.99.902.tar.bz2 6318145
+RMD160 72437131b4dedc281b247c984bd29d1b74d2fe56 xorg-server-1.0.99.902.tar.bz2 6318145
+SHA256 28af7877dc6b3fcf90d61947f36c30ef0e2a504026872fd50d9e766f332c448c xorg-server-1.0.99.902.tar.bz2 6318145
diff --git a/x11-base/xorg-server/xorg-server-1.0.2-r4.ebuild b/x11-base/xorg-server/xorg-server-1.0.2-r4.ebuild
new file mode 100644
index 000000000000..0565d13140dc
--- /dev/null
+++ b/x11-base/xorg-server/xorg-server-1.0.2-r4.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/xorg-server-1.0.2-r4.ebuild,v 1.1 2006/05/02 17:24:08 joshuabaergen Exp $
+
+# Must be before x-modular eclass is inherited
+# Hack to make sure autoreconf gets run
+SNAPSHOT="yes"
+
+inherit flag-o-matic x-modular multilib
+
+OPENGL_DIR="xorg-x11"
+
+MESA_PN="Mesa"
+MESA_PV="6.4.2"
+MESA_P="${MESA_PN}-${MESA_PV}"
+MESA_SRC_P="${MESA_PN}Lib-${MESA_PV}"
+
+PATCHES="${FILESDIR}/${P}-Sbus.patch
+ ${FILESDIR}/CVE-2006-1526-xrender-mitri.patch
+ ${FILESDIR}/${P}-sparc64-cfbrrop-fix.patch
+ ${FILESDIR}/${P}-64bit-fix-indirect-vertex-array.patch
+ ${FILESDIR}/${P}-64bit-fix-have-dix-config.patch
+ ${FILESDIR}/${P}-64bit-fix-for-glx.patch
+ ${FILESDIR}/${P}-Xprt-build.patch
+ ${FILESDIR}/${P}-xprint-init.patch
+ ${FILESDIR}/${PV}-Xprint-xprintdir.patch
+ ${FILESDIR}/${PV}-try-to-fix-xorgcfg.patch
+ ${FILESDIR}/${PV}-fix-xorgconfig-rgbpath-and-mouse.patch
+ ${DISTDIR}/${PV}-overlay-window.patch.bz2"
+
+SRC_URI="${SRC_URI}
+ mirror://sourceforge/mesa3d/${MESA_SRC_P}.tar.bz2
+ http://dev.gentoo.org/~spyderous/xorg-x11/1.0.2/1.0.2-overlay-window.patch.bz2"
+DESCRIPTION="X.Org X servers"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="dri ipv6 minimal xprint"
+RDEPEND="x11-libs/libXfont
+ x11-libs/xtrans
+ x11-libs/libXau
+ x11-libs/libXext
+ x11-libs/libX11
+ x11-libs/libxkbfile
+ x11-libs/libXdmcp
+ x11-libs/libXmu
+ x11-libs/libXrender
+ x11-libs/libXi
+ media-libs/freetype
+ media-libs/mesa
+ media-fonts/font-adobe-75dpi
+ media-fonts/font-misc-misc
+ media-fonts/font-cursor-misc
+ x11-misc/xbitmaps
+ || ( x11-misc/xkeyboard-config x11-misc/xkbdata )
+ x11-apps/iceauth
+ x11-apps/rgb
+ x11-apps/xauth
+ x11-apps/xinit
+ app-admin/eselect-opengl
+ x11-libs/libXaw
+ x11-libs/libXpm
+ x11-libs/libXxf86misc
+ x11-libs/libXxf86vm
+ !minimal? ( x11-libs/libdmx
+ x11-libs/libXtst
+ x11-libs/libXres )
+ x11-libs/libxkbui
+ x11-libs/liblbxutil"
+ # Xres is dmx-dependent, xkbui is xorgcfg-dependent
+ # Xaw is dmx- and xorgcfg-dependent
+ # Xpm is dmx- and xorgcfg-dependent, pulls in Xt
+ # Xxf86misc and Xxf86vm are xorgcfg-dependent
+ # liblbxutil is lbx- dependent
+DEPEND="${RDEPEND}
+ x11-proto/randrproto
+ x11-proto/renderproto
+ >=x11-proto/fixesproto-4
+ x11-proto/damageproto
+ x11-proto/xextproto
+ x11-proto/xproto
+ x11-proto/xf86dgaproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86rushproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xf86bigfontproto
+ >=x11-proto/compositeproto-0.3
+ x11-proto/recordproto
+ x11-proto/resourceproto
+ x11-proto/videoproto
+ x11-proto/scrnsaverproto
+ x11-proto/evieext
+ x11-proto/trapproto
+ >=x11-proto/xineramaproto-1.1-r1
+ x11-proto/fontsproto
+ >=x11-proto/kbproto-1.0-r1
+ x11-proto/inputproto
+ x11-proto/bigreqsproto
+ x11-proto/xcmiscproto
+ >=x11-proto/glproto-1.4.1_pre20051013
+ !minimal? ( x11-proto/dmxproto )
+ dri? ( x11-proto/xf86driproto
+ >=x11-libs/libdrm-2 )
+ xprint? ( x11-proto/printproto
+ x11-apps/mkfontdir
+ x11-apps/mkfontscale )"
+LICENSE="${LICENSE} MIT"
+
+pkg_setup() {
+ # localstatedir is used for the log location; we need to override the default
+ # from ebuild.sh
+ # sysconfdir is used for the xorg.conf location; same applies
+
+ # --enable-xorg needed because darwin defaults off
+ # --enable-install-setuid needed because sparcs default off
+ CONFIGURE_OPTIONS="
+ $(use_enable ipv6)
+ $(use_enable !minimal dmx)
+ $(use_enable !minimal xvfb)
+ $(use_enable !minimal xnest)
+ $(use_enable dri)
+ $(use_enable xprint)
+ --with-mesa-source=${WORKDIR}/${MESA_P}
+ --enable-xorg
+ --sysconfdir=/etc/X11
+ --localstatedir=/var
+ --enable-install-setuid
+ --with-default-font-path=/usr/share/fonts/misc,/usr/share/fonts/75dpi,/usr/share/fonts/100dpi,/usr/share/fonts/TTF,/usr/share/fonts/Type1"
+
+ # (#121394) Causes window corruption
+ filter-flags -fweb
+}
+
+src_install() {
+ x-modular_src_install
+
+ dynamic_libgl_install
+
+ use xprint && xprint_src_install
+}
+
+pkg_postinst() {
+ switch_opengl_implem
+}
+
+pkg_postrm() {
+ # Get rid of module dir to ensure opengl-update works properly
+ if ! has_version x11-base/xorg-server; then
+ if [ -e ${ROOT}/usr/$(get_libdir)/xorg/modules ]; then
+ rm -rf ${ROOT}/usr/$(get_libdir)/xorg/modules
+ fi
+ fi
+}
+
+dynamic_libgl_install() {
+ # next section is to setup the dynamic libGL stuff
+ ebegin "Moving GL files for dynamic switching"
+ dodir /usr/$(get_libdir)/opengl/${OPENGL_DIR}/extensions
+ local x=""
+ for x in ${D}/usr/$(get_libdir)/xorg/modules/extensions/libglx*; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f ${x} ${D}/usr/$(get_libdir)/opengl/${OPENGL_DIR}/extensions
+ fi
+ done
+ eend 0
+}
+
+switch_opengl_implem() {
+ # Switch to the xorg implementation.
+ # Use new opengl-update that will not reset user selected
+ # OpenGL interface ...
+ echo
+ eselect opengl set --use-old ${OPENGL_DIR}
+}
+
+xprint_src_install() {
+ # RH-style init script, we provide a wrapper
+ exeinto /usr/$(get_libdir)/misc
+ doexe ${S}/Xprint/etc/init.d/xprint
+ # Patch init script for fonts location
+ sed -e 's:/lib/X11/fonts/:/share/fonts/:g' \
+ -i ${D}/usr/$(get_libdir)/misc/xprint
+ # Install the wrapper
+ newinitd ${FILESDIR}/xprint.init xprint
+ # Install profile scripts
+ insinto /etc/profile.d
+ doins ${S}/Xprint/etc/profile.d/xprint*
+ insinto /etc/X11/xinit/xinitrc.d
+ newins ${S}/Xprint/etc/Xsession.d/cde_xsessiond_xprint.sh \
+ 92xprint-xpserverlist.sh
+ # Patch profile scripts
+ sed -e "s:/bin/sh.*get_xpserverlist:/usr/$(get_libdir)/misc/xprint \
+ get_xpserverlist:g" -i ${D}/etc/profile.d/xprint* \
+ ${D}/etc/X11/xinit/xinitrc.d/92xprint-xpserverlist.sh
+ # Move profile scripts, we can't touch /etc/profile.d/ in Gentoo
+ dodoc ${D}/etc/profile.d/xprint*
+ rm -f ${D}/etc/profile.d/xprint*
+}
diff --git a/x11-base/xorg-server/xorg-server-1.0.99.902-r1.ebuild b/x11-base/xorg-server/xorg-server-1.0.99.902-r1.ebuild
new file mode 100644
index 000000000000..d23ce2a2e78f
--- /dev/null
+++ b/x11-base/xorg-server/xorg-server-1.0.99.902-r1.ebuild
@@ -0,0 +1,283 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/xorg-server-1.0.99.902-r1.ebuild,v 1.1 2006/05/02 17:24:08 joshuabaergen Exp $
+
+# Must be before x-modular eclass is inherited
+# Hack to make sure autoreconf gets run
+SNAPSHOT="yes"
+
+inherit x-modular multilib
+
+OPENGL_DIR="xorg-x11"
+
+MESA_PN="Mesa"
+MESA_PV="6.5"
+MESA_P="${MESA_PN}-${MESA_PV}"
+MESA_SRC_P="${MESA_PN}Lib-${MESA_PV}"
+
+PATCHES="${FILESDIR}/${PN}-1.0.2-xprint-init.patch
+ ${FILESDIR}/CVE-2006-1526-xrender-mitri.patch
+ ${FILESDIR}/1.0.99.901-Xprint-xprintdir.patch"
+
+SRC_URI="${SRC_URI}
+ mirror://sourceforge/mesa3d/${MESA_SRC_P}.tar.bz2
+ http://xorg.freedesktop.org/snapshots/individual/xserver/${P}.tar.bz2"
+DESCRIPTION="X.Org X servers"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE_VIDEO_CARDS="
+ video_cards_chips
+ video_cards_epson
+ video_cards_glint
+ video_cards_i810
+ video_cards_mach64
+ video_cards_mga
+ video_cards_neomagic
+ video_cards_nv
+ video_cards_r128
+ video_cards_radeon
+ video_cards_siliconmotion
+ video_cards_via"
+IUSE="${IUSE_VIDEO_CARDS}
+ dmx dri ipv6 kdrive minimal nptl sdl xorg xprint"
+RDEPEND="x11-libs/libXfont
+ x11-libs/xtrans
+ x11-libs/libXau
+ x11-libs/libXext
+ x11-libs/libX11
+ x11-libs/libxkbfile
+ x11-libs/libXdmcp
+ x11-libs/libXmu
+ x11-libs/libXrender
+ x11-libs/libXi
+ media-libs/freetype
+ >=media-libs/mesa-6.5-r2
+ media-fonts/font-adobe-75dpi
+ media-fonts/font-misc-misc
+ media-fonts/font-cursor-misc
+ x11-misc/xbitmaps
+ || ( x11-misc/xkeyboard-config x11-misc/xkbdata )
+ x11-apps/iceauth
+ x11-apps/rgb
+ x11-apps/xauth
+ x11-apps/xinit
+ app-admin/eselect-opengl
+ x11-libs/libXaw
+ x11-libs/libXpm
+ x11-libs/libXxf86misc
+ x11-libs/libXxf86vm
+ !minimal? ( x11-libs/libdmx
+ x11-libs/libXtst
+ x11-libs/libXres )
+ x11-libs/libxkbui
+ x11-libs/liblbxutil
+ kdrive? ( sdl? ( media-libs/libsdl ) )"
+ # Xres is dmx-dependent, xkbui is xorgcfg-dependent
+ # Xaw is dmx- and xorgcfg-dependent
+ # Xpm is dmx- and xorgcfg-dependent, pulls in Xt
+ # Xxf86misc and Xxf86vm are xorgcfg-dependent
+ # liblbxutil is lbx- dependent
+DEPEND="${RDEPEND}
+ x11-proto/randrproto
+ x11-proto/renderproto
+ >=x11-proto/fixesproto-4
+ x11-proto/damageproto
+ x11-proto/xextproto
+ x11-proto/xproto
+ x11-proto/xf86dgaproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86rushproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xf86bigfontproto
+ >=x11-proto/compositeproto-0.3
+ x11-proto/recordproto
+ x11-proto/resourceproto
+ x11-proto/videoproto
+ >=x11-proto/scrnsaverproto-1.1.0
+ x11-proto/evieext
+ x11-proto/trapproto
+ >=x11-proto/xineramaproto-1.1-r1
+ x11-proto/fontsproto
+ >=x11-proto/kbproto-1.0-r1
+ x11-proto/inputproto
+ x11-proto/bigreqsproto
+ x11-proto/xcmiscproto
+ >=x11-proto/glproto-1.4.6
+ !minimal? ( x11-proto/dmxproto )
+ dri? ( x11-proto/xf86driproto
+ >=x11-libs/libdrm-2 )
+ xprint? ( x11-proto/printproto
+ x11-apps/mkfontdir
+ x11-apps/mkfontscale )"
+LICENSE="${LICENSE} MIT"
+
+pkg_setup() {
+ # localstatedir is used for the log location; we need to override the default
+ # from ebuild.sh
+ # sysconfdir is used for the xorg.conf location; same applies
+
+ # --enable-xorg needed because darwin defaults off
+ # --enable-install-setuid needed because sparcs default off
+
+ # SDL only available in kdrive build
+ if use kdrive && use sdl; then
+ conf_opts="${conf_opts} --enable-xsdl"
+ else
+ conf_opts="${conf_opts} --disable-xsdl"
+ fi
+
+ # Only Xorg and Xgl support this, and we won't build Xgl
+ # until it merges to trunk
+ if use xorg; then
+ conf_opts="${conf_opts} --with-mesa-source=${WORKDIR}/${MESA_P}"
+ fi
+
+ CONFIGURE_OPTIONS="
+ $(use_enable ipv6)
+ $(use_enable dmx)
+ $(use_enable kdrive)
+ $(use_enable !minimal xvfb)
+ $(use_enable !minimal xnest)
+ $(use_enable dri)
+ $(use_enable xorg)
+ $(use_enable xprint)
+ $(use_enable nptl glx-tls)
+ --sysconfdir=/etc/X11
+ --localstatedir=/var
+ --enable-install-setuid
+ --with-default-font-path=/usr/share/fonts/misc,/usr/share/fonts/75dpi,/usr/share/fonts/100dpi,/usr/share/fonts/TTF,/usr/share/fonts/Type1
+ ${conf_opts}"
+
+ local diemsg="You must build xorg-server and mesa with the same nptl USE setting."
+ if built_with_use media-libs/mesa nptl; then
+ use nptl || die "${diemsg}"
+ else
+ use nptl && die "${diemsg}"
+ fi
+
+ # (#121394) Causes window corruption
+ filter-flags -fweb
+
+ # Nothing else provides new enough glxtokens.h
+ ewarn "Forcing on xorg-x11 for new enough glxtokens.h..."
+ OLD_IMPLEM="$(eselect opengl show)"
+ eselect opengl set --impl-headers ${OPENGL_DIR}
+}
+
+src_unpack() {
+ x-modular_specs_check
+ x-modular_dri_check
+ x-modular_unpack_source
+ x-modular_patch_source
+
+ # Set up kdrive servers to build
+ if use kdrive; then
+ einfo "Removing unused kdrive drivers ..."
+ for card in ${IUSE_VIDEO_CARDS}; do
+ real_card=${card#video_cards_}
+
+ # Differences between VIDEO_CARDS name and kdrive server name
+ real_card=${real_card/glint/pm2}
+ real_card=${real_card/radeon/ati}
+ real_card=${real_card/nv/nvidia}
+ real_card=${real_card/siliconmotion/smi}
+ if ! use ${card}; then
+ ebegin " ${real_card}"
+ sed -i \
+ -e "s:${real_card}::g" \
+ ${S}/hw/kdrive/Makefile.am \
+ || die "sed of ${real_card} failed"
+ eend
+ fi
+
+ done
+
+ # smi and via are the only things on line 2. If line 2 ends up blank,
+ # we need to get rid of the backslash at the end of line 1.
+ if ! use video_cards_siliconmotion && ! use video_cards_via; then
+ sed -i \
+ -e "s:^\(VESA_SUBDIRS.*\)\\\:\1:g" \
+ ${S}/hw/kdrive/Makefile.am
+ fi
+
+ # Only need to reconf if we're modifying kdrive's Makefile.am
+ x-modular_reconf_source
+ fi
+}
+
+src_install() {
+ x-modular_src_install
+
+ dynamic_libgl_install
+
+ server_based_install
+}
+
+pkg_postinst() {
+ switch_opengl_implem
+}
+
+pkg_postrm() {
+ # Get rid of module dir to ensure opengl-update works properly
+ if ! has_version x11-base/xorg-server; then
+ if [ -e ${ROOT}/usr/$(get_libdir)/xorg/modules ]; then
+ rm -rf ${ROOT}/usr/$(get_libdir)/xorg/modules
+ fi
+ fi
+}
+
+dynamic_libgl_install() {
+ # next section is to setup the dynamic libGL stuff
+ ebegin "Moving GL files for dynamic switching"
+ dodir /usr/$(get_libdir)/opengl/${OPENGL_DIR}/extensions
+ local x=""
+ for x in ${D}/usr/$(get_libdir)/xorg/modules/extensions/libglx*; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f ${x} ${D}/usr/$(get_libdir)/opengl/${OPENGL_DIR}/extensions
+ fi
+ done
+ eend 0
+}
+
+server_based_install() {
+ use xprint && xprint_src_install
+
+ if ! use xorg; then
+ rm ${D}/usr/share/man/man1/Xserver.1x \
+ ${D}/usr/$(get_libdir)/xserver/SecurityPolicy \
+ ${D}/usr/$(get_libdir)/pkgconfig/xorg-server.pc \
+ ${D}/usr/share/man/man1/Xserver.1x
+ fi
+}
+
+switch_opengl_implem() {
+ # Switch to the xorg implementation.
+ # Use new opengl-update that will not reset user selected
+ # OpenGL interface ...
+ echo
+# eselect opengl set --use-old ${OPENGL_DIR}
+ eselect opengl set ${OLD_IMPLEM}
+}
+
+xprint_src_install() {
+ # RH-style init script, we provide a wrapper
+ exeinto /usr/$(get_libdir)/misc
+ doexe ${S}/Xprint/etc/init.d/xprint
+ # Patch init script for fonts location
+ sed -e 's:/lib/X11/fonts/:/share/fonts/:g' \
+ -i ${D}/usr/$(get_libdir)/misc/xprint
+ # Install the wrapper
+ newinitd ${FILESDIR}/xprint.init xprint
+ # Install profile scripts
+ insinto /etc/profile.d
+ doins ${S}/Xprint/etc/profile.d/xprint*
+ insinto /etc/X11/xinit/xinitrc.d
+ newins ${S}/Xprint/etc/Xsession.d/cde_xsessiond_xprint.sh \
+ 92xprint-xpserverlist.sh
+ # Patch profile scripts
+ sed -e "s:/bin/sh.*get_xpserverlist:/usr/$(get_libdir)/misc/xprint \
+ get_xpserverlist:g" -i ${D}/etc/profile.d/xprint* \
+ ${D}/etc/X11/xinit/xinitrc.d/92xprint-xpserverlist.sh
+ # Move profile scripts, we can't touch /etc/profile.d/ in Gentoo
+ dodoc ${D}/etc/profile.d/xprint*
+ rm -f ${D}/etc/profile.d/xprint*
+}