Skip to content

Commit 07c0de7

Browse files
author
Thomas G. Lockhart
committed
Update makefile to generate man pages.
Include first cut at instructions for man pages in docguide.sgml. Fix markup.
1 parent 7b09d4b commit 07c0de7

File tree

5 files changed

+185
-68
lines changed

5 files changed

+185
-68
lines changed

doc/src/sgml/Makefile

Lines changed: 69 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,24 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/doc/src/sgml/Makefile,v 1.7 1998/10/30 19:36:51 thomas Exp $
11+
# $Header: /cvsroot/pgsql/doc/src/sgml/Makefile,v 1.8 1999/07/06 17:19:41 thomas Exp $
1212
#
1313
#----------------------------------------------------------------------------
1414

1515
PGDOCS= ../..
1616
SRCDIR= ../../../src
17+
D2MDIR= ../docbook2man
1718

1819
# This is where the default stylesheets appear on my system.
1920
# Probably no need to change this; rather, put definitions
2021
# for HSTYLE and PSTYLE and/or for HDSL and PDSL
2122
# in Makefile.custom in your code src directory.
2223

23-
HSTYLE=/usr/lib/sgml/stylesheets/jade/docbook/html
24-
PSTYLE=/usr/lib/sgml/stylesheets/jade/docbook/print
24+
#HSTYLE=/usr/lib/sgml/stylesheets/nwalsh-modular/html
25+
#PSTYLE=/usr/lib/sgml/stylesheets/nwalsh-modular/print
2526

26-
#HSTYLE=/home/tgl/SGML/db107.d/docbook/html
27-
#PSTYLE=/home/tgl/SGML/db107.d/docbook/print
27+
HSTYLE=/opt/sgml/current/docbook/html
28+
PSTYLE=/opt/sgml/current/docbook/print
2829

2930
HDSL=$(HSTYLE)/docbook.dsl
3031
PDSL=$(PSTYLE)/docbook.dsl
@@ -57,6 +58,46 @@ ifneq ($(PDSL), )
5758
PRINTOPTS= -d $(PDSL)
5859
endif
5960

