aboutsummaryrefslogtreecommitdiff
blob: 751602844bcc63a59a0f21d85de1b0c355f25793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild,v 1.9 2011/04/20 18:10:38 ulm Exp $

EAPI="4"

inherit savedconfig

MY_P=uClibc-${PV}
DESCRIPTION="C library for developing embedded Linux systems"
HOMEPAGE="http://www.uclibc.org/"
SRC_URI="http://uclibc.org/downloads/${MY_P}.tar.bz2"

LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="-* amd64 x86 mips ~ppc"
IUSE=""
RESTRICT="strip"

RDEPEND=""
DEPEND=""

S=${WORKDIR}/${MY_P}

src_configure() {
	if use savedconfig; then
		restore_config config/.config
	else
		cp "${FILESDIR}"/uclibc-${ARCH}.${PV}.config .config || die "${ARCH} is not supported"
	fi
	yes "" 2> /dev/null | make -s oldconfig > /dev/null || die "could not make oldconfig"
}

src_compile() {
	emake headers
	emake
	emake utils
}

src_install() {
	emake DESTDIR="${D}" install

	# remove files coming from kernel-headers
	rm -rf "${D}"/usr/include/{linux,asm*}

	emake DESTDIR="${D}" install_utils
	dobin extra/scripts/getent
	dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3

	if use savedconfig; then
		save_config config/.config
	fi
}

pkg_postinst() {
	echo "UTC" > "${ROOT}"/etc/TZ
	/sbin/ldconfig
	[[ -x /sbin/telinit ]] && /sbin/telinit U &> /dev/null
}