#!/bin/sh # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-flex SRC=/devel/manpagesrc INFO=$PKG/usr/info TEX=/devel/texinfo-docs if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi if [ ! -d $PKG ]; then mkdir -p $PKG # place for the package to be built fi # Explode the package framework: cd $PKG explodepkg $CWD/_flex.tar.gz # Function to handle manpage source: man2gz () { # $1 is source page name, $2 is target name for preformatted # output (full path && name) and $3 is the same, but for the # source. mkdir -p `dirname $2` groff -Tascii -mandoc $1 | gzip -9c > $2 if [ ! "$3" = "" ]; then mkdir -p `dirname $3` cat $1 > $3 fi } echo "+============+" echo "| flex-2.5.4 |" echo "+============+" cd $TMP tar xzvf $CWD/flex-2.5.4.tar.gz cd flex-2.5.4 mkdir -p $PKG/usr/doc/flex-2.5.4 cp -a INSTALL NEWS README $PKG/usr/doc/flex-2.5.4 mkdir -p $PKG/usr/doc/flex-2.5.4/MISC cd MISC cp -a EBCDIC README alloca.c debflex.awk parse.c parse.h \ testxxLexer.l $PKG/usr/doc/flex-2.5.4/MISC cp -a fastwc $PKG/usr/doc/flex-2.5.4/MISC chown -R root.root $PKG/usr/doc/flex-2.5.4 cd .. configure --prefix=/usr make CFLAGS=-O2 LDFLAGS=-s cat flex > $PKG/usr/bin/flex cat FlexLexer.h > $PKG/usr/include/FlexLexer.h cat libfl.a > $PKG/usr/lib/libfl.a cat flex.1 | gzip -9c > $PKG/usr/man/man1/flex.1.gz cd MISC/texinfo makeinfo flex.texi mkdir -p $INFO cat flex.info | gzip -9c > $INFO/flex.info.gz cat flex.info-1 | gzip -9c > $INFO/flex.info-1.gz cat flex.info-2 | gzip -9c > $INFO/flex.info-2.gz cat flex.info-3 | gzip -9c > $INFO/flex.info-2.gz cp flex.texi $TEX/flex.texi # Build the package: cd $PKG tar czvf $TMP/flex.tgz . # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/flex-2.5.4 rm -rf $PKG fi