home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / doc / libxml-perl / mirror.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2000-02-22  |  1.6 KB  |  70 lines

  1. #! /bin/sh
  2. #
  3. # NAME
  4. #     mirror -- update web page with a libxml-perl release
  5. #
  6. # SYNOPSIS
  7. usage="mirror RELEASE DESTDIR"
  8. #
  9. # DESCRIPTION
  10. #     `mirror' creates a web mirror using a libxml-perl release tar
  11. #     file.
  12. #
  13. #     `mirror' pulls files from the tar file to create the web page.
  14. #     `mirror' searches HTML files for the string @VERSION@ and
  15. #     replaces it with RELEASE.  `mirror' searches for all *.pm and
  16. #     *.pod files and converts them to HTML.  It also copies a few
  17. #     hardcoded files.
  18. #
  19. #     `mirror' installs the web pages in DESTDIR.
  20. #
  21. #     CAUTION: `mirror' removes the contents of DESTDIR before
  22. #     copying files to it.
  23. #
  24. # AUTHOR
  25. #     Ken MacLeod
  26. #
  27. # $Id: mirror.sh,v 1.2 2000/02/22 21:02:56 kmacleod Exp $
  28. #
  29.  
  30. PWD_CMD="/bin/pwd"
  31. SED="sed"
  32. TR="/usr/bin/tr"
  33.  
  34. if [ $# != 2 ]; then
  35.   echo "usage: $usage"
  36.   exit 1
  37. fi
  38.  
  39. RELEASE="$1"
  40. DESTDIR="$2"
  41.  
  42. set -e
  43. set -x
  44.  
  45. rm -rf $DESTDIR
  46. mkdir -p $DESTDIR
  47.  
  48. cp libxml-perl-${RELEASE}.tar.gz $DESTDIR
  49.  
  50. cd $DESTDIR
  51.  
  52. tar xzvf libxml-perl-${RELEASE}.tar.gz
  53.  
  54. for ii in libxml-perl-${RELEASE}/doc/*.html; do
  55.   $SED <$ii >`basename $ii` \
  56.     -e "s/@VERSION@/$RELEASE/g"
  57. done
  58. for ii in `cd libxml-perl-${RELEASE}/doc; echo *.pod`; do
  59.     pod2html libxml-perl-${RELEASE}/doc/$ii >`basename $ii .pod`.html
  60. done
  61. for ii in `cd libxml-perl-${RELEASE}/lib; echo */*.pm */*/*.pm`; do
  62.     dstfile=`echo $ii | sed -e 's|/|::|g'`
  63.     pod2html libxml-perl-${RELEASE}/lib/$ii >`basename $dstfile .pm`.html
  64. done
  65.  
  66. mv libxml-perl-${RELEASE}/README libxml-perl-${RELEASE}.readme
  67. mv libxml-perl-${RELEASE}/doc/modules.xml .
  68.  
  69. rm -rf libxml-perl-${RELEASE} pod2html-dircache pod2html-itemcache
  70.