/[gentoo-x86]/sys-libs/gxslibc/gxslibc-2.6.1-r3.ebuild
Gentoo

Contents of /sys-libs/gxslibc/gxslibc-2.6.1-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat May 17 18:22:13 2008 UTC (12 years ago) by pappy
Branch: MAIN
adding refurbished version with less QA violations
(Portage version: 2.1.4.4)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils
6
7 # the main installation routine and patches
8 # from http://www.linuxfromscratch.org/hlfs
9
10 DESCRIPTION="The Gentoo Linux Extreme Security version of the GNU libc6"
11 HOMEPAGE="http://www.gentoo.org/proj/en/extreme-security/"
12
13 RELEASE="2.6.1"
14
15 KERNELVER="2.6.18"
16
17 GNU_MIRROR="ftp://ftp.gnu.org/gnu"
18
19 PATCHDIST="http://dev.gentoo.org/~pappy/dist/gxs"
20 PATCHPATH="sys-libs/gxslibc/files/${RELEASE}"
21
22 MYPATCHES="glibc-${RELEASE}-gxs-GENTOOPATCHES.patch"
23 LOCALEGEN="glibc-${RELEASE}-gxs-LOCALEGEN_NSCD.patch"
24 GXSSPATCH="gxslibc-${RELEASE}-r3-ssp.patch"
25
26 ## the default upstream glibc
27 SRC_URI="${SRC_URI} ${GNU_MIRROR}/glibc/glibc-${RELEASE}.tar.bz2"
28
29 # comment out - already provided by gentoo patches
30 # ${GNU_MIRROR}/glibc/glibc-libidn-${RELEASE}.tar.bz2"
31
32 ## contains a jumbo file with all patches from
33 ## sys-libs/glibc for this particular glibc setup
34 SRC_URI="${SRC_URI} ${PATCHDIST}/${PATCHPATH}/${MYPATCHES}.gz"
35
36 ## uses locale-gen from sys-libs/glibc
37 ## which in turn was taken from Debian
38 SRC_URI="${SRC_URI} ${PATCHDIST}/${PATCHPATH}/${LOCALEGEN}.gz"
39
40 ## GXS backport of SSP for >=glibc-2.4
41 SRC_URI="${SRC_URI} ${PATCHDIST}/${PATCHPATH}/${GXSSPATCH}.gz"
42
43 LICENSE="LGPL-2"
44
45 SLOT="1"
46
47 KEYWORDS="~x86"
48
49 # remove the remaining non-colliding
50 # files from the orig sys-libs/glibc
51 # package with the following command
52 # when finished emerging this glibc:
53 #
54 # CONFIG_PROTECT="$(echo -n $(equery files sys-libs/gxslibc))" \
55 # emerge -C sys-libs/glibc
56 #
57 # you also need to emerge gentoolkit
58 # to run the equery inside the shell
59 # command for setting up the env var
60 PROVIDE="virtual/libc"
61
62 RESTRICT="strip" #46186
63
64 # we share a header file with gettext which seems
65 # to make net-tools and busybox fail with linking
66 # errors regarding to a libintl_gettext not found
67 DEPEND=">=sys-devel/binutils-2.15.94
68 >=sys-devel/gcc-config-1.3.12
69 >=app-misc/pax-utils-0.1.10
70 virtual/os-headers
71 >=sys-apps/portage-2.1.2
72 !sys-devel/gettext"
73
74 pkg_setup() {
75
76 if [[ "x${CHOST}y" == "xy" ]]
77 then
78 eerror "your CHOST does not exist, bailing out."
79 exit 1
80 fi
81
82 if [[ "x${CBUILD}y" != "xy" && "${CHOST}" != "${CBUILD}" ]]
83 then
84 eerror "cross compiling currently not supported"
85 exit 1
86 fi
87
88 if [[ "x${CTARGET}y" != "xy" && "${CHOST}" != "${CTARGET}" ]]
89 then
90 eerror "cross compiling currently not supported"
91 exit 1
92 fi
93
94 einfo "setting CFLAGS and CXXFLAGS to GXS toolchain defaults"
95 export CFLAGS="-O2 -pipe -fforce-addr -g -ggdb"
96 export CXXFLAGS="${CFLAGS}"
97
98 einfo "clearing CPPFLAGS ASFLAGS LDFLAGS"
99 export CPPFLAGS=""
100 export ASFLAGS=""
101 export LDFLAGS=""
102
103 if [[ "x${MAKEOPTS}y" == "xy" ]]
104 then
105 einfo "setting MAKEOPTS for ebuild"
106 export MAKEOPTS="-j4"
107 fi
108
109 einfo "using CHOST:${CHOST}"
110 einfo "using C(XX)FLAGS:${CXXFLAGS}"
111 einfo "using MAKEOPTS:${MAKEOPTS}"
112 }
113
114 src_unpack() {
115
116 unpack ${A}
117
118 mkdir -p "${WORKDIR}/glibc-${RELEASE}/gentoo/etc"
119 mkdir -p "${WORKDIR}/glibc-${RELEASE}/gentoo/locale"
120
121 cd "${WORKDIR}/glibc-${RELEASE}"
122
123 for p in "${WORKDIR}/${MYPATCHES}" \
124 "${WORKDIR}/${LOCALEGEN}" \
125 "${WORKDIR}/${GXSSPATCH}"
126 do
127 # epatch seems to have issues with
128 # at least the ${LOCALEGEN} patch file
129 # therefore we need custom EPATCH options
130 # thx to drac@gentoo.org
131 EPATCH_OPTS="-p1 -d ${WORKDIR}/glibc-${RELEASE}" \
132 epatch "${p}" || die "failed ${p}"
133 done
134 }
135
136 src_compile() {
137
138 mkdir -p "${WORKDIR}/glibc-build"
139 cd "${WORKDIR}/glibc-build"
140
141 "${WORKDIR}/glibc-${PV}/configure" \
142 --target="${CHOST}" \
143 --prefix=/usr \
144 --enable-bind-now \
145 --without-gd \
146 --disable-profile \
147 --disable-libssp \
148 --disable-nls \
149 --enable-add-ons=nptl,libidn \
150 --without-selinux \
151 --with-tls \
152 --with-__thread \
153 --enable-kernel="${KERNELVER}" \
154 --without-cvs || die "configuration failed"
155
156 make || die "compile failed"
157 }
158
159 src_install() {
160 cd "${WORKDIR}/glibc-build"
161
162 make install_root="${D}" install || die "make install failed"
163
164 insinto "${ROOT}/etc"
165
166 local configfiles="${WORKDIR}/glibc-${PV}/gentoo"
167
168 # install the locale-gen helper utility and config file
169 dosbin "${configfiles}/locale/locale-gen" || \
170 die "locale-gen helper script could not be installed"
171
172 doins "${configfiles}/locale/locale.gen" || \
173 die "locale.gen config file could not be installed"
174
175 # install the nscd startup script
176 doinitd "${configfiles}/etc/nscd" || \
177 die "nscd run level startup script could not be installed"
178
179 # install the config files for glibc
180 doins "${configfiles}"/etc/*.conf || \
181 die "glibc config files could not be installed"
182
183 # make sure the localtime is not overwritten by glibc emerges
184 rm "${D}/etc/localtime"
185 }
186
187 # NOTE: the locales are not in the .tbz2 file of the binpackage
188 # NOTE: but will be generated in the postinst routine from here
189 pkg_postinst() {
190 # make sure the file exists on the installed system
191 touch "${ROOT}/etc/ld.so.conf"
192
193 # install locales (logic taken from sys-libs/glibc)
194 local locale_list="${ROOT}/etc/locale.gen"
195 if [[ -z $(locale-gen --list --config "${locale_list}") ]]
196 then
197 locale_list="${ROOT}/usr/share/i18n/SUPPORTED"
198 fi
199
200 # find the number of jobs available
201 local x jobs
202 for x in ${MAKEOPTS} ; do [[ "${x}" == -j* ]] && jobs=${x#-j} ; done
203
204 # generate the locales
205 locale-gen -j ${jobs:-2} --config "${locale_list}"
206
207 # set the timezone automatically if not found
208 if [[ ! -f "${ROOT}/etc/localtime" ]]
209 then
210 einfo "timezone not found: setting timezone to UTC"
211 cp --remove-destination \
212 "${ROOT}/usr/share/zoneinfo/UTC" \
213 "${ROOT}/etc/localtime"
214 fi
215
216 einfo "tuning directory and file permissions"
217 chown -v root:root "${ROOT}/etc/locale.gen"
218 chmod -v 0644 "${ROOT}/etc/locale.gen"
219
220 for TDIR in "${ROOT}/" \
221 "${ROOT}/etc"
222 do
223 chown -v root:root "${TDIR}"
224 chmod -v 0755 "${TDIR}"
225 done
226
227 for FILE in "${ROOT}/etc/locale.gen" \
228 "${ROOT}/etc/nscd.conf"
229 do
230 chown -v root:root "${FILE}"
231 chmod -v 0644 "${FILE}"
232 done
233 }
234 #eof#

  ViewVC Help
Powered by ViewVC 1.1.20