# $Header: /home/cvsd/magellan-cvs/magellan-src/toolchain/toolchain-gzip/toolchain-gzip-1.3.5-r4.smage2,v 1.1 2005-07-04 00:41:38 niro Exp $ PNAME="toolchain-gzip" PVER="1.3.5" PBUILD="r4" SRCFILE="gzip-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/gzip-${PVER}" SRC_URI=( mirror://gzip/${SRCFILE} ) ## 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 } src_compile() { cd ${SRCDIR} ./configure \ --host=${CHOST} \ --prefix=${TOOLCHAIN_PREFIX} \ --disable-nls \ || die # fix: gzexe program has the location of the gzip binary hard-wired into it cp gzexe.in{,.backup} || die sed 's%"BINDIR"%/bin%' gzexe.in.backup > gzexe.in || die mmake || die } src_install() { cd ${SRCDIR} make DESTDIR=${BINDIR} install || die # remove unwanted stuff KEEPFILES="bin/gunzip bin/gzip bin/zcaz bin/znew" zapmost ${BINDIR}${TOOLCHAIN_PREFIX} ${KEEPFILES} || die }