home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- # Set initial variables:
- CWD=`pwd`
- if [ "$TMP" = "" ]; then
- TMP=/tmp
- fi
- PKG=$TMP/package-find
- SRC=/devel/manpagesrc
- INFO=/devel/info-pages/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
- tar xzvf $CWD/_find.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 "| findutils-4.1 |"
- echo "+===============+"
- cd $TMP
- tar xzvf $CWD/findutils-4.1.tar.gz
- cd findutils-4.1
- ./configure --prefix=/usr
- make CFLAGS=-O2 LDFLAGS=-s
- cat find/find > $PKG/usr/bin/find
- cat locate/bigram > $PKG/usr/bin/bigram
- cat locate/code > $PKG/usr/bin/code
- cat locate/frcode > $PKG/usr/bin/frcode
- cat locate/locate > $PKG/usr/bin/locate
- cat locate/updatedb.sh > $PKG/usr/bin/updatedb
- cat xargs/xargs > $PKG/usr/bin/xargs
- man2gz find/find.1 $PKG/usr/man/preformat/cat1/find.1.gz $SRC/usr/man/man1/find.1
- man2gz locate/locate.1 $PKG/usr/man/preformat/cat1/locate.1.gz $SRC/usr/man/man1/locate.1
- man2gz locate/updatedb.1 $PKG/usr/man/preformat/cat1/updatedb.1.gz $SRC/usr/man/man1/updatedb.1
- man2gz locate/locatedb.5 $PKG/usr/man/preformat/cat5/locatedb.5.gz $SRC/usr/man/man5/locatedb.5
- man2gz xargs/xargs.1 $PKG/usr/man/preformat/cat1/xargs.1.gz $SRC/usr/man/man1/xargs.1
- cat doc/find.info | gzip -9c > $INFO/find.info.gz
- cat doc/find.info-1 | gzip -9c > $INFO/find.info-1.gz
- cat doc/find.info-2 | gzip -9c > $INFO/find.info-2.gz
- cp doc/find.texi $TEX/find.texi
-
- # Build the package:
- cd $PKG
- tar czvf $TMP/find.tgz .
-
- # Clean up the extra stuff:
- if [ "$1" = "--cleanup" ]; then
- rm -rf $TMP/findutils-4.1
- rm -rf $PKG
- fi
-