source: rtems/doc/gnu_docs/gen_docs @ 6449498

4.104.114.84.95
Last change on this file since 6449498 was 6449498, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 17, 2002 at 9:47:47 PM

2001-01-17 Joel Sherrill <joel@…>

  • SUPPORT, LICENSE: New files.
  • Numerous files touched as part of merging the 4.5 branch onto the mainline development trunk and ensuring that the script that cuts snapshots and releases works on the documentation.
  • Property mode set to 100644
File size: 4.6 KB
Line 
1#! /bin/sh
2#
3#  This script is intended to be run in the build directory of a software
4#  package including documentation in texinfo format.  The basic operation
5#  of this script is to:
6#      + find all ".dvi" files from the current directory down,
7#      + for each dvi file
8#        + install the dvi file
9#        + generate PostScript files for the dvi file
10#        + install the PostScript file
11#        + if there is texinfo source for this dvi file
12#             install the info files
13#             generate PDF from the texinfo source
14#             install the PDF file
15#             generate HTML from the texinfo source
16#             install the HTML file
17#
18#
19
20# Ralf... where do these come from using autoconf?
21srcdir=/usr1/rtems/work/rtems-doc/
22texi2www=${srcdir}/tools/texi2www/texi2www
23gnu_docs=${srcdir}/gnu_docs
24images=${srcdir}/images
25
26install_base=/home/httpd/html/rtems/rtemsdoc-4.5.1-pre3
27install_share=/home/httpd/html/rtems/rtemsdoc-4.5.1-pre3/share/toolsdoc
28install_info=/home/httpd/html/rtems/rtemsdoc-4.5.1-pre3/info
29
30
31#if [ $? -ne 1 ] ; then
32#  echo "Usage: $0 install_directory"
33#  exit 1
34#fi
35
36if [ ! -d ${install} ] ; then
37  echo "${install} is not a directory"
38  exit 1
39fi
40
41#ECHO=echo
42
43STARTDIR=`pwd`
44find . -name "*.dvi" | while read file
45do
46  cd $STARTDIR
47  cd `dirname $file`
48  echo $file
49  i=`basename $file`
50####
51  b=`echo $i | cut -d'.' -f1`
52  echo $b
53 
54  if [ -d ${install}/${b} ] ; then
55    echo "Cleaning install point for ${b}"
56    ${ECHO} rm -rf ${install}/html/${b}
57  fi
58
59  for dir_to_do in ${install_info} \
60    ${install_share}/ps \
61    ${install_share}/pdf ${install_share}/dvi \
62    ${install_share}/html/${b}
63  do
64    test -d ${dir_to_do} || mkdir -p ${dir_to_do}
65  done
66
67  echo "Copying DVI for ${b}"
68  echo "+ cp ${b}.dvi ${install_share}/dvi/${b}.dvi"
69  ${ECHO} cp ${b}.dvi ${install_share}/dvi/${b}.dvi
70
71  echo "Generating PS for ${b}"
72  echo "+ dvips -o ${install_share}/ps/${b}.ps ${b}.dvi"
73  ${ECHO} dvips -o ${install_share}/ps/${b}.ps ${b}.dvi
74
75  # unfortunately the .dvi names are not always the same. :(
76  case ${b} in
77    history)  tsrc=hist ;;
78    readline) tsrc=rlman ;;
79    *)        tsrc=${b} ;;
80  esac
81
82  case ${b} in
83    refcard)
84      cp ${gnu_docs}/refcard.html ${install_share}/${b}
85      ;;
86    *)
87      # for some reason chill installs the dvi 1 directory up.
88      test ${b} = "chill" && cd ch
89
90      if [ -r ${tsrc}.texi ] ; then
91        ext=texi
92      elif [ -r ${tsrc}.texinfo ] ; then
93        ext=texinfo
94      else
95        echo "***
96        echo "*** Cannot find a texi or texinfo file for ${b}"
97        echo "***
98        exit 1
99      fi
100
101      echo "Copying INFO for ${b}"
102      ${ECHO} cp ${b}.info* ${install_info}
103
104      case ${b} in
105        g77)  bad_for_pdf="yes" ;;
106        *)    bad_for_pdf="no" ;;
107      esac
108
109      case ${b} in
110        gdb)  extraargs_for_pdf="-I ../../readline/doc" ;;
111        *)    extraargs_for_pdf="" ;;
112      esac
113      if [ ${bad_for_pdf} = "yes" ] ; then
114        echo "*** "
115        echo "*** Skipping PDF for ${b}"
116        echo "*** "
117      else
118        echo "Generating PDF for ${b}"
119        ${ECHO} texi2pdf ${extraargs_for_pdf} ${tsrc}.${ext} && \
120            ${ECHO} cp ${tsrc}.pdf ${install_share}/pdf/${b}.pdf
121      fi
122
123      # until texi2www is modified to take a search path
124      case ${b} in
125        gdb)
126          sed -e 's/^ @/@/' <../../readline/doc/rluser.texinfo >rluser.texinfo
127          cp ../../readline/doc/inc-hist.texi .
128          ;;
129        readline)
130          cp rluser.texinfo rluser.texinfo.tmp
131          sed -e 's/^ @/@/' <../../readline/doc/rluser.texinfo >rluser.texinfo
132          rm -f rluser.texinfo.tmp
133          ;;
134        *)    ;;
135      esac
136      echo "Generating HTML for ${b}"
137      ${ECHO} ${texi2www} \
138        -dirfile ../index.html \
139        -header ${gnu_docs}/gnu_header.html \
140        -footer ${gnu_docs}/gnu_footer.html \
141        -icons  ../images -dir ${install_share}/html/${b} \
142          ${tsrc}.${ext}
143      ;;
144   esac
145done
146
147echo "Installing graphics"
148
149test -d ${install_share}/html/images || mkdir ${install_share}/html/images
150cd ${images}
151for f in dir-arrow.gif dvi.gif missing-arrow.gif next-arrow.gif oaronly.jpg \
152  pdf.gif pdf1.gif prev-arrow.gif ps.gif up-arrow.gif
153do
154  cp ${f} ${install_share}/html/images/${f}
155done
156echo "Installing top level HTML indices"
157cp ${gnu_docs}/index.html ${install_share}/html/index.html
158cp ${gnu_docs}/rtems_tools_index.html ${install_share}/../index.html
159
160# Now deal with the reference card
161set -x
162test -d ${install_share}/html/refcard || mkdir ${install_share}/html/refcard
163cp ${gnu_docs}/refcard.html ${install_share}/html/refcard/refcard.html
164exit 0
Note: See TracBrowser for help on using the repository browser.