# $Id$ PNAME="flex" PVER="2.5.39" PBUILD="r1" PCAT="sys-dev" DESCRIPTION="GNU fast lexical analyser generator." HOMEPAGE="http://flex.sourceforge.net/" DEPEND=">= virtual/glibc >= sys-dev/m4-1.4" SDEPEND=">= sys-dev/bison-2.6" SRCFILE="${PNAME}-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" sminclude mtools multilib SRC_URI=( sourceforge://${PNAME}/${SRCFILE} mirror://${PNAME}/${SRCFILE} ) UP2DATE="updatecmd ${HOMEPAGE} | grep version | sed 's/.* version \(.*\) i.*/\1/;q'" src_prepare() { munpack ${SRCFILE} || die # remove tests which are incompatible with the latest bison all-abis sed -i -e '/test-bison-yylloc/d' -e '/test-bison-yylval/d' tests/Makefile.in || die # do not regenerate the man page all-abis touch '${SRCDIR}-${abi}'/doc/flex.1 || die } src_compile() { mconfigure || die # flex doesn't compiles sometimes with > -j1 mmake -j1 || die } src_install() { mmake DESTDIR=${BINDIR} install || die all-abis mlink libfl.a /usr/'$(mlibdir)'/libl.a || die cat > ${BINDIR}/usr/bin/lex << "EOF" #!/bin/sh exec /usr/bin/flex -l "$@" EOF mchmod 755 /usr/bin/lex || die }