The Flex package contains a utility for generating programs that recognize patterns in text.
First, fix some regression tests:
patch -Np1 -i ../flex-2.5.37-bison-2.6.1-1.patch
Prepare Flex for compilation:
./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
Compile the package:
make
To test the results (about 0.5 SBU), issue:
make -k check
There are two tests that fail due to incompatibilities with the most recent version of bison.
Install the package:
make install
          There are some packages that expect to find the lex library in /usr/lib. Create a symlink to account for this:
        
ln -sv libfl.a /usr/lib/libl.a
          A few programs do not know about flex yet and try to run its
          predecessor, lex. To
          support those programs, create a wrapper script named lex that calls flex
          in lex emulation
          mode:
        
cat > /usr/bin/lex << "EOF"
#!/bin/sh
# Begin /usr/bin/lex
exec /usr/bin/flex -l "$@"
# End /usr/bin/lex
EOF
chmod -v 755 /usr/bin/lex
        
          If desired, install the flex.pdf
          documentation file:
        
mkdir -v /usr/share/doc/flex-2.5.37 cp -v doc/flex.pdf /usr/share/doc/flex-2.5.37