# $Header: /home/cvsd/magellan-cvs/magellan-src/toolchain/toolchain-diffutils/toolchain-diffutils-2.8.4-r4.smage2,v 1.1 2005-07-04 00:41:38 niro Exp $ PNAME="toolchain-diffutils" PVER="2.8.4" PBUILD="r4" SRCFILE="diffutils-${PVER}.tar.gz" SRCDIR="${BUILDDIR}/diffutils-${PVER}" SRC_URI=( mirror://diffutils/${SRCFILE} mirror://diffutils/diffutils-${PVER}-Makefile-fix-typeo.patch mirror://diffutils/diffutils-${PVER}-sdiff-no-waitpid.patch mirror://diffutils/diffutils-${PVER}-tabsize-dumps-core.diff mirror://diffutils/diffutils-${PVER}-no-manpage.patch ) # needs: to run: glibc # build: sed, gettext, texinfo ## global toolchain var ## # export CFLAGS, CHOST, TOOLCHAIN_PREFIX export CFLAGS="-mtune=i486 -Os -pipe" export CXXFLAGS="${CFLAGS}" export TOOLCHAIN_PREFIX="/tools" zapmost() { local rootdir rootdir="${1}/" [ ! -e "$rootdir" ] && echo "zapmost: $rootdir not found; skipping..." && return 1 install -d ${BUILDDIR}/zap local dirs shift local x for x in ${*} do if [ "${x##*/}" = "${x}" ] then #one deep mv ${rootdir}${x} ${BUILDDIR}/zap else #more than one deep; create intermediate directories dirs=${x%/*} install -d ${BUILDDIR}/zap/${dirs} mv ${rootdir}${x} ${BUILDDIR}/zap/${x} fi done rm -rf ${rootdir}* mv ${BUILDDIR}/zap/* ${rootdir} } src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} mpatch -Np1 diffutils-${PVER}-Makefile-fix-typeo.patch || die mpatch -Np1 diffutils-${PVER}-sdiff-no-waitpid.patch || die mpatch -Np1 diffutils-${PVER}-tabsize-dumps-core.diff || die mpatch -Np1 diffutils-${PVER}-no-manpage.patch || die } src_compile() { cd ${SRCDIR} ./configure \ --host=${CHOST} \ --build=${CHOST} \ --prefix=${TOOLCHAIN_PREFIX} \ --disable-nls \ || die mmake || die } src_install() { cd ${SRCDIR} make DESTDIR=${BINDIR} install || die # remove unwanted stuff KEEPFILES="bin" zapmost ${BINDIR}${TOOLCHAIN_PREFIX} ${KEEPFILES} || die }