Contents of /trunk/core/glibc/glibc-2.15-r1.smage2
Parent Directory | Revision Log
Revision 12597 -
(show annotations)
(download)
Wed Jun 13 14:57:42 2012 UTC (12 years ago) by niro
File size: 16902 byte(s)
Wed Jun 13 14:57:42 2012 UTC (12 years ago) by niro
File size: 16902 byte(s)
-install /sbin into /usr/sbin
1 | # $Id$ |
2 | |
3 | PNAME="glibc" |
4 | PVER="2.15" |
5 | PBUILD="r1" |
6 | |
7 | PCAT="sys-libs" |
8 | |
9 | DESCRIPTION="GNU libc6 (also called glibc2) C library with NPTL Threads." |
10 | HOMEPAGE="http://www.gnu.org/software/libc/libc.html" |
11 | |
12 | DEPEND=">= sys-apps/base-files-0.1" |
13 | |
14 | # we force headers to one specific version |
15 | # (for x86_64 2.6.12.0-r2 bi-arch headers are needed!) |
16 | SDEPEND="== sys-kernel/linux-libc-headers-3.1.8" |
17 | PROVIDE="virtual/glibc" |
18 | |
19 | # functions to include in the mage file |
20 | SPECIAL_FUNCTIONS="fix_db_files" |
21 | |
22 | SRCFILE="glibc-${PVER/.0/}.tar.xz" |
23 | SRCDIR="${BUILDDIR}/glibc-${PVER/.0/}" |
24 | |
25 | sminclude mtools |
26 | |
27 | SRC_URI=( |
28 | ftp://sources.redhat.com/pub/glibc/releases/${SRCFILE} |
29 | ftp://sources.redhat.com/pub/glibc/snapshots/${SRCFILE} |
30 | gnu://${PNAME}/${SRCFILE} |
31 | mirror://${PNAME}/${SRCFILE} |
32 | mirror://${PNAME}/glibc.envd |
33 | mirror://${PNAME}/locale.gen-header |
34 | mirror://${PNAME}/locale-gen |
35 | mirror://${PNAME}/${PNAME}-2.12.1-bz4781.patch |
36 | mirror://${PNAME}/${PNAME}-2.12.1-i686.patch |
37 | mirror://${PNAME}/${PNAME}-2.12.2-ignore-origin-of-privileged-program.patch |
38 | mirror://${PNAME}/${PNAME}-2.13-dlclose-search-reset.patch |
39 | mirror://${PNAME}/${PNAME}-2.14-libdl-crash.patch |
40 | mirror://${PNAME}/${PNAME}-2.14-reexport-rpc-interface.patch |
41 | mirror://${PNAME}/${PNAME}-2.14-reinstall-nis-rpc-headers.patch |
42 | mirror://${PNAME}/${PNAME}-${PVER}-fix-res_query-assert.patch |
43 | mirror://${PNAME}/${PNAME}-${PVER}-lddebug-scopes.patch |
44 | mirror://${PNAME}/${PNAME}-${PVER}-revert-c5a0802a.patch |
45 | mirror://${PNAME}/${PNAME}-${PVER}-scanf.patch |
46 | mirror://${PNAME}/${PNAME}-${PVER}-ifunc.patch |
47 | mirror://${PNAME}/${PNAME}-${PVER}-avx.patch |
48 | mirror://${PNAME}/${PNAME}-${PVER}-strcasecmp-disable-avx.patch |
49 | mirror://${PNAME}/${PNAME}-${PVER}-gb18030.patch |
50 | mirror://${PNAME}/${PNAME}-${PVER}-revert-netlink-cache.patch |
51 | mirror://${PNAME}/${PNAME}-${PVER}-arena.patch |
52 | mirror://${PNAME}/${PNAME}-${PVER}-negative-result-cache.patch |
53 | mirror://${PNAME}/${PNAME}-${PVER}-multiarch-x86-strcmp.patch |
54 | mirror://${PNAME}/${PNAME}-${PVER}-vdso.patch |
55 | mirror://${PNAME}/${PNAME}-${PVER}-feraiseexcept-plt.patch |
56 | mirror://${PNAME}/${PNAME}-${PVER}-vfprintf-nargs.patch |
57 | mirror://${PNAME}/${PNAME}-${PVER}-__libc_res_nquerydomain-out-of-bounds.patch |
58 | mirror://${PNAME}/${PNAME}-${PVER}-fmtmsg-locking.patch |
59 | mirror://${PNAME}/${PNAME}-${PVER}-non-signalling-comparisons.patch |
60 | mirror://${PNAME}/${PNAME}-${PVER}-rintf-rounding.patch |
61 | mirror://${PNAME}/${PNAME}-${PVER}-nearbyintf-rounding.patch |
62 | mirror://${PNAME}/${PNAME}-${PVER}-confstr-local-buffer-extent.patch |
63 | mirror://${PNAME}/${PNAME}-${PVER}-testsuite.patch |
64 | ) |
65 | |
66 | # sed line: on 2 digits add an zero: 2.7 -> 2.7.0 |
67 | UP2DATE="updatecmd_gnu ${PNAME/-nptl/} | sed 's/^\([0-9]\.[0-9]\$\)/\1.0/'" |
68 | |
69 | # glibc don't like strong CFLAGS |
70 | export CFLAGS="${CFLAGS//-O?} -O2" |
71 | # glibc -> nptl thread don't like striping |
72 | msetfeature "!strip" |
73 | # gcc 3.0 - 3.3 needs this: |
74 | export CFLAGS="${CFLAGS} -finline-limit=2000" |
75 | export CXXFLAGS="${CFLAGS}" |
76 | export LDFLAGS="${LDFLAGS//-Wl,--relax}" |
77 | |
78 | # hack to fix NPTL issues with xen, only required on 32bit arches |
79 | if [[ ${ARCH} = i*86 ]] |
80 | then |
81 | export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs" |
82 | fi |
83 | |
84 | # glibc-2.6.1 and above needs march CFLAGS: -march=${ARCH} -mtune=generic |
85 | # first filter -mtune and -march from flags |
86 | for flag in ${CFLAGS} |
87 | do |
88 | case ${flag} in |
89 | -mtune=*) continue ;; |
90 | -march=*) continue ;; |
91 | esac |
92 | newflags="${newflags} ${flag}" |
93 | done |
94 | export CFLAGS="${newflags}" |
95 | |
96 | # than add our defaults for glibc |
97 | [[ ${ARCH} = i*86 ]] && export CFLAGS="${CFLAGS} -march=${ARCH}" # only i*86 |
98 | export CFLAGS="${CFLAGS} -mtune=generic" # all arches |
99 | export CXXFLAGS="${CFLAGS}" |
100 | |
101 | # use other linux-headers |
102 | [[ -z ${ALT_HEADERS} ]] && export ALT_HEADERS="/usr/include" |
103 | |
104 | # kernel support |
105 | export ENABLE_KERNEL=2.6.32 |
106 | |
107 | src_prepare() |
108 | { |
109 | munpack ${SRCFILE} || die |
110 | cd ${SRCDIR} |
111 | |
112 | # http://sources.redhat.com/bugzilla/show_bug.cgi?id=4781 |
113 | mpatch ${PNAME}-2.12.1-bz4781.patch || die |
114 | |
115 | # http://sources.redhat.com/bugzilla/show_bug.cgi?id=411 |
116 | # http://sourceware.org/ml/libc-alpha/2009-07/msg00072.html |
117 | mpatch ${PNAME}-2.12.1-i686.patch || die |
118 | |
119 | # security fix, fixes CVE-2010-3847 |
120 | # see: http://www.exploit-db.com/exploits/15274/ |
121 | mpatch ${PNAME}-2.12.2-ignore-origin-of-privileged-program.patch || die |
122 | |
123 | # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=675155e9 (fedora branch) |
124 | # http://sourceware.org/ml/libc-alpha/2011-06/msg00006.html |
125 | mpatch ${PNAME}-2.14-libdl-crash.patch || die |
126 | |
127 | # re-export RPC interface until libtirpc is ready as a replacement |
128 | # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=acee4873 (fedora branch) |
129 | mpatch ${PNAME}-2.14-reexport-rpc-interface.patch || die |
130 | # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=bdd816a3 (fedora branch) |
131 | mpatch ${PNAME}-2.14-reinstall-nis-rpc-headers.patch || die |
132 | |
133 | # fix res_query assertion |
134 | # http://sourceware.org/bugzilla/show_bug.cgi?id=13013 |
135 | mpatch ${PNAME}-${PVER}-fix-res_query-assert.patch || die |
136 | |
137 | # fix up regcomp/regexec |
138 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=2ba92745 |
139 | # mpatch ${PNAME}-${PVER}-regex.patch |
140 | |
141 | # propriety nvidia crash - https://bugzilla.redhat.com/show_bug.cgi?id=737223 |
142 | # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=0c95ab64 (fedora branch) |
143 | mpatch ${PNAME}-${PVER}-lddebug-scopes.patch || die |
144 | |
145 | # revert commit c5a0802a - causes various hangs |
146 | # https://bugzilla.redhat.com/show_bug.cgi?id=769421 |
147 | # Note: fedora may have actual fix (not submitted upstream yet...) |
148 | # http://pkgs.fedoraproject.org/gitweb/?p=glibc.git;a=blob_plain;f=glibc-rh552960-2.patch |
149 | mpatch ${PNAME}-${PVER}-revert-c5a0802a.patch || die |
150 | |
151 | # fix realloc usage in vfscanf |
152 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=20b38e03 |
153 | mpatch ${PNAME}-${PVER}-scanf.patch || die |
154 | |
155 | # fix ifunc relocations |
156 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=6ee65ed6 |
157 | mpatch ${PNAME}-${PVER}-ifunc.patch || die |
158 | |
159 | # fix AVX detection |
160 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=afc5ed09 |
161 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=08cf777f |
162 | mpatch ${PNAME}-${PVER}-avx.patch || die |
163 | # and "fix" strcasecmp |
164 | mpatch ${PNAME}-${PVER}-strcasecmp-disable-avx.patch || die |
165 | |
166 | # fix GB18030 charmap |
167 | # http://sourceware.org/bugzilla/show_bug.cgi?id=11837 |
168 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=2a57bd79 (fedora branch) |
169 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=3d828a61 (fedora branch) |
170 | mpatch ${PNAME}-${PVER}-gb18030.patch || die |
171 | |
172 | # fix crash in __nscd_get_mapping if nscd not running |
173 | # http://sourceware.org/bugzilla/show_bug.cgi?id=13594 (potential fix in comment) |
174 | # reverts commit 3a2c0242 and other necessary following changes... |
175 | mpatch ${PNAME}-${PVER}-revert-netlink-cache.patch || die |
176 | |
177 | # handle ARENA_TEST correctly |
178 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=41b81892 |
179 | mpatch ${PNAME}-${PVER}-arena.patch || die |
180 | |
181 | # do not cache negative results in nscd if these are transient |
182 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=3e1aa84e |
183 | mpatch ${PNAME}-${PVER}-negative-result-cache.patch || die |
184 | |
185 | # strcasecmp_l, strncasecmp_l act as strcmp for multiarch x86 |
186 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=0bab47b6 |
187 | mpatch ${PNAME}-${PVER}-multiarch-x86-strcmp.patch || die |
188 | |
189 | # always set l_used for vDSO. |
190 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=1f393a11 |
191 | mpatch ${PNAME}-${PVER}-vdso.patch || die |
192 | |
193 | # fix x86 PLT slot usage for feraiseexcept |
194 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=7c35ffed |
195 | mpatch ${PNAME}-${PVER}-feraiseexcept-plt.patch || die |
196 | |
197 | # vfprintf nargs overflow - CVE-2012-0864 |
198 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=7c1f4834 |
199 | mpatch ${PNAME}-${PVER}-vfprintf-nargs.patch || die |
200 | |
201 | # avoid out ouf bounds read in __libc_res_nquerydomain |
202 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=8fdceb2e |
203 | mpatch ${PNAME}-${PVER}-__libc_res_nquerydomain-out-of-bounds.patch || die |
204 | |
205 | # make fmtmsg function thread-safe |
206 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=7724defc |
207 | mpatch ${PNAME}-${PVER}-fmtmsg-locking.patch || die |
208 | |
209 | # use non-signaling floating-point comparisons in math functions |
210 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=92221550 |
211 | mpatch ${PNAME}-${PVER}-non-signalling-comparisons.patch || die |
212 | |
213 | # fix rintf rounding. |
214 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=fe45ce09 |
215 | mpatch ${PNAME}-${PVER}-rintf-rounding.patch || die |
216 | |
217 | # fix nearbyintf rounding |
218 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=6cbeae47 |
219 | mpatch ${PNAME}-${PVER}-nearbyintf-rounding.patch || die |
220 | |
221 | # fix varaible scope issue in confstr |
222 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=ac4c54f0 |
223 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=d6a403f9 |
224 | mpatch ${PNAME}-${PVER}-confstr-local-buffer-extent.patch || die |
225 | |
226 | # fix testsuite failures with --as-needed |
227 | # http://sourceware.org/git/?p=glibc.git;a=commit;h=d4c2917f |
228 | mpatch ${PNAME}-${PVER}-testsuite.patch || die |
229 | |
230 | # binutils patch needs reconf |
231 | autoconf --force || die |
232 | |
233 | # fix permissions on some of the scripts |
234 | chmod u+x ${SRCDIR}/scripts/*.sh || die |
235 | |
236 | install -d ${SRCDIR}/build || die |
237 | cd ${SRCDIR}/build |
238 | |
239 | if [ ! -f /etc/ld.so.conf ] |
240 | then |
241 | touch /etc/ld.so.conf || die |
242 | fi |
243 | } |
244 | |
245 | src_compile() |
246 | { |
247 | local myopts |
248 | |
249 | # generic pathes |
250 | myopts="--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info" |
251 | # disable profiling |
252 | myopts+=" --disable-profile" |
253 | # enable addons |
254 | myopts+=" --enable-add-ons=nptl,libidn" |
255 | # enable tls |
256 | myopts+=" --with-tls --with-__thread" |
257 | # supported kernel-release |
258 | myopts+=" --enable-kernel=${ENABLE_KERNEL}" |
259 | # disable cvs and gd support |
260 | myopts+=" --without-cvs --without-gd" |
261 | # enable bindnow |
262 | myopts+=" --enable-bind-now" |
263 | |
264 | # support multilib lib64 dir (x86_64 only) |
265 | if [[ ${ARCH} = x86_64 ]] |
266 | then |
267 | # first build a -m32 version |
268 | install -d ${SRCDIR}/build-m32 |
269 | cd ${SRCDIR}/build-m32 |
270 | |
271 | CC="gcc -m32" CXX="g++ -m32" \ |
272 | CFLAGS="${CFLAGS//-march=${ARCH}} -march=i686" \ |
273 | CXXFLAGS="${CXXFLAGS//-march=${ARCH}} -march=i686" \ |
274 | ../configure \ |
275 | --build=${CHOST} \ |
276 | --host=i686-pc-linux-gnu \ |
277 | --libdir=/usr/lib \ |
278 | --libexecdir=/usr/lib/glibc \ |
279 | ${myopts} \ |
280 | || die |
281 | |
282 | make PARALLELMFLAGS="${MAKEOPTS}" || die |
283 | fi |
284 | |
285 | cd ${SRCDIR}/build |
286 | |
287 | if [[ ${ARCH} = x86_64 ]]; then |
288 | # make sure the -m64 libs goes really to /lib64 |
289 | echo "slibdir=/$(mlibdir)" >> ${SRCDIR}/build/configparms || die |
290 | fi |
291 | |
292 | # kernel-2.6 with nptl needs this |
293 | ../configure \ |
294 | --build=${CHOST} \ |
295 | --host=${CHOST} \ |
296 | --libdir=/usr/$(mlibdir) \ |
297 | --libexecdir=/usr/$(mlibdir)/glibc \ |
298 | ${myopts} \ |
299 | || die |
300 | |
301 | make PARALLELMFLAGS="${MAKEOPTS}" || die |
302 | } |
303 | |
304 | src_install() |
305 | { |
306 | if [[ ${ARCH} = x86_64 ]] |
307 | then |
308 | # install -m32 libs |
309 | cd ${SRCDIR}/build-m32 |
310 | make PARALLELMFLAGS="${MAKEOPTS}" install_root=${BINDIR} slibdir=/usr/lib rootsbindir=/usr/sbin install || die |
311 | fi |
312 | |
313 | cd ${SRCDIR}/build |
314 | make PARALLELMFLAGS="${MAKEOPTS}" install_root=${BINDIR} slibdir=/usr/$(mlibdir) rootsbindir=/usr/sbin install || die |
315 | |
316 | # do not generate the locales here, let it the user do with the locale-gen tool |
317 | # make PARALLELMFLAGS="${MAKEOPTS}" install_root=${BINDIR} localedata/install-locales || die |
318 | |
319 | # install locales list and generate tools |
320 | # generate locale.gen file from localedata/SUPPORTED file |
321 | minstalletc locale.gen-header locale.gen || die |
322 | sed \ |
323 | -e 's:/: :g' \ |
324 | -e 's:\\: :g' \ |
325 | -e 's:SUPPORTED-LOCALES=::' \ |
326 | -e 's:\ \ $::g' \ |
327 | -e '/^#/d' \ |
328 | -e 's:^:#:g' \ |
329 | ${SRCDIR}/localedata/SUPPORTED \ |
330 | >> ${BINDIR}/etc/locale.gen || die |
331 | minstalldir /usr/sbin || die |
332 | minstallexec -s locale-gen /usr/sbin || die |
333 | |
334 | # nsswitch configuration file |
335 | minstalletc ${SRCDIR}/nss/nsswitch.conf || die |
336 | |
337 | # nscd configuration file |
338 | minstalletc ${SRCDIR}/nscd/nscd.conf || die |
339 | |
340 | # gai configuration file |
341 | minstalletc ${SRCDIR}/posix/gai.conf || die |
342 | |
343 | # we use Berlin as default |
344 | cp --remove-destination ${BINDIR}/usr/share/zoneinfo/Europe/Berlin ${BINDIR}/etc/localtime || die |
345 | [ -f ${BINDIR}/etc/ld.so.conf ] && { rm -f ${BINDIR}/etc/ld.so.conf || die; } |
346 | [ -e ${BINDIR}/etc/ld.so.cache ] && { rm -rf ${BINDIR}/etc/ld.so.cache || die; } |
347 | |
348 | # base environment |
349 | minstallenv glibc.envd 00glibc || die |
350 | if [[ ${ARCH} = x86_64 ]] |
351 | then |
352 | MCONFIG="/etc/env.d/00glibc" |
353 | maddconfig "LDPATH=\"/usr/local/$(mlibdir)\"" || die |
354 | maddconfig "LDPATH=\"/opt/$(mlibdir)\"" || die |
355 | fi |
356 | |
357 | # strip all binaries |
358 | find ${BINDIR} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded || die |
359 | |
360 | # strip all libraries |
361 | # want to be safe here; --strip-unneeded seems to cause pthread problems |
362 | # strip all but libpthread |
363 | install -d ${BUILDDIR}/thread-backup || die |
364 | mv ${BINDIR}/usr/$(mlibdir)/lib{pthread,thread_db}* ${BUILDDIR}/thread-backup/ || die |
365 | |
366 | # now strip |
367 | find ${BINDIR} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded || die |
368 | mv -f ${BUILDDIR}/thread-backup/* ${BINDIR}/usr/$(mlibdir)/ || die |
369 | # remove stale directory |
370 | rm -rf ${BUILDDIR}/thread-backup || die |
371 | |
372 | # prepare glibc for installation; slackware method |
373 | minstalldir /incoming || die |
374 | mv ${BINDIR}/usr/$(mlibdir)/*.so ${BINDIR}/incoming || die |
375 | mv ${BINDIR}/usr/$(mlibdir)/*.so.* ${BINDIR}/incoming || die |
376 | mv ${BINDIR}/incoming ${BINDIR}/usr/$(mlibdir)/incoming || die |
377 | mv ${BINDIR}/usr/$(mlibdir)/incoming/libSegFault.so ${BINDIR}/usr/$(mlibdir) || die |
378 | } |
379 | |
380 | fix_db_files() |
381 | { |
382 | local i |
383 | local DB_ENTRY="${BUILDDIR}/${PKGNAME}" |
384 | |
385 | for i in .files .symlinks .dirs |
386 | do |
387 | [ ! -f ${DB_ENTRY}/${i} ] && continue |
388 | [[ -z $(< ${DB_ENTRY}/${i}) ]] && continue |
389 | |
390 | echo " fixing /$(mlibdir)/incoming from db-entry '${i}' ..." |
391 | |
392 | # /lib/incoming -> empty line; sed2 removes all empty lines |
393 | #sed -i -e "s:/$(mlibdir)/incoming.*::g" -e '/^$/d' ${DB_ENTRY}/${i} |
394 | # do not simply emtpy the line, but change it the the correct path, |
395 | # so no stale libs are around if the package gets updated! |
396 | sed -i \ |
397 | -e "s:/$(mlibdir)/incoming:/$(mlibdir):g" \ |
398 | -e "s:/$(mlibdir)/incoming.*::g" \ |
399 | -e '/^$/d' ${DB_ENTRY}/${i} |
400 | done |
401 | } |
402 | |
403 | postinstall() |
404 | { |
405 | # first save the old libpthread.so.0; |
406 | # it will later used to determinate that there are no stale |
407 | # libpthreads that breaks ldconfig |
408 | local OLD_PTHREAD |
409 | OLD_PTHREAD="$(readlink ${MROOT}/$(mlibdir)/libpthread.so.0)" |
410 | |
411 | # slackware install method |
412 | |
413 | # we cannot easily install the glibc libs, |
414 | # because our tools for cp etc needs them to run |
415 | |
416 | local file |
417 | |
418 | echo " Switching to new glibc ..." |
419 | # swap libraries on the fly: |
420 | if [ -x /sbin/ldconfig -a -d /$(mlibdir)/incoming ] && [[ -z ${MROOT} ]] |
421 | then |
422 | # first create copies of the incoming libraries: |
423 | cd /$(mlibdir)/incoming |
424 | for file in $(find /$(mlibdir)/incoming -type f) |
425 | do |
426 | if [ ! -r "../$(basename ${file}).incoming" ] |
427 | then |
428 | cp -a ${file} ../$(basename ${file}).incoming |
429 | fi |
430 | done |
431 | |
432 | # then switch to them all at once: |
433 | /sbin/ldconfig -l /$(mlibdir)/*.incoming 2> /dev/null |
434 | |
435 | # finally, rename them and clean up: |
436 | cd /$(mlibdir) |
437 | for file in *.incoming |
438 | do |
439 | rm -f $(basename ${file} .incoming) |
440 | cp -a ${file} $(basename ${file} .incoming) |
441 | /sbin/ldconfig -l $(basename ${file} .incoming) |
442 | rm -f ${file} |
443 | done |
444 | |
445 | # no ldconfig? |
446 | # good, it's safe to just jam it on home (and make links below): |
447 | else |
448 | ( |
449 | cd ${MROOT}/$(mlibdir)/incoming |
450 | for file in * |
451 | do |
452 | cp -a ${file} .. |
453 | done |
454 | |
455 | local my_sym |
456 | local my_dest |
457 | |
458 | # rebuild symlinks |
459 | echo " Recreating Symlinks:" |
460 | for i in $(find ${MROOT}/$(mlibdir)/incoming -type l) |
461 | do |
462 | my_sym="$(readlink ${i})" |
463 | my_dest="$(basename ${i})" |
464 | |
465 | echo " ${my_dest} -> ${my_dest}" |
466 | |
467 | # assure to remove the old ones; |
468 | [ -L ${MROOT}/$(mlibdir)/"${my_dest}" ] && \ |
469 | rm ${MROOT}/$(mlibdir)/"${my_dest}" |
470 | |
471 | ln -snf "${my_sym}" ${MROOT}/$(mlibdir)/"${my_dest}" |
472 | done |
473 | ) |
474 | fi |
475 | |
476 | # now, get rid of the temporary directory: |
477 | rm -rf ${MROOT}/$(mlibdir)/incoming |
478 | |
479 | # remove stale nptl libpthread-2.?.?.so, |
480 | # fix only needed for glibc with linuxthreads; |
481 | # prevent reloc errors such as: |
482 | # ls: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory |
483 | |
484 | # get our new libpthread.so.0 |
485 | local NEW_PTHREAD |
486 | NEW_PTHREAD="$(readlink ${MROOT}/$(mlibdir)/libpthread.so.0)" |
487 | |
488 | if [ "${NEW_PTHREAD}" != "${OLD_PTHREAD}" ] |
489 | then |
490 | echo " Removing stale libpthread libraries ..." |
491 | for file in ${MROOT}/$(mlibdir)/libpthread-* |
492 | do |
493 | if [ "$(basename ${file})" != "${NEW_PTHREAD}" ] |
494 | then |
495 | rm -f ${file} |
496 | fi |
497 | done |
498 | |
499 | #rm -f /lib/${OLD_PTHREAD} |
500 | |
501 | ln -snf ${NEW_PTHREAD} ${MROOT}/$(mlibdir)/libpthread.so.0 |
502 | fi |
503 | |
504 | if [ -x /usr/sbin/iconvconfig ] |
505 | then |
506 | # generate fastloading iconv module configuration file. |
507 | echo " Generate iconv module config ..." |
508 | /usr/sbin/iconvconfig --prefix=${MROOT}/ |
509 | fi |
510 | |
511 | # reloading init |
512 | echo " Reloading init ..." |
513 | [[ -z ${MROOT} ]] && /sbin/init U &> /dev/null |
514 | |
515 | # generating user def locales |
516 | echo " Generating user defined locales ..." |
517 | [[ -z ${MROOT} ]] && /usr/sbin/locale-gen |
518 | |
519 | # now we must fix the mage db files |
520 | # to stop the annoying errors messages |
521 | fix_db_files |
522 | } |