blob: d9a33cdb508258544005362949956d0b5dc334fb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
#! /bin/sh
echo 'dude, assuming you are running this script from the ecos-docs/tcpip directory'
MANPAGE_LIST=`find manpages -type f -name '*.?'`
echo "MANPAGE_LIST is $MANPAGE_LIST"
echo 'removing the previous file tcpip-manpages.sgml'
/bin/rm -f tcpip-manpages.sgml
touch tcpip-manpages.sgml
echo '<!-- HEY YOU!!!!!!!!! -->' >> tcpip-manpages.sgml
echo '<!-- this file is automatically generated by the script -->' >> tcpip-manpages.sgml
echo '<!-- ' " $0 " ' -->' >> tcpip-manpages.sgml
echo '<!-- so PLEASE do not modify it: your changes will be lost -->' >> tcpip-manpages.sgml
echo >> tcpip-manpages.sgml
echo >> tcpip-manpages.sgml
echo "<chapter id=\"tcpip-library-reference\">" >> tcpip-manpages.sgml
echo " <title>TCP/IP Library Reference</title>" >> tcpip-manpages.sgml
echo >> tcpip-manpages.sgml
echo >> tcpip-manpages.sgml
for manpage in $MANPAGE_LIST
do
echo "processing $manpage"
# get the title for this section
manpage_title=`egrep '^\.Dt' $manpage | awk '{print $2}' | tr 'A-Z' 'a-z'`
# note that _ is illegal in an id, so we canonicalize it to -
docbook_section_id=`echo $manpage_title | sed 's/_/-/g'`
# now prepare out a section and title
echo " <sect1 id=\"net-common-tcpip-manpages-$docbook_section_id\">" >> tcpip-manpages.sgml
echo " <title>$manpage_title</title>" >> tcpip-manpages.sgml
# we make it <screen> so that it is a monospaced font
echo " <screen>" >> tcpip-manpages.sgml
# now put the contents into this section
cat $manpage | groff -Tascii -mandoc | sed 's/\_\(.\)/\1/g' \
| sed 's/\(.\)\(.\)/\1/g' \
| sed 's/\&/\&/g' \
| sed 's/</\</g' \
| sed 's/+o/o/g' >> tcpip-manpages.sgml
# now close out the section
echo " </screen>" >> tcpip-manpages.sgml
echo " </sect1>" >> tcpip-manpages.sgml
echo >> tcpip-manpages.sgml
done
echo >> tcpip-manpages.sgml
echo "</chapter>" >> tcpip-manpages.sgml
cat <<EOF >> tcpip-manpages.sgml
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-namecase-general:t
sgml-general-insert-case:lower
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:("tcpip.sgml" "book" "chapter")
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
sgml-doctype:"book"
End:
-->
EOF
|