1 |
vapier 09/03/01 21:06:22 |
2 |
|
3 |
Added: pkg_preinst.eblit pkg_postinst.eblit |
4 |
pkg_setup.eblit |
5 |
Log: |
6 |
Add support for pkg_* funcs with eblits. |
7 |
(Portage version: 2.2_rc23/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 sys-libs/glibc/files/eblits/pkg_preinst.eblit |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/glibc/files/eblits/pkg_preinst.eblit?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/glibc/files/eblits/pkg_preinst.eblit?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: pkg_preinst.eblit |
16 |
=================================================================== |
17 |
# Copyright 1999-2009 Gentoo Foundation |
18 |
# Distributed under the terms of the GNU General Public License v2 |
19 |
# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_preinst.eblit,v 1.1 2009/03/01 21:06:22 vapier Exp $ |
20 |
|
21 |
fix_lib64_symlinks() { |
22 |
# the original Gentoo/AMD64 devs decided that since 64bit is the native |
23 |
# bitdepth for AMD64, lib should be used for 64bit libraries. however, |
24 |
# this ignores the FHS and breaks multilib horribly... especially |
25 |
# since it wont even work without a lib64 symlink anyways. *rolls eyes* |
26 |
# see bug 59710 for more information. |
27 |
# Travis Tilley <lv@g.o> (08 Aug 2004) |
28 |
if [ -L ${ROOT}/lib64 ] ; then |
29 |
ewarn "removing /lib64 symlink and moving lib to lib64..." |
30 |
ewarn "dont hit ctrl-c until this is done" |
31 |
rm ${ROOT}/lib64 |
32 |
# now that lib64 is gone, nothing will run without calling ld.so |
33 |
# directly. luckily the window of brokenness is almost non-existant |
34 |
use amd64 && /lib/ld-linux-x86-64.so.2 /bin/mv ${ROOT}/lib ${ROOT}/lib64 |
35 |
use ppc64 && /lib/ld64.so.1 /bin/mv ${ROOT}/lib ${ROOT}/lib64 |
36 |
# all better :) |
37 |
ldconfig |
38 |
ln -s lib64 ${ROOT}/lib |
39 |
einfo "done! :-)" |
40 |
einfo "fixed broken lib64/lib symlink in ${ROOT}" |
41 |
fi |
42 |
if [ -L ${ROOT}/usr/lib64 ] ; then |
43 |
rm ${ROOT}/usr/lib64 |
44 |
mv ${ROOT}/usr/lib ${ROOT}/usr/lib64 |
45 |
ln -s lib64 ${ROOT}/usr/lib |
46 |
einfo "fixed broken lib64/lib symlink in ${ROOT}/usr" |
47 |
fi |
48 |
if [ -L ${ROOT}/usr/X11R6/lib64 ] ; then |
49 |
rm ${ROOT}/usr/X11R6/lib64 |
50 |
mv ${ROOT}/usr/X11R6/lib ${ROOT}/usr/X11R6/lib64 |
51 |
ln -s lib64 ${ROOT}/usr/X11R6/lib |
52 |
einfo "fixed broken lib64/lib symlink in ${ROOT}/usr/X11R6" |
53 |
fi |
54 |
} |
55 |
|
56 |
eblit-glibc-pkg_preinst() { |
57 |
# nothing to do if just installing headers |
58 |
just_headers && return |
59 |
|
60 |
# PPC64+others may want to eventually be added to this logic if they |
61 |
# decide to be multilib compatible and FHS compliant. note that this |
62 |
# chunk of FHS compliance only applies to 64bit archs where 32bit |
63 |
# compatibility is a major concern (not IA64, for example). |
64 |
|
65 |
# amd64's 2005.0 is the first amd64 profile to not need this code. |
66 |
# 2005.0 is setup properly, and this is executed as part of the |
67 |
# 2004.3 -> 2005.0 upgrade script. |
68 |
# It can be removed after 2004.3 has been purged from portage. |
69 |
{ use amd64 || use ppc64; } && [ "$(get_libdir)" == "lib64" ] && ! has_multilib_profile && fix_lib64_symlinks |
70 |
|
71 |
# it appears that /lib/tls is sometimes not removed. See bug |
72 |
# 69258 for more info. |
73 |
if [[ -d ${ROOT}/$(alt_libdir)/tls ]] && [[ ! -d ${D}/$(alt_libdir)/tls ]] ; then |
74 |
ewarn "nptlonly or -nptl in USE, removing /${ROOT}$(alt_libdir)/tls..." |
75 |
rm -r "${ROOT}"/$(alt_libdir)/tls || die |
76 |
fi |
77 |
|
78 |
# simple test to make sure our new glibc isnt completely broken. |
79 |
# make sure we don't test with statically built binaries since |
80 |
# they will fail. also, skip if this glibc is a cross compiler. |
81 |
[[ ${ROOT} != "/" ]] && return 0 |
82 |
[[ -d ${D}/$(get_libdir) ]] || return 0 |
83 |
cd / #228809 |
84 |
local x striptest |
85 |
for x in date env ls true uname ; do |
86 |
x=$(type -p ${x}) |
87 |
[[ -z ${x} ]] && continue |
88 |
striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null) |
89 |
[[ -z ${striptest} ]] && continue |
90 |
[[ ${striptest} == *"statically linked"* ]] && continue |
91 |
"${D}"/$(get_libdir)/ld-*.so \ |
92 |
--library-path "${D}"/$(get_libdir) \ |
93 |
${x} > /dev/null \ |
94 |
|| die "simple run test (${x}) failed" |
95 |
done |
96 |
} |
97 |
|
98 |
|
99 |
|
100 |
1.1 sys-libs/glibc/files/eblits/pkg_postinst.eblit |
101 |
|
102 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/glibc/files/eblits/pkg_postinst.eblit?rev=1.1&view=markup |
103 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/glibc/files/eblits/pkg_postinst.eblit?rev=1.1&content-type=text/plain |
104 |
|
105 |
Index: pkg_postinst.eblit |
106 |
=================================================================== |
107 |
# Copyright 1999-2009 Gentoo Foundation |
108 |
# Distributed under the terms of the GNU General Public License v2 |
109 |
# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_postinst.eblit,v 1.1 2009/03/01 21:06:22 vapier Exp $ |
110 |
|
111 |
eblit-glibc-pkg_postinst() { |
112 |
# nothing to do if just installing headers |
113 |
just_headers && return |
114 |
|
115 |
if ! tc-is-cross-compiler && [[ -x ${ROOT}/usr/sbin/iconvconfig ]] ; then |
116 |
# Generate fastloading iconv module configuration file. |
117 |
"${ROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}" |
118 |
fi |
119 |
|
120 |
if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then |
121 |
# Reload init ... if in a chroot or a diff init package, ignore |
122 |
# errors from this step #253697 |
123 |
/sbin/telinit U 2>/dev/null |
124 |
|
125 |
# if the host locales.gen contains no entries, we'll install everything |
126 |
local locale_list="${ROOT}etc/locale.gen" |
127 |
if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then |
128 |
ewarn "Generating all locales; edit /etc/locale.gen to save time/space" |
129 |
locale_list="${ROOT}usr/share/i18n/SUPPORTED" |
130 |
fi |
131 |
local x jobs |
132 |
for x in ${MAKEOPTS} ; do [[ ${x} == -j* ]] && jobs=${x#-j} ; done |
133 |
locale-gen -j ${jobs:-1} --config "${locale_list}" |
134 |
fi |
135 |
} |
136 |
|
137 |
|
138 |
|
139 |
1.1 sys-libs/glibc/files/eblits/pkg_setup.eblit |
140 |
|
141 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/glibc/files/eblits/pkg_setup.eblit?rev=1.1&view=markup |
142 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/glibc/files/eblits/pkg_setup.eblit?rev=1.1&content-type=text/plain |
143 |
|
144 |
Index: pkg_setup.eblit |
145 |
=================================================================== |
146 |
# Copyright 1999-2009 Gentoo Foundation |
147 |
# Distributed under the terms of the GNU General Public License v2 |
148 |
# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_setup.eblit,v 1.1 2009/03/01 21:06:22 vapier Exp $ |
149 |
|
150 |
eblit-glibc-pkg_setup() { |
151 |
# prevent native builds from downgrading ... maybe update to allow people |
152 |
# to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2) |
153 |
if [[ ${ROOT} == "/" ]] && [[ ${CBUILD} == ${CHOST} ]] && [[ ${CHOST} == ${CTARGET} ]] ; then |
154 |
if has_version '>'${CATEGORY}/${PF} ; then |
155 |
eerror "Sanity check to keep you from breaking your system:" |
156 |
eerror " Downgrading glibc is not supported and a sure way to destruction" |
157 |
die "aborting to save your system" |
158 |
fi |
159 |
fi |
160 |
|
161 |
# users have had a chance to phase themselves, time to give em the boot |
162 |
if [[ -e ${ROOT}/etc/locale.gen ]] && [[ -e ${ROOT}/etc/locales.build ]] ; then |
163 |
eerror "You still haven't deleted ${ROOT}/etc/locales.build." |
164 |
eerror "Do so now after making sure ${ROOT}/etc/locale.gen is kosher." |
165 |
die "lazy upgrader detected" |
166 |
fi |
167 |
|
168 |
if [[ ${CTARGET} == i386-* ]] ; then |
169 |
eerror "i386 CHOSTs are no longer supported." |
170 |
eerror "Chances are you don't actually want/need i386." |
171 |
eerror "Please read http://www.gentoo.org/doc/en/change-chost.xml" |
172 |
die "please fix your CHOST" |
173 |
fi |
174 |
|
175 |
if [[ -n ${LT_VER} ]] ; then |
176 |
if use nptlonly && ! use nptl ; then |
177 |
eerror "If you want nptlonly, add nptl to your USE too ;p" |
178 |
die "nptlonly without nptl" |
179 |
fi |
180 |
fi |
181 |
|
182 |
if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then |
183 |
ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS." |
184 |
ewarn "This will result in a 50% performance penalty, which is probably not what you want." |
185 |
fi |
186 |
|
187 |
use hardened && ! gcc-specs-pie && \ |
188 |
ewarn "PIE hardening not applied, as your compiler doesn't default to PIE" |
189 |
} |