Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3199 - (show annotations) (download)
Fri Oct 16 11:15:21 2009 UTC (14 years, 7 months ago) by niro
File size: 2772 byte(s)
-fix build with newer kernels
1 # $Id$
2
3 PNAME="klibc"
4 PVER="1.5.15"
5 PBUILD="r4"
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 mirror://${PNAME}/${PNAME}-${PVER}-mntproc-definitions.patch
31 )
32
33 UP2DATE="updatecmd ${HOMEPAGE}/Testing/ | lasttarball"
34
35 src_prepare()
36 {
37 munpack ${SRCFILE} || die
38 cd ${SRCDIR}
39
40 # fix errors in io.h header
41 mpatch ${PNAME}-1.5.14-x86_64-fix-io.h.patch || die
42
43 # new include-layout in 2.6.29
44 mpatch ${PNAME}-${PVER}-fix-2.6.29-includes.patch || die
45
46 # mntproc definitions are missing in newer kernels (>=2.6.31)
47 mpatch ${PNAME}-${PVER}-mntproc-definitions.patch || die
48
49 ln -snf ${LINUX_SOURCES} ${SRCDIR}/linux || die
50 }
51
52 src_compile()
53 {
54 cd ${SRCDIR}
55
56 mmake \
57 ARCH=${ARCH/i*86/i386} \
58 KLIBCARCH=${ARCH/i*86/i386} \
59 KLIBCASMARCH=${ARCH/i*86/x86} \
60 mandir=/usr/share/man \
61 libdir=/usr/$(mlibdir) \
62 INSTALLDIR=/usr/$(mlibdir)/klibc \
63 SHLIBDIR=/$(mlibdir) \
64 || die
65 }
66
67 src_install()
68 {
69 cd ${SRCDIR}
70
71 # needed directories
72 minstalldir /usr/share/aclocal || die
73
74 mmake \
75 ARCH=${ARCH/i*86/i386} \
76 KLIBCARCH=${ARCH/i*86/i386} \
77 KLIBCASMARCH=${ARCH/[i|x]*86*/x86} \
78 INSTALLROOT=${BINDIR} \
79 mandir=/usr/share/man \
80 libdir=/usr/$(mlibdir) \
81 INSTALLDIR=/usr/$(mlibdir)/klibc \
82 SHLIBDIR=/$(mlibdir) \
83 install || die
84
85 # remove hardlinks; use symlinks
86 rm ${BINDIR}/usr/$(mlibdir)/klibc/bin/{gunzip,zcat} || die
87 mlink gzip /usr/$(mlibdir)/klibc/bin/gunzip || die
88 mlink gzip /usr/$(mlibdir)/klibc/bin/zcat || die
89
90 # missing ac-includes
91 minstallfile contrib/klibc.m4 /usr/share/aclocal || die
92
93 # # broken due the patch
94 # mlink asm-x86 /usr/$(mlibdir)/klibc/include/asm || die
95
96 # remove broken symlinks
97 if [[ -L ${BINDIR}/usr/$(mlibdir)/klibc/include/asm/asm-${ARCH/i*86/x86} ]]
98 then
99 rm ${BINDIR}/usr/$(mlibdir)/klibc/include/asm/asm-${ARCH/i*86/x86} || die
100 fi
101 if [[ -L ${BINDIR}/usr/$(mlibdir)/klibc/include/asm/asm-${ARCH/i*86/i386} ]]
102 then
103 rm ${BINDIR}/usr/$(mlibdir)/klibc/include/asm/asm-${ARCH/i*86/i386} || die
104 fi
105
106 # copy missing adm includes
107 cp -a linux/arch/x86/include/asm/* ${BINDIR}/usr/$(mlibdir)/klibc/include/asm/ || die
108
109 # docs
110 minstalldocs README usr/klibc/{CAVEATS,LICENSE} usr/dash/README.klibc || die
111 }

Properties

Name Value
svn:keywords Id