summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2004-09-28 17:25:36 +0000
committerNed Ludd <solar@gentoo.org>2004-09-28 17:25:36 +0000
commit4ad8600fcc8cade7a815c8d9d6cccae2af236c83 (patch)
treeb0a00caa80844eb90884bc0c40684a2b48130191 /dev-libs/uclibc
parentAdded dev-db/phpmyadmin (diff)
downloadhistorical-4ad8600fcc8cade7a815c8d9d6cccae2af236c83.tar.gz
historical-4ad8600fcc8cade7a815c8d9d6cccae2af236c83.tar.bz2
historical-4ad8600fcc8cade7a815c8d9d6cccae2af236c83.zip
added unsecvars handling to uclibc. testing ground here and going mainline afterwords
Diffstat (limited to 'dev-libs/uclibc')
-rw-r--r--dev-libs/uclibc/ChangeLog10
-rw-r--r--dev-libs/uclibc/Manifest46
-rw-r--r--dev-libs/uclibc/files/0.9.26/uClibc-20040921-ldso-unsecvars.patch36
-rw-r--r--dev-libs/uclibc/files/0.9.26/unsecvars.h26
-rw-r--r--dev-libs/uclibc/files/digest-uclibc-0.9.26-r73
-rw-r--r--dev-libs/uclibc/uclibc-0.9.26-r7.ebuild265
6 files changed, 364 insertions, 22 deletions
diff --git a/dev-libs/uclibc/ChangeLog b/dev-libs/uclibc/ChangeLog
index a0dba141414f..21edc02658fb 100644
--- a/dev-libs/uclibc/ChangeLog
+++ b/dev-libs/uclibc/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for dev-libs/uclibc
# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/uclibc/ChangeLog,v 1.36 2004/09/06 19:07:39 ciaranm Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/uclibc/ChangeLog,v 1.37 2004/09/28 17:25:36 solar Exp $
+
+*uclibc-0.9.26-r7 (28 Sep 2004)
+
+ 28 Sep 2004; <solar@gentoo.org>
+ +files/0.9.26/uClibc-20040921-ldso-unsecvars.patch,
+ +files/0.9.26/unsecvars.h, +uclibc-0.9.26-r7.ebuild:
+ added unsecvars handling to uclibc. testing ground here and going mainline
+ afterwords
06 Sep 2004; Ciaran McCreesh <ciaranm@gentoo.org> uclibc-0.9.26-r3.ebuild,
uclibc-0.9.26-r4.ebuild, uclibc-0.9.26-r5.ebuild, uclibc-9999.ebuild:
diff --git a/dev-libs/uclibc/Manifest b/dev-libs/uclibc/Manifest
index 36d106e66ec4..4c7c05e34ad0 100644
--- a/dev-libs/uclibc/Manifest
+++ b/dev-libs/uclibc/Manifest
@@ -1,45 +1,49 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-MD5 be04bac519fe39d3cd48b64905ed8a83 ChangeLog 7027
-MD5 f694d40cf09e6c5511ae52f755a5ffe5 metadata.xml 998
-MD5 7fde305dfd21aeac12e0eb721e0f6a17 uclibc-0.9.21.ebuild 1096
+MD5 08c3bf145cb5142ef315926eb321176f uclibc-0.9.26-r2.ebuild 6198
+MD5 d19c535314aba3c7ad5956c68571886a uclibc-0.9.26-r4.ebuild 7223
MD5 d98118dbcb77466679b07fd6eb029f9f uclibc-9999.ebuild 5443
MD5 e00c5423073ca5b75f6b38f03cc9c46e uclibc-0.9.26-r1.ebuild 2565
-MD5 08c3bf145cb5142ef315926eb321176f uclibc-0.9.26-r2.ebuild 6198
MD5 b6e51a393cae9daddfda7e1eabadb679 uclibc-0.9.26-r3.ebuild 6348
-MD5 d19c535314aba3c7ad5956c68571886a uclibc-0.9.26-r4.ebuild 7223
MD5 ed4d6b2b5413c7372255c768f51e7446 uclibc-0.9.26-r5.ebuild 7659
+MD5 ef3cf86952629220bc4510fd33623774 ChangeLog 7292
+MD5 7fde305dfd21aeac12e0eb721e0f6a17 uclibc-0.9.21.ebuild 1096
+MD5 f694d40cf09e6c5511ae52f755a5ffe5 metadata.xml 998
+MD5 dee5a90975a1815fa8eb988c071fe38d uclibc-0.9.26-r7.ebuild 7865
MD5 d16f404e56abc9f0ab5c372b88a6905d files/Makefile-cp-order-fix.patch 897
-MD5 799adc7fb6ec9ffd653831cea1d32dd5 files/digest-uclibc-0.9.21 67
MD5 0b733285f186f31c1be9ffcc42f1064e files/getent 973
-MD5 02ffb023d5b3be46c7e0c9aadf48d304 files/digest-uclibc-0.9.26-r2 231
MD5 cf4a11cd99eb78be459f253cf9c53030 files/digest-uclibc-0.9.26-r1 67
+MD5 02ffb023d5b3be46c7e0c9aadf48d304 files/digest-uclibc-0.9.26-r2 231
MD5 469ea7f6803a9d27eadc0c9437171df6 files/digest-uclibc-0.9.26-r3 231
MD5 44c3eaa7974b57f415b3acb6a30cc1e8 files/digest-uclibc-0.9.26-r4 231
MD5 6d2b5c523d34c86df9bc37747d9261dc files/digest-uclibc-0.9.26-r5 231
+MD5 6d2b5c523d34c86df9bc37747d9261dc files/digest-uclibc-0.9.26-r7 231
+MD5 799adc7fb6ec9ffd653831cea1d32dd5 files/digest-uclibc-0.9.21 67
MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-uclibc-9999 0
-MD5 17ecd222df47b5253f35787097440a5a files/0.9.23/uClibc-0.9.23-etdyn.patch 5832
-MD5 298b7b42f80e1f8ae395df81c47eb213 files/0.9.23/uClibc-0.9.23-flipturn.patch 1821
-MD5 4216cdf86d54f45fa04cb44a5425b3ff files/0.9.23/uClibc-0.9.23-pax.patch 3607
+MD5 df59fcf3a02c17b7dac6999bd9262d05 files/cvs/22_all_uClibc-ld-now.patch 1072
MD5 7eea15a7a3e8d8a2a222b815e57dc221 files/cvs/13_all_uClibc-enable-ssp.patch 331
MD5 9cb04f6f038b903868f99d90f81e7e61 files/cvs/21_all_uClibc-ld-relro.patch 1040
-MD5 df59fcf3a02c17b7dac6999bd9262d05 files/cvs/22_all_uClibc-ld-now.patch 1072
+MD5 4216cdf86d54f45fa04cb44a5425b3ff files/0.9.23/uClibc-0.9.23-pax.patch 3607
+MD5 17ecd222df47b5253f35787097440a5a files/0.9.23/uClibc-0.9.23-etdyn.patch 5832
+MD5 298b7b42f80e1f8ae395df81c47eb213 files/0.9.23/uClibc-0.9.23-flipturn.patch 1821
+MD5 f7c264d37687f1a32f1c6e31239f2276 files/0.9.26/uclibc-0.9.26-noexecstack.patch 15273
+MD5 6835449424e7a8a38e9c85ecf1b73577 files/0.9.26/arm-ucontext.patch 303
MD5 ef7fa60d23c46f41d0e9748372cfc7dd files/0.9.26/ssp.c 3937
-MD5 2416f5e954ccb8b39b1c0d6a3cf5e827 files/0.9.26/uClibc-0.9.26-Makefile.patch 1478
-MD5 bdd1e91ee48fb8be0d28cabdfcfdf3ff files/0.9.26/uClibc-0.9.26-pie-option.patch 863
+MD5 7ff9f1e05cdfbbe0e156ea81bf8b55ee files/0.9.26/uClibc-20040921-ldso-unsecvars.patch 1024
+MD5 a503ef49001f5f67d61cd40b0809fb76 files/0.9.26/unsecvars.h 682
MD5 49671ccbdf2c8055efc6cde0003cb6c5 files/0.9.26/arm-fix-missing-syscalls.patch 2264
+MD5 efd96414f3be520f07eabd1c02be1ecb files/0.9.26/uclibc-0.9.26-resolve-segfault.patch 1227
MD5 874260fc77637deccf7588cfc1c76674 files/0.9.26/uClibc-20040613-do_rem.patch 391
-MD5 b9df87c681aa3a1ef3033cb195e516df files/0.9.26/uclibc-0.9.26-arm-dl-sysdep.patch 795
MD5 d35beaf332590fed8c619483d4598dc6 files/0.9.26/uclibc-0.9.26-ssp-gcc34-after-frandom.patch 542
-MD5 f7c264d37687f1a32f1c6e31239f2276 files/0.9.26/uclibc-0.9.26-noexecstack.patch 15273
-MD5 6835449424e7a8a38e9c85ecf1b73577 files/0.9.26/arm-ucontext.patch 303
-MD5 efd96414f3be520f07eabd1c02be1ecb files/0.9.26/uclibc-0.9.26-resolve-segfault.patch 1227
+MD5 bdd1e91ee48fb8be0d28cabdfcfdf3ff files/0.9.26/uClibc-0.9.26-pie-option.patch 863
MD5 7157f784ba7672c9904d289712131a52 files/0.9.26/uclibc-0.9.26-ldso-cache.patch 410
+MD5 2416f5e954ccb8b39b1c0d6a3cf5e827 files/0.9.26/uClibc-0.9.26-Makefile.patch 1478
+MD5 b9df87c681aa3a1ef3033cb195e516df files/0.9.26/uclibc-0.9.26-arm-dl-sysdep.patch 795
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.9.10 (GNU/Linux)
+Version: GnuPG v1.2.4 (GNU/Linux)
-iD8DBQFBP2jlHTu7gpaalycRAtMXAJ90GFHgLigBV7Tv1kn1WN8xXLVWpQCg61Ox
-ZSRjPAimPxORp4mKjyy9ukQ=
-=UY2x
+iD8DBQFBWZ5X94CCfB4KcwwRAjREAKCUHxSaPKsUarn+j9BzBLJtC4i7QACfUCt8
+5BsieG/zwcabECkfWT/20Zg=
+=66Na
-----END PGP SIGNATURE-----
diff --git a/dev-libs/uclibc/files/0.9.26/uClibc-20040921-ldso-unsecvars.patch b/dev-libs/uclibc/files/0.9.26/uClibc-20040921-ldso-unsecvars.patch
new file mode 100644
index 000000000000..5e58588e7e80
--- /dev/null
+++ b/dev-libs/uclibc/files/0.9.26/uClibc-20040921-ldso-unsecvars.patch
@@ -0,0 +1,36 @@
+--- ldso/ldso/ldso.c 8 Sep 2004 09:43:24 -0000 1.121
++++ ldso/ldso/ldso.c 21 Sep 2004 05:33:40 -0000
+@@ -31,6 +31,7 @@
+
+
+ #include "ldso.h"
++#include "unsecvars.h"
+
+ #define ALLOW_ZERO_PLTGOT
+
+@@ -325,11 +326,21 @@ void _dl_get_ready_to_run(struct elf_res
+ _dl_preload = _dl_getenv("LD_PRELOAD", envp);
+ _dl_library_path = _dl_getenv("LD_LIBRARY_PATH", envp);
+ } else {
++ static const char unsecure_envvars[] =
++#ifdef EXTRA_UNSECURE_ENVVARS
++ EXTRA_UNSECURE_ENVVARS
++#endif
++ UNSECURE_ENVVARS;
++ const char *nextp;
+ _dl_secure = 1;
+- _dl_preload = _dl_getenv("LD_PRELOAD", envp);
+- _dl_unsetenv("LD_AOUT_PRELOAD", envp);
+- _dl_unsetenv("LD_LIBRARY_PATH", envp);
+- _dl_unsetenv("LD_AOUT_LIBRARY_PATH", envp);
++
++ nextp = unsecure_envvars;
++ do {
++ _dl_unsetenv (nextp, envp);
++ /* We could use rawmemchr but this need not be fast. */
++ nextp = (char *) _dl_strchr(nextp, '\0') + 1;
++ } while (*nextp != '\0');
++ _dl_preload = NULL;
+ _dl_library_path = NULL;
+ }
+ }
diff --git a/dev-libs/uclibc/files/0.9.26/unsecvars.h b/dev-libs/uclibc/files/0.9.26/unsecvars.h
new file mode 100644
index 000000000000..5e060a6516dc
--- /dev/null
+++ b/dev-libs/uclibc/files/0.9.26/unsecvars.h
@@ -0,0 +1,26 @@
+/*
+ * Environment variable to be removed for SUID programs. The names are all
+ * stuffed in a single string which means they have to be terminated with a
+ * '\0' explicitly.
+ */
+
+#define UNSECURE_ENVVARS \
+ "LD_AOUT_PRELOAD\0" \
+ "LD_AOUT_LIBRARY_PATH\0" \
+ "LD_PRELOAD\0" \
+ "LD_LIBRARY_PATH\0" \
+ "LD_DEBUG\0" \
+ "LD_DEBUG_OUTPUT\0" \
+ "HOSTALIASES\0" \
+ "LOCALDOMAIN\0" \
+ "RES_OPTIONS\0" \
+ "TMPDIR\0"
+
+/*
+ * These environment variables are defined by glibc but ignored in
+ * uClibc, but may very well have an equivalent in uClibc.
+ *
+ * MALLOC_TRACE, RESOLV_HOST_CONF, TZDIR, GCONV_PATH, LD_USE_LOAD_BIAS,
+ * LD_PROFILE, LD_ORIGIN_PATH, LOCPATH, NLSPATH
+ */
+
diff --git a/dev-libs/uclibc/files/digest-uclibc-0.9.26-r7 b/dev-libs/uclibc/files/digest-uclibc-0.9.26-r7
new file mode 100644
index 000000000000..355f8d702bae
--- /dev/null
+++ b/dev-libs/uclibc/files/digest-uclibc-0.9.26-r7
@@ -0,0 +1,3 @@
+MD5 7212713c432dd0de6ec2140c2a6212e4 uClibc-0.9.26.tar.bz2 1604543
+MD5 1c082d43f02e7fa199fe724469111d88 uClibc-0.9.26-cvs-update-20040808.patch.bz2 345344
+MD5 b7820c6b79f02d2d07a7ac75abfe90a5 uClibc-0.9.26-patches-1.1.tar.bz2 7162
diff --git a/dev-libs/uclibc/uclibc-0.9.26-r7.ebuild b/dev-libs/uclibc/uclibc-0.9.26-r7.ebuild
new file mode 100644
index 000000000000..5f58592759ba
--- /dev/null
+++ b/dev-libs/uclibc/uclibc-0.9.26-r7.ebuild
@@ -0,0 +1,265 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/uclibc/uclibc-0.9.26-r7.ebuild,v 1.1 2004/09/28 17:25:36 solar Exp $
+
+inherit eutils flag-o-matic gcc
+
+# To make a new CVS_VER we do.
+# wget -O - http://uclibc.org/downloads/snapshots/uClibc-`date +%Y%m%d`.tar.bz2 | tar jxf -
+# tar jxf /usr/portage/distfiles/uClibc-0.9.26.tar.bz2
+# diff -urN --exclude .cvsignore --exclude CVS uClibc-0.9.26 uClibc | bzip2 - > uClibc-0.9.26-cvs-update-`date +%Y%m%d`.patch.bz2
+# rm -rf uClibc-0.9.26-cvs-update-`date +%Y%m%d`.patch.bz2 uClibc uClibc-0.9.26
+
+MY_P="${P/ucl/uCl}"
+CVS_VER="20040808"
+PATCH_VER="1.1"
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc.org/"
+SRC_URI="http://www.kernel.org/pub/linux/libs/uclibc/${MY_P}.tar.bz2
+ mirror://gentoo/${MY_P}-cvs-update-${CVS_VER}.patch.bz2
+ mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~sparc ~mips ~arm"
+IUSE="build hardened ipv6 static debug" # nls is not supported yet
+RESTRICT="nostrip"
+
+DEPEND="sys-devel/gcc"
+RDEPEND=""
+PROVIDE="virtual/glibc virtual/libc"
+
+S=${WORKDIR}/${MY_P}
+
+check_main_libc() {
+ if [ "${CHOST/uclibc}" != "${CHOST}" ] ; then
+ SYS_LIBC=uClibc
+ else
+ SYS_LIBC=glibc
+ fi
+ export SYS_LIBC
+ echo
+ einfo "We are building for ${SYS_LIBC} system library"
+ echo
+}
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+
+ if [ -n "${CVS_VER}" ]
+ then
+ epatch ${DISTDIR}/${MY_P}-cvs-update-${CVS_VER}.patch.bz2
+ fi
+
+ cp ${FILESDIR}/0.9.26/ssp.c ${S}/libc/sysdeps/linux/common/ \
+ || die "failed to copy ssp.c to ${S}/libc/sysdeps/linux/common/"
+ # gcc 3.4 nukes ssp without this patch
+ if [ "`gcc-major-version`" -eq "3" -a "`gcc-minor-version`" -ge "4" ]
+ then
+ epatch ${FILESDIR}/0.9.26/uclibc-0.9.26-ssp-gcc34-after-frandom.patch
+ fi
+
+ if [ -n "${PATCH_VER}" ]
+ then
+ unpack ${MY_P}-patches-${PATCH_VER}.tar.bz2
+ # for now we remove relro/now, no support for relro in ldso
+ rm -f ${WORKDIR}/patch/*relro*
+ rm -f ${WORKDIR}/patch/*now*
+ rm -f ${WORKDIR}/patch/11_all_uClibc-0.9.26-socket.patch.bz2
+ # remove default ssp build
+ use hardened || rm -f ${WORKDIR}/patch/*enable-ssp*
+ epatch ${WORKDIR}/patch
+ fi
+
+ # support archs which dont implement all syscalls
+ [ -z "${CVS_VER}" ] \
+ && epatch ${FILESDIR}/${PV}/arm-fix-missing-syscalls.patch \
+ || epatch ${FILESDIR}/${PV}/uclibc-0.9.26-arm-dl-sysdep.patch
+ epatch ${FILESDIR}/${PV}/arm-ucontext.patch
+
+ # build all .S files w/ -Wa,--noexecstack
+ if [ "0${CVS_VER}" -ge "20040730" ]; then
+ einfo "Skipping noexecstack patch. (need update)"
+ else
+ epatch ${FILESDIR}/${PV}/${PN}-${PV}-noexecstack.patch
+ fi
+
+ # fix segfaults when running things like `emerge sync`
+ epatch ${FILESDIR}/${PV}/${PN}-${PV}-resolve-segfault.patch
+
+ # allow libs tagged as ELF_LIBC0 in the cache to be loaded
+ epatch ${FILESDIR}/${PV}/${PN}-${PV}-ldso-cache.patch
+
+ # Take extra security precaution's for suid handling with environment variables
+ epatch ${FILESDIR}/${PV}/uClibc-20040921-ldso-unsecvars.patch
+ cp ${FILESDIR}/${PV}/unsecvars.h ${S}/ldso/include/ || die
+
+ # fixup for install perms
+ sed -i -e "s:-fa:-dRf:g" Makefile
+
+ local target=""
+ if [ "${ARCH}" == "x86" ] ; then
+ target="i386"
+ elif [ "${ARCH}" == "ppc" ] ; then
+ target="powerpc"
+ else
+ # sparc|mips|alpha|arm|sh
+ target="${ARCH}"
+ fi
+ sed -i \
+ -e "s:default TARGET_i386:default TARGET_${target}:" \
+ extra/Configs/Config.in
+ sed -i \
+ -e "s:default CONFIG_GENERIC_386:default CONFIG_${UCLIBC_CPU:-GENERIC_386}:" \
+ extra/Configs/Config.${target}
+
+ make defconfig >/dev/null || die "could not config"
+
+ for def in UCLIBC_PROFILING DO{DEBUG,ASSERTS} SUPPORT_LD_DEBUG{,_EARLY} ; do
+ sed -i -e "s:${def}=y:# ${def} is not set:" .config
+ done
+ if use debug ; then
+ echo "SUPPORT_LD_DEBUG=y" >> .config
+ echo "DODEBUG=y" >> .config
+ fi
+
+ for def in DO_C99_MATH UCLIBC_HAS_{RPC,CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC,FTW} ; do
+ sed -i -e "s:# ${def} is not set:${def}=y:" .config
+ done
+ echo "UCLIBC_HAS_FULL_RPC=y" >> .config
+ echo "PTHREADS_DEBUG_SUPPORT=y" >> .config
+
+ #if use nls
+ #then
+ # sed -i -e "s:# UCLIBC_HAS_LOCALE is not set:UCLIBC_HAS_LOCALE=y:" .config
+ # echo "UCLIBC_HAS_XLOCALE=n" >> .config
+ # echo "UCLIBC_HAS_GLIBC_DIGIT_GROUPING=y" >> .config
+ # echo "UCLIBC_HAS_SCANF_LENIENT_DIGIT_GROUPING=y" >> .config
+ # echo "UCLIBC_HAS_GETTEXT_AWARENESS=y" >> .config
+ # # on pax enabled kernels the locale files can't be built
+ # echo "UCLIBC_PREGENERATED_LOCALE_DATA=n" >> .config
+ #fi
+ # we disable LOCALE for any case, gettext has to be used
+ echo "UCLIBC_HAS_LOCALE=n" >> .config
+
+ use ipv6 && sed -i -e "s:# UCLIBC_HAS_IPV6 is not set:UCLIBC_HAS_IPV6=y:" .config
+
+ if use hardened
+ then
+ if use x86
+ then
+ einfo "Enable Position Independent Executable support in ${P}"
+ sed -i -e "s:# UCLIBC_PIE_SUPPORT.*:UCLIBC_PIE_SUPPORT=y:" .config
+ fi
+
+ einfo "Enable Stack Smashing Protections support in ${P}"
+ sed -i -e "s:# UCLIBC_PROPOLICE.*:UCLIBC_PROPOLICE=y:" .config
+ echo "PROPOLICE_BLOCK_ABRT=n" >> .config
+ echo "PROPOLICE_BLOCK_SEGV=n" >> .config
+ echo "PROPOLICE_BLOCK_KILL=y" >> .config
+ fi
+
+ # we are building against system installed kernel headers
+ sed -i -e 's:KERNEL_SOURCE.*:KERNEL_SOURCE="/usr":' .config
+
+ check_main_libc
+ if [ "${SYS_LIBC}" = "uClibc" ] ; then
+ sed -i \
+ -e 's:SHARED_LIB_LOADER_PREFIX=.*:SHARED_LIB_LOADER_PREFIX="/lib":' \
+ -e 's:DEVEL_PREFIX=.*:DEVEL_PREFIX="/usr":' \
+ -e 's:RUNTIME_PREFIX=.*:RUNTIME_PREFIX="/":' \
+ .config
+ sed -i '/LIBRARY_CACHE:=/s:#::' Rules.mak
+ fi
+
+ make -s oldconfig > /dev/null || die "could not make oldconfig"
+
+ chmod +x extra/scripts/relative_path.sh
+
+ cp .config myconfig
+
+ emake clean >/dev/null || die "could not clean"
+
+ sed -i 's:-DUCLIBC:$(LIBRARY_CACHE) -DUCLIBC:' ldso/{ldso,libdl}/Makefile
+ sed -i 's:\$(R_PREFIX):\\"$(RUNTIME_PREFIX)\\" $(LIBRARY_CACHE):' utils/Makefile
+ sed -i 's: I\.: -I.:' ldso/libdl/Makefile
+ sed -i 's:sys/user\.h:asm/page.h:' libc/misc/internals/__uClibc_main.c
+}
+
+src_compile() {
+ # running tests require this
+ use build || addwrite /dev/ptmx
+ cp myconfig .config
+
+ #if use nls
+ #then
+ # # these can be built only if the build system supports locales (as of 0.9.26)
+ # emake -j1 headers
+ # cd extra/locale
+ # make clean
+ # find ./charmaps -name "*.pairs" > codesets.txt
+ # cp LOCALES locales.txt
+ # emake -j1 || die "could not make locales"
+ # cd ../..
+ #fi
+
+ emake -j1 || die "could not make"
+ check_main_libc
+ if [ "${SYS_LIBC}" = "uClibc" ]
+ then
+ emake -j1 utils || die "could not make utils"
+ fi
+
+ if ! use build
+ then
+ if ! hasq maketest $RESTRICT
+ then
+ # assert test fails on pax enabled kernels - normal
+ # vfork test fails in sandbox (both glibc/uclibc)
+ cd test; make; cd ..
+ fi
+ fi
+}
+
+src_install() {
+ emake PREFIX=${D} install || die "install failed"
+
+ # remove files coming from kernel-headers
+ # scsi is uclibc's own directory since cvs 20040212
+ check_main_libc
+ if [ "${SYS_LIBC}" = "uClibc" ]
+ then
+ rm -rf ${D}/usr/include/{asm,linux}
+ rm -f ${D}/usr/lib/lib*_pic.a
+ ! use static && use build && rm -f ${D}/usr/lib/lib*.a
+
+ emake PREFIX=${D} install_utils || die "install-utils failed"
+ dodir /usr/bin
+ exeinto /usr/bin
+ doexe ${FILESDIR}/getent
+ fi
+
+ # shameless plug for mjn3 who gives us so much...
+ # please give back if you can. -solar
+ f=DEDICATION.mjn3 ; [ -e "$f" ] && ( cat $f ; epause 2 )
+
+ if ! use build
+ then
+ dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3
+ doman debian/*.1
+ fi
+}
+
+#pkg_postinst() {
+#check_main_libc
+#if [ "${SYS_LIBC}" = "uClibc" ] ; then
+# if [ "${ROOT}" = "/" ] ; then
+# /sbin/ldconfig
+# [ ! -e /etc/TZ ] && echo UTC > /etc/TZ
+# # reload init?
+# fi
+#else
+#should we add the lib dir to ld.so.conf?
+#fi
+#}