61+
MANSOURCES= $(wildcard ref/*.sgml)
62+
63+
APPLICATIONS= createdb.sgml createuser.sgml \
64+
destroydb.sgml destroyuser.sgml \
65+
initdb.sgml initlocation.sgml \
66+
pg_dump.sgml \
67+
pg_dumpall.sgml \
68+
pg_upgrade.sgml \
69+
pgaccess-ref.sgml \
70+
pgadmin-ref.sgml \
71+
postgres-ref.sgml \
72+
postmaster.sgml \
73+
psql-ref.sgml \
74+
vacuumdb.sgml
75+
76+
COMMANDS= abort.sgml alter_table.sgml alter_user.sgml \
77+
begin.sgml \
78+
close.sgml cluster.sgml commit.sgml copy.sgml \
79+
create_aggregate.sgml create_database.sgml create_function.sgml create_index.sgml \
80+
create_language.sgml create_operator.sgml create_rule.sgml create_sequence.sgml \
81+
create_table.sgml create_table_as.sgml create_trigger.sgml create_type.sgml \
82+
create_user.sgml create_view.sgml \
83+
declare.sgml delete.sgml \
84+
drop_aggregate.sgml drop_database.sgml drop_function.sgml drop_index.sgml \
85+
drop_language.sgml drop_operator.sgml drop_rule.sgml drop_sequence.sgml \
86+
drop_table.sgml drop_trigger.sgml drop_type.sgml drop_user.sgml drop_view.sgml \
87+
explain.sgml fetch.sgml grant.sgml \
88+
insert.sgml listen.sgml load.sgml lock.sgml move.sgml \
89+
notify.sgml \
90+
reset.sgml revoke.sgml rollback.sgml \
91+
select.sgml select_into.sgml set.sgml show.sgml \
92+
unlisten.sgml update.sgml vacuum.sgml
93+
94+
FUNCTIONS= current_date.sgml current_time.sgml current_timestamp.sgml current_user.sgml
95+
96+
APPSOURCES= $(addprefix ref/, $(APPLICATIONS))
97+
SQLSOURCES= $(addprefix ref/, $(COMMANDS))
98+
APPTARGETS= $(APPLICATIONS:.sgml=.1)
99+
SQLTARGETS= $(COMMANDS:.sgml=.l)
100+
60101
.PRECIOUS: postgres.tex postgres.dvi
61102
.PHONY: install all clean distclean
62103

@@ -66,8 +107,26 @@ install::
66107

67108
all::
68109

110+
#man:: .manlist
111+
# for f in `cat .manlist` ; do \
112+
# nsgmls $f | sgmlspl ../docbook2man/docbook2man-spec.pl --lowercase; \
113+
# done
114+
#
115+
#.manlist: $(MANSOURCES)
116+
# (grep -iE '<refentry([ ]|>)' $(MANSOURCES) | cut -f 1 -d : | sort | uniq) > .manlist
117+
118+
man1: $(APPTARGETS)
119+
$(RM) -rf man1
120+
if [ ! -d man1 ]; then mkdir man1; fi
121+
mv *.1 man1/
122+
123+
manl: $(SQLTARGETS)
124+
$(RM) -rf manl/*
125+
if [ ! -d manl ]; then mkdir manl; fi
126+
mv *.l manl/
127+
69128
clean::
70-
(rm -rf HTML.manifest *.html *.htm)
129+
(rm -rf HTML.manifest *.html *.htm man1 manl manpage*)
71130

72131
distclean::
73132
$(MAKE) clean
@@ -76,16 +135,11 @@ distclean::
76135
# Generic production rules
77136
#
78137

79-
# Compressed file
80-
81-
%.gz: %
82-
(gzip -f $<)
83-
84-
# TAR file for HTML package
138+
%.1: ref/%.sgml
139+
nsgmls $< | sgmlspl $(D2MDIR)/docbook2man-spec.pl --defsection 1
85140

86-
%.tar: %.html # %.ps
87-
($(TAR) cf $@ $*.html index.html *.htm *.gif) # $*.ps
88-
(rm -rf index.html *.htm)
141+
%.l: ref/%.sgml
142+
nsgmls $< | sgmlspl $(D2MDIR)/docbook2man-spec.pl --defsection l
89143

90144
# HTML
91145
# Include some softlinks to the generic default file names

doc/src/sgml/arch-dev.sgml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<note>
55
<title>Author</title>
66
<para>
7-
This chapter originally appeared as a part of <xref linkend="SIM98" endterm="SIM98">, Stefan Simkovics'
7+
This chapter originally appeared as a part of
8+
<xref linkend="SIM98" endterm="SIM98">, Stefan Simkovics'
89
Master's Thesis prepared at Vienna University of Technology under the direction
910
of O.Univ.Prof.Dr. Georg Gottlob and Univ.Ass. Mag. Katrin Seyr.
1011
</para>
@@ -239,17 +240,18 @@
239240

240241
<para>
241242
A detailed description of <application>yacc</application> or
242-
the grammar rules given
243-
in <filename>gram.y</filename> would be beyond the scope of this paper. There are
244-
many books and documents dealing with <application>lex</application>
245-
and <application>yacc</application>. You
246-
should be familiar with <application>yacc</application> before you start to study the
247-
grammar given in <filename>gram.y</filename> otherwise you won't understand what
248-
happens there.
243+
the grammar rules given in <filename>gram.y</filename> would be
244+
beyond the scope of this paper. There are many books and
245+
documents dealing with <application>lex</application> and
246+
<application>yacc</application>. You should be familiar with
247+
<application>yacc</application> before you start to study the
248+
grammar given in <filename>gram.y</filename> otherwise you won't
249+
understand what happens there.
249250
</para>
250251

251252
<para>
252-
For a better understanding of the data structures used in <productname>Postgres</productname>
253+
For a better understanding of the data structures used in
254+
<productname>Postgres</productname>
253255
for the processing of a query we use an example to illustrate the
254256
changes made to these data structures in every stage.
255257
</para>
@@ -271,10 +273,9 @@
271273
have already been defined.
272274

273275
<programlisting>
274-
select s.sname, se.pno
275-
from supplier s, sells se
276-
where s.sno > 2 and
277-
s.sno = se.sno;
276+
select s.sname, se.pno
277+
from supplier s, sells se
278+
where s.sno > 2 and s.sno = se.sno;
278279
</programlisting>
279280
</para>
280281
</example>

doc/src/sgml/docguide.sgml

Lines changed: 98 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/docguide.sgml,v 1.17 1999/06/23 06:19:36 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/docguide.sgml,v 1.18 1999/07/06 17:19:41 thomas Exp $
33
Documentation Guide
44
Thomas Lockhart
55

@@ -817,15 +817,15 @@ be included below.
817817
</thead>
818818
<tbody>
819819
<row>
820-
<entry><sgmltag>Book</sgmltag></entry>
820+
<entry><sgmltag>book</sgmltag></entry>
821821
<entry>Delimits a Book element</entry>
822822
</row>
823823
<row>
824-
<entry><sgmltag>Chapter</sgmltag></entry>
824+
<entry><sgmltag>chapter</sgmltag></entry>
825825
<entry>Delimits a Chapter element</entry>
826826
</row>
827827
<row>
828-
<entry><sgmltag>Appendix</sgmltag></entry>
828+
<entry><sgmltag>appendix</sgmltag></entry>
829829
<entry><sgmltag>Delimits a Appendix element</sgmltag></entry>
830830
</row>
831831
</tbody>
@@ -932,19 +932,20 @@ right, and I can verify the document with "nsgmls -s docguide.sgml".
932932
</sect2>
933933
</sect1>
934934

935-
<sect1>
936-
<title>Building Documentation</title>
935+
<sect1>
936+
<title>Building Documentation</title>
937937

938-
<para>
939-
GNU <application>make</application> is used to build documentation from the DocBook sources.
940-
There are a few environment definitions which may need to be set or modified for your installation.
941-
The <filename>Makefile</filename> looks for
942-
<filename>doc/../src/Makefile</filename>
943-
and (implicitly) for
944-
<filename>doc/../src/Makefile.custom</filename>
945-
to obtain environment information. On my system, the <filename>src/Makefile.custom</filename> looks like
938+
<para>
939+
GNU <application>make</application> is used to build documentation
940+
from the DocBook sources. There are a few environment definitions
941+
which may need to be set or modified for your installation.
942+
The <filename>Makefile</filename> looks for
943+
<filename>doc/../src/Makefile</filename> and (implicitly) for
944+
<filename>doc/../src/Makefile.custom</filename> to obtain
945+
environment information. On my system, the
946+
<filename>src/Makefile.custom</filename> looks like
946947

947-
<programlisting>
948+
<programlisting>
948949
# Makefile.custom
949950
# Thomas Lockhart 1998-03-01
950951

@@ -956,41 +957,100 @@ YFLAGS+= -v
956957

957958
HSTYLE= /home/tgl/SGML/db107.d/docbook/html
958959
PSTYLE= /home/tgl/SGML/db107.d/docbook/print
959-
</programlisting>
960+
</programlisting>
960961

961-
where HSTYLE and PSTYLE determine the path to <filename>docbook.dsl</filename> for <acronym>HTML</acronym>
962-
and hardcopy (print) stylesheets, respectively. These stylesheet file names are for Norm Walsh's
963-
Modular Style Sheets; if other stylesheets are used then one can define HDSL and PDSL as the full path
964-
and file name for the stylesheet, as is done above for HSTYLE and PSTYLE.
965-
On many systems, these stylesheets will be found in packages installed in
966-
<filename>/usr/lib/sgml/</filename>,
967-
<filename>/usr/share/lib/sgml/</filename>,
968-
or
969-
<filename>/usr/local/lib/sgml/</filename>.
970-
</para>
962+
where HSTYLE and PSTYLE determine the path to
963+
<filename>docbook.dsl</filename> for <acronym>HTML</acronym>
964+
and hardcopy (print) stylesheets, respectively. These stylesheet
965+
file names are for Norm Walsh's
966+
<productname>Modular Style Sheets</productname>; if other
967+
stylesheets are used then one can define HDSL and PDSL as the full path
968+
and file name for the stylesheet, as is done above for HSTYLE and PSTYLE.
969+
On many systems, these stylesheets will be found in packages installed in
970+
<filename>/usr/lib/sgml/</filename>,
971+
<filename>/usr/share/lib/sgml/</filename>,
972+
or
973+
<filename>/usr/local/lib/sgml/</filename>.
974+
</para>
971975

972-
<para>
973-
<acronym>HTML</acronym> documentation packages can be generated from the <acronym>SGML</acronym> source by
974-
typing
975-
<programlisting>
976+
<para>
977+
<acronym>HTML</acronym> documentation packages can be generated
978+
from the <acronym>SGML</acronym> source by typing
979+
<programlisting>
976980
% cd doc/src
977981
% make tutorial.tar.gz
978982
% make user.tar.gz
979983
% make admin.tar.gz
980984
% make programmer.tar.gz
981985
% make postgres.tar.gz
982986
% make install
983-
</programlisting>
984-
</para>
987+
</programlisting>
988+
</para>
985989

986-
<para>
987-
These packages can be installed from the main documentation directory
988-
by typing
989-
<programlisting>
990+
<para>
991+
These packages can be installed from the main documentation directory
992+
by typing
993+
<programlisting>
990994
% cd doc
991995
% make install
992-
</programlisting>
993-
</para></sect1>
996+
</programlisting>
997+
</para>
998+
</sect1>
999+
1000+
<sect1>
1001+
<title>Manpages</title>
1002+
1003+
<para>
1004+
We use the <application>docbook2man</application> utility to
1005+
convert <productname>DocBook</productname>
1006+
<sgmltag>REFENTRY</sgmltag> pages to *roff output suitable for man
1007+
pages. At the time of writing, the utility required patching to
1008+
successfully run on the <productname>Postgres</productname> markup,
1009+
and we added a small amount of new functionality to allow setting
1010+
the man page section in the output file name.
1011+
</para>
1012+
1013+
<para>
1014+
<application>docbook2man</application> is written in perl, and
1015+
requires the CPAN package <literal>SGMLSpm</literal> to run. Also,
1016+
it requires <application>nsgmls</application> to be available,
1017+
which is included in the <application>jade</application>
1018+
distribution. After installing these packages, then simply run
1019+
1020+
<programlisting>
1021+
$ cd doc/src
1022+
$ make man
1023+
</programlisting>
1024+
1025+
which will result in a tar file being generated in the
1026+
<filename>doc/src</filename> directory.
1027+
</para>
1028+
1029+
<procedure>
1030+
<title>docbook2man Installation Procedure</title>
1031+
1032+
<step performance="required">
1033+
<para>
1034+
Install the <application>docbook2man</application> package,
1035+
available at
1036+
<ulink url="http://shell.ipoline.com/~elmert/comp/docbook2X/">http://shell.ipoline.com/~elmert/comp/docbook2X/</ulink>
1037+
</para>
1038+
</step>
1039+
1040+
<step performance="required">
1041+
<para>
1042+
Install the SGMLSpm perl module, available from CPAN mirrors.
1043+
</para>
1044+
</step>
1045+
1046+
<step performance="required">
1047+
<para>
1048+
Install <application>nsgmls</application> if not already
1049+
available from your <application>jade</application> installation.
1050+
</para>
1051+
</step>
1052+
</procedure>
1053+
</sect1>
9941054

9951055
<sect1>
9961056
<title>Hardcopy Generation for v6.5</title>

doc/src/sgml/libpq++.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,8 @@
738738

739739
<programlisting>
740740
PgDatabase data;
741-
data.exec("create table foo (a int4, b char16, d float8)");
742-
data.exec("copy foo from stdin");
741+
data.Exec("create table foo (a int4, b char16, d float8)");
742+
data.Exec("copy foo from stdin");
743743
data.putline("3\etHello World\et4.5\en");
744744
data.putline("4\etGoodbye World\et7.11\en");
745745
&amp;...

doc/src/sgml/mvcc.sgml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@
9595
<tgroup cols="4">
9696
<thead>
9797
<row>
98+
<entry>
99+
</entry>
98100
<entry>
99101
Dirty Read
100102
</entry>

0 commit comments

Comments
 (0)