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