summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/glibc/glibc.install
blob: 17c6b5d82503445f3309c365b1ecf8b9456d9275 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
infodir=/usr/share/info
filelist=(libc.info libc.info-1 libc.info-2 libc.info-3 libc.info-4 libc.info-5 libc.info-6 libc.info-7 
          libc.info-8 libc.info-9 libc.info-10 libc.info-11)

pre_upgrade() {
if [ "`uname -m`" = "x86_64" ]; then
 if [ "`vercmp $2 2.4`" -lt 0 ]; then
   cat << _EOF
  ==> glibc oldpkgver < 2.4 detected!
  ==> 
  ==> ATTENTION x86_64 USERS:
  ==>
  ==> We now switch from the former lib-linking to pure /lib support. To get rid
  ==> of all lib64 directories we have removed the link /lib -> /lib64 and
  ==> /usr/lib -> /usr/lib64.
  ==> 
  ==> We have also rebuilt all packages we know that still used lib64 directories.
  ==> Now all should go to /lib directories.
  ==> 
  ==> Internally we have removed the link and then mv /lib64 /lib. Same to /usr/lib64.
  ==> /lib64 and /usr/lib64 shouldn't exist anymore. If any package still installs to
  ==> /lib64 or /usr/lib64 let us know.
  ==>
_EOF

# now the moving
rm -rf /lib/tls && echo "/lib/tls removed"
ldconfig -r .
rm -f /usr/lib
mv /usr/lib64 /usr/lib && echo "/usr/lib64 moved"
rm -f /lib
mv /lib64 /lib && echo "/lib64 moved"

 fi
fi

 [ -x usr/bin/install-info ] || return 0
 for file in ${filelist[@]}; do
    usr/bin/install-info $infodir/$file $infodir/dir 2> /dev/null
 done
}

post_upgrade() {
  ldconfig -r .
  init u

  if [ "`vercmp $2 2.3.6`" -lt 0 ]; then
    cat << _EOF
  ==> ATTENTION INTERNATIONAL USERS:
  ==>
  ==> Locales are no longer included in the glibc package.
  ==> They are generated by /usr/sbin/locale-gen depending on the contents
  ==> of /etc/locale.gen.
  ==> glibc will try to autodetect the required locales now, if you need
  ==> additional locales, please enable them in /etc/locale.gen and run
  ==> /usr/sbin/locale-gen
  ==>  
_EOF
    # Check active locales, enable the ones that are in use
    loc=("$LANG"
         "`grep '^LOCALE=' etc/rc.conf | awk -F '=' '{ print $2 }'`")
    for l in "${loc[@]}"; do
      if [ ! -z "${l}" ]; then
        line="`grep -i "^#${l}[[:space:]]" etc/locale.gen`"
        if [ ! -z "${line}" ]; then
          sed -i -e "s|${line}|${line/\#/}|" etc/locale.gen
        fi
      fi
    done
  fi

  usr/sbin/locale-gen

# fix CHOST for arch64
if [ "`uname -m`" = "x86_64" ]; then
 if [ "`vercmp $2 2.4`" -lt 0 ]; then
  sed -i s/'x86_64-pc-linux-gnu'/'x86_64-unknown-linux-gnu'/ /etc/makepkg.conf && \
  echo "in /etc/makepkg.conf CHOST has been changed to \"x86_64-unknown-linux-gnu\""

  # we remove files from glibc 2.3.6 that are not removed automatically
  rm -f /lib/ld-2.3.* && echo "removing unneeded old files"
  rm -f /lib/libBrokenLocale-2.3.*
  rm -f /lib/libNoVersion*
  rm -f /lib/libanl-2.3.*
  rm -f /lib/libc-2.3.*
  rm -f /lib/libcidn-2.3.*
  rm -f /lib/libcrypt-2.3.*
  rm -f /lib/libdl-2.3.*
  rm -f /lib/libm-2.3.*
  rm -f /lib/libnsl-2.3.*
  rm -f /lib/libnss1*
  rm -f /lib/libnss_compat-2.3.*
  rm -f /lib/libnss_dns-2.3.*
  rm -f /lib/libnss_dns.so.1
  rm -f /lib/libnss_files-2.3.*
  rm -f /lib/libnss_files.so.1
  rm -f /lib/libnss_hesiod-2.3.*
  rm -f /lib/libnss_nis-2.3.*
  rm -f /lib/libnss_nis.so.1
  rm -f /lib/libnss_nisplus-2.3.*
  rm -f /lib/libpthread-0.10.so
  rm -f /lib/libresolv-2.3.*
  rm -f /lib/librt-2.3.*
  rm -f /lib/libutil-2.3.*
  rm -fR /lib/nosegneg
  #rm -fR /usr/include/asm
  #rm -fR /usr/include/linux
  rm -fR /usr/include/ntpl
  rm -f /usr/lib/libNoVersion*
  rm -f /usr/lib/libc_stubs.a
  rm -f /usr/lib/libnss1*
  rm -f /usr/lib/libnss_compat.so.1
  rm -f /usr/lib/libnss_dns.so.1
  rm -f /usr/lib/libnss_files.so.1
  rm -f /usr/lib/libnss_nis.so.1
  rm -fR /usr/lib/nptl
  rm -f /usr/sbin/nscd_nischeck
  rm -fR /usr/share/zoneinfo/SystemV
  rm -fR /usr/share/zoneinfo/posix/SystemV
  rm -fR /usr/share/zoneinfo/right/SystemV
  ldconfig -r .
 fi
fi

 [ -x usr/bin/install-info ] || return 0
 for file in ${filelist[@]}; do
    usr/bin/install-info $infodir/$file $infodir/dir 2> /dev/null
 done
}

pre_remove() {
  [ -x usr/bin/install-info ] || return 0
  for file in ${filelist[@]}; do
    usr/bin/install-info --delete $infodir/$file $infodir/dir 2> /dev/null
  done
}