1 | #!/bin/sh |
---|
2 | # |
---|
3 | # history |
---|
4 | # Sept 2006: Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
5 | # |
---|
6 | # version |
---|
7 | # $Id$ |
---|
8 | # |
---|
9 | homeidl=$1 |
---|
10 | homesaxo=$2 |
---|
11 | homesrc=$3 |
---|
12 | version=$4 |
---|
13 | # |
---|
14 | ############################################################# |
---|
15 | # create the file saxoidl.adp from idl.adp and idldoc-lib.adp |
---|
16 | ############################################################# |
---|
17 | # create saxoidl.adp header |
---|
18 | [ ! -f ${homeidl}/idl.adp ] && exit 1 |
---|
19 | [ ! -f ${homesaxo}/idldoc-lib.adp ] && exit 1 |
---|
20 | # |
---|
21 | cat <<EOF > ${homesrc}/idl.adp |
---|
22 | <!DOCTYPE DCF> |
---|
23 | <assistantconfig version="3.3.0"> |
---|
24 | <profile> |
---|
25 | <property name="name">SAXO - IDL ${version} Help</property> |
---|
26 | <property name="title">SAXO - IDL ${version} Help</property> |
---|
27 | <property name="startpage">${homesrc}/home.html</property> |
---|
28 | <property name="aboutmenutext">About SAXO</property> |
---|
29 | <property name="abouturl">${homesrc}/aboutsaxo.txt</property> |
---|
30 | <property name="assistantdocs">${homeidl}</property> |
---|
31 | </profile> |
---|
32 | EOF |
---|
33 | [ $? -ne 0 ] && exit 1 |
---|
34 | # extract part from </profile> to </assistantconfig> |
---|
35 | # put the complete path of the references |
---|
36 | # and put it at the end of idl.adp |
---|
37 | sed -e '1,/<\/profile>/ d' \ |
---|
38 | -e '/<\/assistantconfig>/,$ d' \ |
---|
39 | -e "s?ref=\"?ref=\"${homeidl}/?g" \ |
---|
40 | ${homeidl}/idl.adp >> ${homesrc}/idl.adp |
---|
41 | [ $? -ne 0 ] && exit 1 |
---|
42 | |
---|
43 | # extract part from </profile> |
---|
44 | # put the complete path of the references |
---|
45 | # and put it at the end of idl.adp |
---|
46 | sed -e '1,/<\/profile>/ d' \ |
---|
47 | -e "s?ref=\"?ref=\"${homesaxo}/?g" \ |
---|
48 | ${homesaxo}/idldoc-lib.adp >> ${homesrc}/idl.adp |
---|
49 | [ $? -ne 0 ] && exit 1 |
---|
50 | |
---|
51 | ############################################################# |
---|
52 | # create the file home.html from the one installed with IDL |
---|
53 | ############################################################# |
---|
54 | [ ! -f ${homeidl}/home.html ] && exit 1 |
---|
55 | # put the complete path of the references |
---|
56 | sed -e "s?ref=\"?ref=\"${homeidl}/?g" \ |
---|
57 | ${homeidl}/home.html > ${homesrc}/home.html |
---|
58 | [ $? -ne 0 ] && exit 1 |
---|
59 | # number of the line containing the first </h3> |
---|
60 | grep -n '</h3>' ${homesrc}/home.html > /tmp/toto$$ |
---|
61 | [ $? -ne 0 ] && exit 1 |
---|
62 | numline=$( head -n 1 /tmp/toto$$ ) |
---|
63 | [ $? -ne 0 ] && exit 1 |
---|
64 | numline=$( echo ${numline} | cut -b1-2 ) |
---|
65 | [ $? -ne 0 ] && exit 1 |
---|
66 | # define the part to be added after the first </h3> |
---|
67 | cat << EOF > /tmp/toto$$ |
---|
68 | <a name="SAXOdir"> </a><p class="pIndentedRelative"><img src="images/blueball_idl.gif" id="blueballSAXOdir" border="0" hspace="0" vspace="0"/>   <a href="${homesaxo}/home.html">SAXO Directory</a></p> |
---|
69 | EOF |
---|
70 | [ $? -ne 0 ] && exit 1 |
---|
71 | # add line for SAXO Directory after the first </h3> |
---|
72 | sed -e "${numline}r /tmp/toto$$" ${homesrc}/home.html > /tmp/toto2$$ |
---|
73 | [ $? -ne 0 ] && exit 1 |
---|
74 | mv -f /tmp/toto2$$ ${homesrc}/home.html |
---|
75 | [ $? -ne 0 ] && exit 1 |
---|
76 | # number of the line containing the last </h3> |
---|
77 | grep -n '</h3>' ${homesrc}/home.html > /tmp/toto$$ |
---|
78 | [ $? -ne 0 ] && exit 1 |
---|
79 | numline=$( tail -n 1 /tmp/toto$$ ) |
---|
80 | [ $? -ne 0 ] && exit 1 |
---|
81 | numline=$( echo ${numline} | cut -b1-2 ) |
---|
82 | [ $? -ne 0 ] && exit 1 |
---|
83 | # define the part to be added after the last </h3> |
---|
84 | cat << EOF > /tmp/toto$$ |
---|
85 | <a name="SAXOweb"> </a><p class="pIndentedRelative"><img src="images/blueball_idl.gif" id="blueballSAXOweb" border="0" hspace="0" vspace="0"/>   <a href="http://forge.ipsl.jussieu.fr/saxo">SAXO Home Page</a> </p> |
---|
86 | EOF |
---|
87 | [ $? -ne 0 ] && exit 1 |
---|
88 | # add line for SAXO Home Page after the last </h3> |
---|
89 | sed -e "${numline}r /tmp/toto$$" ${homesrc}/home.html > /tmp/toto2$$ |
---|
90 | [ $? -ne 0 ] && exit 1 |
---|
91 | mv -f /tmp/toto2$$ ${homesrc}/home.html |
---|
92 | [ $? -ne 0 ] && exit 1 |
---|
93 | # put the complete path of the images except for SAXOIDL_OnlineHelp_title.png |
---|
94 | sed -e "s?src=\"?src=\"${homeidl}/?g" \ |
---|
95 | -e "s?src=\".*IDL_OnlineHelp_Title\.gif\"?src=\"${homesaxo}/../xmldoc/images/SAXOIDL_OnlineHelp_title\.png\"?g" \ |
---|
96 | ${homesrc}/home.html > /tmp/toto$$ |
---|
97 | [ $? -ne 0 ] && exit 1 |
---|
98 | mv -f /tmp/toto$$ ${homesrc}/home.html |
---|
99 | [ $? -ne 0 ] && exit 1 |
---|
100 | ############################################################# |
---|
101 | # create the file aboutsaxo.txt from overview |
---|
102 | ############################################################# |
---|
103 | [ ! -f ${homeidl}/home.html ] && exit 1 |
---|
104 | # remove the line with @ in the file overview |
---|
105 | sed -e '/@/d' ${homesaxo}/../../overview > ${homesrc}/aboutsaxo.txt |
---|
106 | [ $? -ne 0 ] && exit 1 |
---|
107 | # add a link to saxo page |
---|
108 | cat <<EOF >> ${homesrc}/aboutsaxo.txt |
---|
109 | |
---|
110 | More informations on |
---|
111 | http://forge.ipsl.jussieu.fr/saxo |
---|
112 | |
---|
113 | EOF |
---|
114 | [ $? -ne 0 ] && exit 1 |
---|
115 | exit 0 |
---|