mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

175 lines
5.2 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/x11/xorg/xf_config.sh
  9. # ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. # extract and patch base
  23. xf_extract() {
  24. echo "Extracting source (for package version $ver) ..."
  25. for x in $xf_files ; do
  26. tar $taropt $archdir/$x
  27. done
  28. cd xc
  29. for x in $xf_patches ; do
  30. echo "Patching source ($x) ..."
  31. bunzip2 < $archdir/$x | patch -p1 -E
  32. done
  33. }
  34. # extract additional gl* stuff
  35. xf_extract_gl() {
  36. mkdir release ; ln -s ../.. release/xc
  37. tar $taropt $archdir/mangl.tar.bz2
  38. tar $taropt $archdir/manglu.tar.bz2
  39. tar $taropt $archdir/manglx.tar.bz2
  40. rm -rf release
  41. }
  42. # extract the Matrox HALlib (additional TV/DVI out support on x86)
  43. xf_extract_hallib() {
  44. echo "Extracting mgaHALlib (For Matrox (>G400) cards) ..."
  45. tar $taropt $archdir/mgadrivers-$mga_version-src.tbz2
  46. cp mgadrivers-$mga_version-src/4.2.0/drivers/src/HALlib/mgaHALlib.a \
  47. programs/Xserver/hw/xfree86/drivers/mga/HALlib/mgaHALlib.a
  48. rm -rf mgadrivers-$mga_version-src
  49. if [[ $arch == "x86" && $arch_machine != "x86_64" ]] ; then
  50. echo "Enabling Matrox HALlib (since this is x86) ..."
  51. cat >> config/cf/host.def << EOT
  52. /* Additinal TC/DVI support since this is x86 */
  53. #define HaveMatroxHal YES
  54. EOT
  55. fi
  56. }
  57. # apply the patches
  58. xf_patch() {
  59. cp -v programs/twm/system.twmrc programs/twm/system.twmrc.orig
  60. for x in $patchfiles ; do
  61. if [ -f $x ] ; then
  62. echo "Apply patch $x ..."
  63. patch -Nf -p1 < $x
  64. fi ; done
  65. find \( -name 'config.guess' -o -name 'config.sub' \) \
  66. -exec chmod +x '{}' ';'
  67. }
  68. # build the World
  69. xf_build() {
  70. eval $MAKE World
  71. cd nls ; eval $MAKE ; cd ..
  72. }
  73. # install the World
  74. xf_install() {
  75. echo "Create /etc/X11 (if it's not already there) ..."
  76. mkdir -p $root/etc/X11
  77. eval $MAKE install
  78. eval $MAKE install.man
  79. cd nls ; eval $MAKE install ; cd ..
  80. rm -fv $root/etc/fonts/*.bak
  81. rm -fv $root/usr/X11
  82. rm -fv $root/usr/bin/X11
  83. rm -fv $root/usr/lib/X11
  84. rm -fv $root/usr/include/X11
  85. ln -sv X11R6 $root/usr/X11
  86. ln -sv ../X11/bin $root/usr/bin/X11
  87. ln -sv ../X11/lib/X11 $root/usr/lib/X11
  88. ln -sv ../X11/include/X11 $root/usr/include/X11
  89. mkdir -p $root/usr/X11R6/lib/X11/fonts/TrueType
  90. echo "Copy TWM config files ..."
  91. cp -v programs/twm/system.twmrc.orig \
  92. programs/twm/sample-twmrc/original.twmrc
  93. cp -v programs/twm/sample-twmrc/*.twmrc $root/usr/X11R6/lib/X11/twm/
  94. register_wm twm TWM /usr/X11/bin/twm
  95. echo "Copying default example configs ..."
  96. cp -fv $base/package/x11/${pkg}/xorg.conf.data \
  97. $root/etc/X11/xorg.conf.example
  98. cp -fv $root/etc/X11/xorg.conf{.example,}
  99. cp -fv $base/package/x11/${pkg}/local.conf.data \
  100. $root/etc/fonts/local.conf
  101. echo "Fixing compiled keymaps directory ..."
  102. mkdir -p $root/var/lib/xkb $root/etc/X11/xkb
  103. cp -fu programs/xkbcomp/compiled/README $root/var/lib/xkb
  104. rm -rf $root/etc/X11/xkb/compiled
  105. ln -sf ../../../var/lib/xkb $root/etc/X11/xkb/compiled
  106. echo "Installing xfs init script ..."
  107. install_init xfs $base/package/x11/${pkg}/xfs.init
  108. register_xdm xdm 'X11 dislay manager' /usr/X11R6/bin/xdm
  109. echo "Installing the xdm start script (multiplexer) ..."
  110. cp $confdir/startxdm.sh $root/usr/X11R6/bin/startxdm
  111. chmod +x $root/usr/X11R6/bin/startxdm
  112. echo "Installing X-Windows Setup Script ..."
  113. cp -fv $base/package/x11/${pkg}/stone_mod_${pkg}.sh $root/etc/stone.d/mod_${pkg}.sh
  114. echo "export WINDOWMANAGER=kde" > $root/etc/profile.d/windowmanager
  115. echo "Installing X-Windows Cron Script ..."
  116. cp -fv $base/package/x11/${pkg}/${pkg}.cron \
  117. $root/etc/cron.daily/80-${pkg}
  118. chmod +x $root/etc/cron.daily/80-${pkg}
  119. }
  120. # configure the World
  121. xf_config() {
  122. echo "Configuring X-Windows ..."
  123. cat >> config/cf/host.def << EOT
  124. /* Disable the internal zlib to use the system installed one */
  125. #define HasZlib YES
  126. /* Disable the internal expat library to use the system installed one */
  127. #define HasExpat YES
  128. /* Less warnings with recent gccs ... */
  129. #define DefaultCCOptions -ansi GccWarningOptions
  130. /* Make sure config files are allways installed ... */
  131. #define InstallXinitConfig YES
  132. #define InstallXdmConfig YES
  133. #define InstallFSConfig YES
  134. /* do not install duplicate crap in /etc/X11 */
  135. #define UseSeparateConfDir NO
  136. EOT
  137. if [[ $arch == "x86" && $arch_machine != "x86_64" ]] ; then
  138. echo "Enabling Matrox HALlib (since this is x86) ..."
  139. cat >> config/cf/host.def << EOT
  140. /* Additinal TV/DVI support since this is x86 */
  141. #define HaveMatroxHal YES
  142. EOT
  143. fi
  144. }