Magellan Linux

Contents of /trunk/core/klibc/klibc-1.5.15-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1362 - (show annotations) (download)
Mon May 4 17:30:42 2009 UTC (15 years ago) by niro
File size: 2470 byte(s)
-fixed klibc build issues with linux-2.6.29
1 # $Id$
2
3 PNAME="klibc"
4 PVER="1.5.15"
5 PBUILD="r2"
6
7 PCATEGORIE="dev-libs"
8 STATE="unstable"
9
10 DESCRIPTION="A minimal libc subset for use with initramfs."
11 HOMEPAGE="http://www.kernel.org/pub/linux/libs/klibc/"
12
13 DEPEND=">= dev-lang/perl-5"
14 SDEPEND=">= virtual/kernel-sources"
15
16 SRCFILE="${PNAME}-${PVER}.tar.bz2"
17 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
18
19 # global var: ${LINUX_SOURCES}
20 # location where they are
21 [[ -z ${LINUX_SOURCES} ]] && LINUX_SOURCES="/usr/src/linux"
22
23 sminclude mtools
24
25 SRC_URI=(
26 http://www.kernel.org/pub/linux/libs/${PNAME}/Testing/${SRCFILE}
27 mirror://${PNAME}/${SRCFILE}
28 mirror://${PNAME}/${PNAME}-1.5.14-x86_64-fix-io.h.patch
29 mirror://${PNAME}/${PNAME}-${PVER}-fix-2.6.29-includes.patch
30 )
31
32 UP2DATE="updatecmd ${HOMEPAGE}/Testing/ | lasttarball"
33
34 src_prepare()
35 {
36 munpack ${SRCFILE} || die
37 cd ${SRCDIR}
38
39 # fix errors in io.h header
40 mpatch ${PNAME}-1.5.14-x86_64-fix-io.h.patch || die
41
42 # new include-layout in 2.6.29
43 mpatch ${PNAME}-${PVER}-fix-2.6.29-includes.patch || die
44
45 ln -snf ${LINUX_SOURCES} ${SRCDIR}/linux || die
46 }
47
48 src_compile()
49 {
50 cd ${SRCDIR}
51 mmake \
52 ARCH=${ARCH/i*86/i386} \
53 KLIBCARCH=${ARCH/i*86/i386} \
54 KLIBCASMARCH=${ARCH/i*86/x86} \
55 mandir=/usr/share/man \
56 libdir=/usr/$(mlibdir) \
57 INSTALLDIR=/usr/$(mlibdir)/klibc \
58 SHLIBDIR=/$(mlibdir) \
59 || die
60 }
61
62 src_install()
63 {
64 cd ${SRCDIR}
65
66 # needed directories
67 minstalldir /usr/share/aclocal || die
68
69 mmake \
70 ARCH=${ARCH/i*86/i386} \
71 KLIBCARCH=${ARCH/i*86/i386} \
72 KLIBCASMARCH=${ARCH/[i|x]*86*/x86} \
73 INSTALLROOT=${BINDIR} \
74 mandir=/usr/share/man \
75 libdir=/usr/$(mlibdir) \
76 INSTALLDIR=/usr/$(mlibdir)/klibc \
77 SHLIBDIR=/$(mlibdir) \
78 install || die
79
80 # remove hardlinks; use symlinks
81 rm ${BINDIR}/usr/$(mlibdir)/klibc/bin/{gunzip,zcat} || die
82 mlink gzip /usr/$(mlibdir)/klibc/bin/gunzip || die
83 mlink gzip /usr/$(mlibdir)/klibc/bin/zcat || die
84
85 # missing ac-includes
86 minstallfile contrib/klibc.m4 /usr/share/aclocal || die
87
88 # # broken due the patch
89 # mlink asm-x86 /usr/$(mlibdir)/klibc/include/asm || die
90
91 # remove broken symlinks
92 if [[ -e ${BINDIR}/usr/$(mlibdir)/klibc/include/asm/asm-${ARCH/i*86/x86} ]]
93 then
94 rm ${BINDIR}/usr/$(mlibdir)/klibc/include/asm/asm-${ARCH/i*86/x86} || die
95 fi
96 if [[ -e ${BINDIR}/usr/$(mlibdir)/klibc/include/asm/asm-${ARCH/i*86/i386} ]]
97 then
98 rm ${BINDIR}/usr/$(mlibdir)/klibc/include/asm/asm-${ARCH/i*86/i386} || die
99 fi
100
101 # docs
102 minstalldocs README usr/klibc/{CAVEATS,LICENSE} usr/dash/README.klibc || die
103 }

Properties

Name Value
svn:keywords Id