# $Header: /magellan-cvs/smage/klibc/klibc-1.5-r5.smage2,v 1.1 2008/05/02 10:18:25 niro Exp $ PNAME="klibc" PVER="1.5" PBUILD="r5" PCATEGORIE="dev-libs" STATE="unstable" DESCRIPTION="A minimal libc subset for use with initramfs." HOMEPAGE="http://www.kernel.org/pub/linux/libs/klibc/" DEPEND=">= dev-lang/perl-5" SDEPEND=">= virtual/kernel-sources" SRCFILE="${PNAME}-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" # global var: ${LINUX_SOURCES} # location where they are [[ -z ${LINUX_SOURCES} ]] && LINUX_SOURCES="/usr/src/linux" sminclude mtools SRC_URI=( http://www.kernel.org/pub/linux/libs/${PNAME}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${PNAME}-${PVER}-2.6.24.patch ) UP2DATE="updatecmd ${HOMEPAGE} | lasttarball" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # fixes include issues with merged x86/x86_64 asm trees mpatch ${PNAME}-${PVER}-2.6.24.patch || die ln -snf ${LINUX_SOURCES} ${SRCDIR}/linux || die } src_compile() { cd ${SRCDIR} mmake \ ARCH=${ARCH/i*86/i386} \ mandir=/usr/share/man \ libdir=/usr/$(mlibdir) \ INSTALLDIR=/usr/$(mlibdir)/klibc \ SHLIBDIR=/$(mlibdir) \ || die } src_install() { cd ${SRCDIR} # needed directories minstalldir /usr/share/aclocal || die mmake \ ARCH=${ARCH/i*86/i386} \ INSTALLROOT=${BINDIR} \ mandir=/usr/share/man \ libdir=/usr/$(mlibdir) \ INSTALLDIR=/usr/$(mlibdir)/klibc \ SHLIBDIR=/$(mlibdir) \ install || die # remove hardlinks; use symlinks rm ${BINDIR}/usr/$(mlibdir)/klibc/bin/{gunzip,zcat} || die mlink gzip /usr/$(mlibdir)/klibc/bin/gunzip || die mlink gzip /usr/$(mlibdir)/klibc/bin/zcat || die # missing ac-includes minstallfile contrib/klibc.m4 /usr/share/aclocal || die # broken due the patch mlink asm-x86 /usr/$(mlibdir)/klibc/include/asm || die # docs minstalldocs README usr/klibc/{CAVEATS,LICENSE} usr/dash/README.klibc || die }