home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / A / FIND / SLACKBUI < prev   
Encoding:
Text File  |  1995-04-20  |  2.0 KB  |  69 lines

  1. #!/bin/sh
  2. # Set initial variables:
  3. CWD=`pwd`
  4. if [ "$TMP" = "" ]; then
  5.   TMP=/tmp
  6. fi
  7. PKG=$TMP/package-find
  8. SRC=/devel/manpagesrc
  9. INFO=/devel/info-pages/usr/info
  10. TEX=/devel/texinfo-docs
  11.  
  12. if [ ! -d $TMP ]; then
  13.   mkdir -p $TMP # location to build the source
  14. fi
  15. if [ ! -d $PKG ]; then
  16.   mkdir -p $PKG # place for the package to be built
  17. fi
  18.  
  19. # Explode the package framework:
  20. cd $PKG
  21. tar xzvf $CWD/_find.tar.gz
  22.  
  23. # Function to handle manpage source:
  24. man2gz () { # $1 is source page name, $2 is target name for preformatted
  25.             # output (full path && name) and $3 is the same, but for the
  26.             # source.
  27.   mkdir -p `dirname $2`
  28.   groff -Tascii -mandoc $1 | gzip -9c > $2
  29.   if [ ! "$3" = "" ]; then
  30.     mkdir -p `dirname $3`
  31.     cat $1 > $3 
  32.   fi 
  33. }
  34.  
  35. echo "+===============+"
  36. echo "| findutils-4.1 |"
  37. echo "+===============+"
  38. cd $TMP
  39. tar xzvf $CWD/findutils-4.1.tar.gz
  40. cd findutils-4.1
  41. ./configure --prefix=/usr
  42. make CFLAGS=-O2 LDFLAGS=-s
  43. cat find/find > $PKG/usr/bin/find
  44. cat locate/bigram > $PKG/usr/bin/bigram
  45. cat locate/code > $PKG/usr/bin/code
  46. cat locate/frcode > $PKG/usr/bin/frcode
  47. cat locate/locate > $PKG/usr/bin/locate
  48. cat locate/updatedb.sh > $PKG/usr/bin/updatedb
  49. cat xargs/xargs > $PKG/usr/bin/xargs
  50. man2gz find/find.1 $PKG/usr/man/preformat/cat1/find.1.gz $SRC/usr/man/man1/find.1
  51. man2gz locate/locate.1 $PKG/usr/man/preformat/cat1/locate.1.gz $SRC/usr/man/man1/locate.1
  52. man2gz locate/updatedb.1 $PKG/usr/man/preformat/cat1/updatedb.1.gz $SRC/usr/man/man1/updatedb.1
  53. man2gz locate/locatedb.5 $PKG/usr/man/preformat/cat5/locatedb.5.gz $SRC/usr/man/man5/locatedb.5
  54. man2gz xargs/xargs.1 $PKG/usr/man/preformat/cat1/xargs.1.gz $SRC/usr/man/man1/xargs.1
  55. cat doc/find.info | gzip -9c > $INFO/find.info.gz
  56. cat doc/find.info-1 | gzip -9c > $INFO/find.info-1.gz
  57. cat doc/find.info-2 | gzip -9c > $INFO/find.info-2.gz
  58. cp doc/find.texi $TEX/find.texi
  59.  
  60. # Build the package:
  61. cd $PKG
  62. tar czvf $TMP/find.tgz .
  63.  
  64. # Clean up the extra stuff:
  65. if [ "$1" = "--cleanup" ]; then
  66.   rm -rf $TMP/findutils-4.1
  67.   rm -rf $PKG
  68. fi
  69.