OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rtems-20020807/] [doc/] [gnu_docs/] [gen_docs] - Blame information for rev 1026

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
#! /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?
21
srcdir=/usr1/rtems/work/rtems-doc/
22
texi2www=${srcdir}/tools/texi2www/texi2www
23
gnu_docs=${srcdir}/gnu_docs
24
images=${srcdir}/images
25
 
26
install_base=/home/httpd/html/rtems/rtemsdoc-4.5.1-pre3
27
install_share=/home/httpd/html/rtems/rtemsdoc-4.5.1-pre3/share/toolsdoc
28
install_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
 
36
if [ ! -d ${install} ] ; then
37
  echo "${install} is not a directory"
38
  exit 1
39
fi
40
 
41
#ECHO=echo
42
 
43
STARTDIR=`pwd`
44
find . -name "*.dvi" | while read file
45
do
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
145
done
146
 
147
echo "Installing graphics"
148
 
149
test -d ${install_share}/html/images || mkdir ${install_share}/html/images
150
cd ${images}
151
for 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
153
do
154
  cp ${f} ${install_share}/html/images/${f}
155
done
156
echo "Installing top level HTML indices"
157
cp ${gnu_docs}/index.html ${install_share}/html/index.html
158
cp ${gnu_docs}/rtems_tools_index.html ${install_share}/../index.html
159
 
160
# Now deal with the reference card
161
set -x
162
test -d ${install_share}/html/refcard || mkdir ${install_share}/html/refcard
163
cp ${gnu_docs}/refcard.html ${install_share}/html/refcard/refcard.html
164
exit 0

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.