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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Sat May 17 17:27:40 2008 UTC (11 years, 9 months ago) by pappy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
removing ebuild due to QA violations as per request of Hylcyon

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

  ViewVC Help
Powered by ViewVC 1.1.20