~ubuntu-branches/ubuntu/maverick/slony1/maverick

« back to all changes in this revision

Viewing changes to .pc/manpage-build.patch/doc/adminguide/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Peter Eisentraut
  • Date: 2010-04-17 23:06:42 UTC
  • mfrom: (1.1.12 upstream) (2.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20100417230642-fhld39orcligbnm4
Tags: 1.2.21-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#----------------------------------------------------------------------------
 
2
#
 
3
# PostgreSQL documentation makefile
 
4
#
 
5
# $Id: Makefile,v 1.19.2.2 2008-05-07 19:27:54 cbbrowne Exp $
 
6
#
 
7
#----------------------------------------------------------------------------
 
8
 
 
9
subdir = doc/adminguide
 
10
slony_top_builddir = ../..
 
11
 
 
12
include $(slony_top_builddir)/Makefile.global
 
13
 
 
14
.SECONDARY:
 
15
.NOTPARALLEL:
 
16
 
 
17
 
 
18
GENERATED_SGML = bookindex.sgml version.sgml
 
19
 
 
20
ALLSGML = $(wildcard $(srcdir)/*.sgml) $(GENERATED_SGML)
 
21
DISTFILES = $(ALLSGML) $(GENERATED_SGML)
 
22
 
 
23
ifdef DOCBOOKSTYLE
 
24
CATALOG = -c $(DOCBOOKSTYLE)/catalog
 
25
endif
 
26
 
 
27
# Enable draft mode during development
 
28
ifneq (,$(findstring devel, $(VERSION)))
 
29
override JADEFLAGS += -V draft-mode
 
30
endif
 
31
 
 
32
# docbook2man generates man pages from docbook refentry source code.
 
33
ifdef D2MDIR
 
34
D2MSCRIPT=$(D2MDIR)/docbook2man-spec.pl
 
35
endif
 
36
 
 
37
# Enable some extra warnings
 
38
override SPFLAGS += -wall -wno-unused-param -wno-empty -wfully-tagged
 
39
 
 
40
##
 
41
## Man pages
 
42
##
 
43
 
 
44
.PHONY: man
 
45
 
 
46
 
 
47
man: man.sgml $(ALLSGML)
 
48
ifdef NSGMLS
 
49
ifdef SGMLSPL
 
50
ifdef D2MSCRIPT
 
51
        $(NSGMLS) $(NSGMLS_FLAGS) $< | $(SGMLSPL) $(D2MSCRIPT) --lowercase --date "`date '+%Y-%m-%d'`"
 
52
# One more time, to resolve cross-references
 
53
        $(NSGMLS) $(NSGMLS_FLAGS) $< | $(SGMLSPL) $(D2MSCRIPT) --lowercase --date "`date '+%Y-%m-%d'`"
 
54
        mkdir -p man1 man7
 
55
        mv *.1 man1/
 
56
        mv *.7 man7/
 
57
endif
 
58
endif
 
59
endif
 
60
 
 
61
##
 
62
## HTML
 
63
##
 
64
 
 
65
all: html man
 
66
        $(MAKE) html
 
67
 
 
68
installdirs:
 
69
ifdef docdir
 
70
        $(mkinstalldirs) $(DESTDIR)$(docdir)/sgml
 
71
        $(mkinstalldirs) $(DESTDIR)$(docdir)/html
 
72
        $(mkinstalldirs) $(DESTDIR)$(mandir)/man1
 
73
        $(mkinstalldirs) $(DESTDIR)$(mandir)/man7
 
74
endif
 
75
 
 
76
install: installdirs
 
77
ifdef docdir
 
78
        for file in $(wildcard $(srcdir)/*.sgml) ; do \
 
79
          $(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/sgml || exit; \
 
80
        done
 
81
        for file in $(wildcard man1/*) ; do \
 
82
           $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man1 || exit;\
 
83
        done
 
84
        for file in $(wildcard man7/*) ; do \
 
85
          $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man7 || exit;\
 
86
        done
 
87
        for file in $(wildcard *.html) stylesheet.css ; do \
 
88
          $(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/html || exit;\
 
89
        done
 
90
endif
 
91
 
 
92
.PHONY: html
 
93
 
 
94
ifndef JADE
 
95
html:
 
96
        @echo "You must have jade installed to build the documentation." && exit;
 
97
else
 
98
html: slony.sgml $(ALLSGML) stylesheet.dsl
 
99
        @rm -f *.html ;\
 
100
        $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -ioutput-html -t sgml $<
 
101
ifeq ($(vpath_build), yes)
 
102
        @cp $(srcdir)/stylesheet.css .
 
103
endif
 
104
endif
 
105
 
 
106
COLLATEINDEX := LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g
 
107
 
 
108
ifdef JADE
 
109
ifeq (,$(wildcard HTML.index))
 
110
bookindex.sgml:
 
111
        $(COLLATEINDEX) -o $@ -N
 
112
else
 
113
bookindex.sgml: HTML.index
 
114
        $(COLLATEINDEX) -i 'bookindex' -o $@ $<
 
115
endif
 
116
else
 
117
bookindex.sgml:
 
118
        @echo "You must have jade to build the documentation" && exit
 
119
endif
 
120
 
 
121
##
 
122
## Print
 
123
##
 
124
 
 
125
# RTF to allow minor editing for hardcopy
 
126
 
 
127
%.rtf: %.sgml $(ALLSGML) stylesheet.dsl
 
128
        $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t rtf -V rtf-backend -ioutput-print $<
 
129
 
 
130
# TeX
 
131
# Regular TeX and pdfTeX have slightly differing requirements, so we
 
132
# need to distinguish the path we're taking.
 
133
 
 
134
%.tex-ps: %.sgml $(ALLSGML) stylesheet.dsl
 
135
        $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t tex -V tex-backend -ioutput-print -V texdvi-output -o $@ $<
 
136
 
 
137
%.tex-pdf: %.sgml $(ALLSGML) stylesheet.dsl
 
138
        $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t tex -V tex-backend -ioutput-print -V texpdf-output -o $@ $<
 
139
 
 
140
%.dvi: %.tex-ps
 
141
        @rm -f $*.aux $*.log
 
142
        jadetex $<
 
143
        jadetex $<
 
144
        jadetex $<
 
145
 
 
146
# Postscript from TeX
 
147
%.ps: %.dvi
 
148
        dvips -o $@ $<
 
149
 
 
150
%.pdf: %.tex-pdf
 
151
        @rm -f $*.aux $*.log $*.out
 
152
        pdfjadetex $<
 
153
        pdfjadetex $<
 
154
        pdfjadetex $<
 
155
 
 
156
 
 
157
# This generates an XML version of the flow-object tree.  It's useful
 
158
# for debugging DSSSL code, and possibly to interface to some other
 
159
# tools that can make use of this.
 
160
%.fot: %.sgml $(ALLSGML) stylesheet.dsl
 
161
        $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t fot -i output-print -o $@ $<
 
162
 
 
163
 
 
164
# Graphics
 
165
 
 
166
%.gif:
 
167
        cp $(srcdir)/../graphics/$@ .
 
168
 
 
169
%.eps: %.gif
 
170
        $(CONVERT) $< eps:$@
 
171
 
 
172
%.pdf: %.eps
 
173
        $(EPSTOPDF) $<
 
174
 
 
175
 
 
176
##
 
177
## Semi-automatic generation of some text files.
 
178
##
 
179
 
 
180
JADE.text = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -i output-text -t sgml
 
181
LYNX = lynx
 
182
 
 
183
INSTALL HISTORY regress_README: % : %.html
 
184
        $(PERL) -p -e 's/<H(1|2)$$/<H\1 align=center/g' $< | $(LYNX) -force_html -dump -nolist -stdin >$@
 
185
 
 
186
INSTALL.html: standalone-install.sgml installation.sgml 
 
187
        $(JADE.text) -V nochunks standalone-install.sgml installation.sgml >$@
 
188
 
 
189
HISTORY.html: release.sgml
 
190
        ( echo '<!doctype appendix PUBLIC "-//OASIS//DTD DocBook V4.2//EN">'; \
 
191
          cat $< ) >tempfile_HISTORY.sgml
 
192
        $(JADE.text) -V nochunks tempfile_HISTORY.sgml >$@
 
193
        rm tempfile_HISTORY.sgml
 
194
 
 
195
regress_README.html: regress.sgml
 
196
        ( echo '<!doctype chapter PUBLIC "-//OASIS//DTD DocBook V4.2//EN" ['; \
 
197
          echo '<!entity % standalone-ignore "IGNORE"> ]>'; \
 
198
          cat $< ) >tempfile_regress_README.sgml
 
199
        $(JADE.text) -V nochunks tempfile_regress_README.sgml >$@
 
200
        rm tempfile_regress_README.sgml
 
201
 
 
202
 
 
203
##
 
204
## Experimental XML stuff
 
205
##
 
206
 
 
207
OSX = osx # (may be called sx or sgml2xml on some systems)
 
208
XSLTPROC = xsltproc
 
209
 
 
210
slony.xml: slony.sgml $(GENERATED_SGML)
 
211
        $(OSX) -x lower $< | \
 
212
          sed -e 's/\[\(lt\|gt\|amp\|nbsp\|copy\|quot\|ouml\|uuml\|egrave\) *\]/\&\1;/g' \
 
213
              -e '1a\' -e '<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">' \
 
214
          >$@
 
215
 
 
216
testxml: stylesheet.xsl slony.xml
 
217
        $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam pg.version '$(VERSION)' $^
 
218
 
 
219
htmlhelp: stylesheet-hh.xsl slony.xml
 
220
        $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam pg.version '$(VERSION)' $^
 
221
 
 
222
 
 
223
##
 
224
## Check
 
225
##
 
226
 
 
227
# Quick syntax check without style processing
 
228
check: slony.sgml $(ALLSGML) $(GENERATED_SGML)
 
229
        $(NSGMLS) $(SPFLAGS) $(SGMLINCLUDE) -s $<
 
230
 
 
231
 
 
232
##
 
233
## Clean
 
234
##
 
235
 
 
236
clean distclean maintainer-clean:
 
237
# HTML
 
238
        rm -f HTML.manifest *.html *.gif
 
239
# man
 
240
        rm -rf *.1 *.7 man1 man7 manpage.refs manpage.links manpage.log
 
241
# print
 
242
        rm -f *.rtf *.tex-ps *.tex-pdf *.dvi *.aux *.log *.ps *.pdf *.out *.eps *.fot
 
243
# index
 
244
        rm -f HTML.index $(GENERATED_SGML)
 
245
# text
 
246
        rm -f INSTALL HISTORY
 
247
 
 
248
BASEDIR=$(slony_top_builddir)/src/backend
 
249
BASESQL=$(BASEDIR)/slony1_base.sql
 
250
BASEFUNS=$(BASEDIR)/slony1_funcs.sql
 
251
XIDSQL=localxid.sql
 
252
TEMPDB=schemadoc
 
253
TEMPSCHEMA=schemadoc
 
254
CREATELANG=$(pgbindir)/createlang   # That's how it is for me...
 
255
PGAUTODOC=/usr/bin/postgresql_autodoc
 
256
 
 
257
schemadoc.xml: $(BASESQL) $(BASEFUNS) $(XIDDIR)
 
258
        @$(pgbindir)/createdb $(TEMPDB) && ( \
 
259
        $(CREATELANG) plpgsql $(TEMPDB) 2>/dev/null ; \
 
260
        echo "drop schema $(TEMPSCHEMA);create schema $(TEMPSCHEMA);" | $(pgbindir)/psql $(TEMPDB) && \
 
261
        cat $(XIDSQL) $(BASEFUNS) $(BASESQL) |  sed -e "s/@NAMESPACE@/$(TEMPSCHEMA)/g"  -e "s/@CLUSTERNAME@/$(TEMPSCHEMA)/g" | $(pgbindir)/psql $(TEMPDB) && \
 
262
        $(PGAUTODOC) -d $(TEMPDB) -s $(TEMPSCHEMA) -t xml -f schemadoc ;\
 
263
        sed -i.bak -e "s/$(TEMPSCHEMA)\.//g" -e "s@<book.*>@@g" -e "s@</book.*>@@g" schemadoc.xml ;\
 
264
        rm  schemadoc.xml.bak ;\
 
265
        $(pgbindir)/dropdb $(TEMPDB) >/dev/null 2>&1 \
 
266
        ) || echo "unable to createdb $(TEMPDB)"
 
267
 
 
268
version.sgml:   $(slony_top_builddir)/Makefile.global
 
269
        { \
 
270
        echo "<!entity version \"$(VERSION)\">"; \
 
271
        echo "<!entity majorversion \"`expr $(VERSION) : '\([0-9][0-9]*\.[0-9][0-9]*\)'`\">"; \
 
272
        } >$@
 
273
 
 
274
distdir:        $(DISTFILES)
 
275
        mkdir -p $(distdir)/$(subdir)
 
276
        -chmod 777 $(distdir)/$(subdir)
 
277
        @for file in $(DISTFILES) ; do \
 
278
                cp $$file $(distdir)/$(subdir)/$$file || exit; \
 
279
        done
 
280