FIXUPHACK 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. mkdir -p ../glibc_DEV/sbin
  2. if [ -f sbin/ldconfig.real ];then
  3. mv -f sbin/ldconfig.real ../glibc_DEV/sbin/ldconfig
  4. rm -f sbin/ldconfig
  5. else
  6. mv -f sbin/ldconfig ../glibc_DEV/sbin/
  7. fi
  8. #slackware 13.1...
  9. rm -f ./etc/profile.d/*.csh* 2>/dev/null
  10. #120315 NOTICE: below situation quite a lot of pkgs, so have put a big fix into 3builddistro...
  11. ##120315 Ubuntu Precise Pangolin, they have moved the goalposts again...
  12. #if [ ! -e ./lib/libc.so.6 ];then
  13. # #all the libs are in /lib/i386-linux-gnu/
  14. # GLIBCLIBS="`find lib -mindepth 2 -name libc.so.6 | head -n 1`"
  15. # if [ "$GLIBCLIBS" ];then
  16. # GLIBCPATH="`dirname $GLIBCLIBS`"
  17. # cp -a -f --remove-destination ${GLIBCPATH}/* ./lib/
  18. # sync
  19. # rm -rf $GLIBCPATH
  20. # #need this symlink, as when move libs in devx below, symlinked libs are wrong...
  21. # ln -s ./ $GLIBCPATH
  22. # #devx, move these to glibc_DEV/lib also...
  23. # if [ -d ../glibc_DEV/${GLIBCPATH} ];then
  24. # mkdir -p ../glibc_DEV/lib
  25. # cp -a -f --remove-destination ../glibc_DEV/${GLIBCPATH}/* ../glibc_DEV/lib/
  26. # sync
  27. # rm -rf ../glibc_DEV/$GLIBCPATH
  28. # fi
  29. # #something weird in 2createpackages, /lib/i386-linux-gnu get built at glibc_DEV/usr/lib/i386-linux-gnu...
  30. # if [ -d ../glibc_DEV/usr/${GLIBCPATH} ];then
  31. # mkdir -p ../glibc_DEV/lib
  32. # cp -a -f --remove-destination ../glibc_DEV/usr/${GLIBCPATH}/* ../glibc_DEV/lib/
  33. # sync
  34. # rm -rf ../glibc_DEV/usr/$GLIBCPATH
  35. # fi
  36. # fi
  37. #fi
  38. #120620 my cut-down cache breaks things...
  39. ##120526
  40. ##/usr/lib/gconv has a cutdown set of files, need to use correct cache file...
  41. #mv -f usr/lib/gconv-cut/gconv-modules usr/lib/gconv/
  42. #mv -f usr/lib/gconv-cut/gconv-modules.cache usr/lib/gconv/
  43. #rm -rf usr/lib/gconv-cut
  44. #120829 now have full /usr/share/timezone, delete some things... no, seems all needed!!!
  45. #[ -d usr/share/zoneinfo/posix ] && rm -rf usr/share/zoneinfo/posix
  46. #[ -d usr/share/zoneinfo/right ] && rm -rf usr/share/zoneinfo/right
  47. #[ -d usr/share/zoneinfo/SystemV ] && rm -rf usr/share/zoneinfo/SystemV
  48. #130307 arch has moved libs from /lib to /usr/lib, which breaks chroot. move them back to proper place...
  49. if [ "$DISTRO_BINARY_COMPAT" = "arch" ];then #exported from 2createpackages.
  50. FNDCLIBS="$(find usr/lib -mindepth 1 -maxdepth 1 -name '*.so*')"
  51. if [ "$FNDCLIBS" != "" ];then
  52. for ONECLIB in $FNDCLIBS
  53. do
  54. [ "$ONECLIB" = "" ] && continue
  55. BASECLIB="$(basename $ONECLIB)"
  56. #it seems, traditionally, these stay in /usr/lib...
  57. [ "$BASECLIB" = "libc.so" ] && [ ! -h $ONECLIB ] && continue
  58. [ "$BASECLIB" = "libpthread.so" ] && [ ! -h $ONECLIB ] && continue
  59. cp -a -f --remove-destination $ONECLIB ./lib/
  60. rm -f $ONECLIB
  61. done
  62. #traditionally, there are some symlinks in /usr/lib, recreate...
  63. FNDSYMLINKS="$(find lib -mindepth 1 -maxdepth 1 -name '*.so.[0-9]')"
  64. if [ "$FNDSYMLINKS" != "" ];then
  65. for ONESYMLINK in $FNDSYMLINKS
  66. do
  67. [ "$ONESYMLINK" = "" ] && continue
  68. if [ -h $ONESYMLINK ];then
  69. #TARGETLINK="$(readlink $ONESYMLINK)"
  70. TARGETLINK="$(basename $ONESYMLINK)"
  71. BASESYM="$(basename $ONESYMLINK | rev | cut -f 2-9 -d '.' | rev)"
  72. [ -e usr/lib/$BASESYM ] && continue
  73. ln -s ../../lib/$TARGETLINK usr/lib/$BASESYM
  74. fi
  75. done
  76. fi
  77. fi
  78. #do the same for glibc_DEV...
  79. mkdir -p ../glibc_DEV/lib
  80. mkdir -p ../glibc_DEV/usr/lib
  81. FNDCLIBS="$(find ../glibc_DEV/usr/lib -mindepth 1 -maxdepth 1 -name '*.so*')"
  82. if [ "$FNDCLIBS" != "" ];then
  83. for ONECLIB in $FNDCLIBS
  84. do
  85. [ "$ONECLIB" = "" ] && continue
  86. BASECLIB="$(basename $ONECLIB)"
  87. #it seems, traditionally, these stay in /usr/lib...
  88. [ "$BASECLIB" = "libc.so" ] && [ ! -h $ONECLIB ] && continue
  89. [ "$BASECLIB" = "libpthread.so" ] && [ ! -h $ONECLIB ] && continue
  90. cp -a -f --remove-destination $ONECLIB ../glibc_DEV/lib/
  91. rm -f $ONECLIB
  92. done
  93. #traditionally, there are some symlinks in /usr/lib, recreate...
  94. FNDSYMLINKS="$(find ../glibc_DEV/lib -mindepth 1 -maxdepth 1 -name '*.so.[0-9]')"
  95. if [ "$FNDSYMLINKS" != "" ];then
  96. for ONESYMLINK in $FNDSYMLINKS
  97. do
  98. [ "$ONESYMLINK" = "" ] && continue
  99. if [ -h $ONESYMLINK ];then
  100. #TARGETLINK="$(readlink $ONESYMLINK)"
  101. TARGETLINK="$(basename $ONESYMLINK)"
  102. BASESYM="$(basename $ONESYMLINK | rev | cut -f 2-9 -d '.' | rev)"
  103. [ -e ../glibc_DEV/usr/lib/$BASESYM ] && continue
  104. ln -s ../../lib/$TARGETLINK ../glibc_DEV/usr/lib/$BASESYM
  105. fi
  106. done
  107. fi
  108. fi
  109. fi