1
include ../Makefile.config
2
include ../Version.config
4
LAST_RELEASE_VERSION = $(REL_MAJOR_VERSION).$(REL_MINOR_VERSION).$(REL_MICRO_VERSION)
6
JW_COMMONOPTS = -f docbook -b html -e no-valid
2
# PostGIS documentation build Makefile
4
# Written by Mark Cave-Ayland
6
# NOTE: We don't use a standard PGXS Makefile here since the DOCS target
7
# only allows files to be stored within contrib/ and we currently
8
# store documentation under contrib/postgis due to the possibility
9
# that we could produce a large number of files (think chunked HTML)
12
POSTGIS_MAJOR_VERSION=1
13
POSTGIS_MINOR_VERSION=4
14
POSTGIS_MICRO_VERSION=0
16
XSLTPROC = /usr/bin/xsltproc
17
XSLBASE = /opt/local/share/xsl/docbook-xsl
8
19
XSLTPROC_COMMONOPTS = \
9
20
--param section.autolabel 1 \
10
21
--param section.label.includes.component.label 1 \
11
--param chunk.section.depth 0
22
--param chunk.section.depth 0 \
23
--param generate.section.toc.level 1 \
24
--param funcsynopsis.style ansi \
25
--param admon.graphics 1 \
26
--param admon.textlabel 0 \
27
--param simplesect.in.toc 0 \
28
--param use.id.as.filename 1 \
29
--param chunk.quietly 1
13
31
XSLTPROC_HTMLOPTS = \
14
32
--stringparam html.stylesheet style.css \
16
HTML_DOCBOOK_XSL=$(XSLBASE)/html/docbook.xsl
17
CHUNK_HTML_DOCBOOK_XSL=$(XSLBASE)/html/chunk.xsl
18
FO_DOCBOOK_XSL=$(XSLBASE)/fo/docbook.xsl
24
@echo "Docs building requires 'xsltproc' or 'jw'."
25
@echo "Configuration tool could not find any, either install"
26
@echo "them or refer to online manual:"
28
@echo " http://postgis.refractions.net/docs"
31
postgis-out.xml: postgis.xml long_xact.xml ../Version.config
32
cat $< | sed "s/@@LAST_RELEASE_VERSION@@/$(LAST_RELEASE_VERSION)/g" > $@
34
HTML_DOCBOOK_XSL=$(XSLBASE)/html/docbook.xsl
35
CHUNK_HTML_DOCBOOK_XSL=$(XSLBASE)/html/chunk.xsl
37
# DBLatex's dblatex script for PDF generation from DocBook
40
# Imagemagick's convert utility program for generated images used in the documentation
41
IMAGEMAGICK = /opt/local/bin/convert
43
# Directories for postgresql subdirectories
44
PGSQL_DOCDIR=/usr/local/pgsql/8.3/doc
45
PGSQL_MANDIR=/usr/local/pgsql/8.3/man
46
PGSQL_SHAREDIR=/usr/local/pgsql/8.3/share
48
# If XSLTPROC or XSLBASE were not found during configure, we cannot
49
# build the documentation
51
all: requirements_not_met_xsltproc
54
all: requirements_not_met_xslbase
56
ifeq ($(IMAGEMAGICK),)
57
all: requirements_not_met_imagemagick
59
all: html/postgis.html postgis_comments.sql
64
postgis_aggs_mm.xml: ./xsl/postgis_aggs_mm.xml.xsl reference.xml
65
$(XSLTPROC) ./xsl/postgis_aggs_mm.xml.xsl reference.xml > $@
67
postgis_comments.sql: ./xsl/postgis_comments.sql.xsl reference.xml
68
$(XSLTPROC) ./xsl/postgis_comments.sql.xsl reference.xml > $@
70
postgis-out.xml: postgis.xml introduction.xml installation.xml faq.xml using_postgis_dataman.xml using_postgis_app.xml performance_tips.xml reference.xml postgis_aggs_mm.xml reporting.xml release_notes.xml ../Version.config
71
cat $< | sed "s/@@LAST_RELEASE_VERSION@@/${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}/g" > $@
34
73
chunked-html: postgis-out.xml
35
74
$(XSLTPROC) $(XSLTPROC_COMMONOPTS) $(XSLTPROC_HTMLOPTS) \
44
83
$(HTML_DOCBOOK_XSL) \
47
postgis.fo: postgis-out.xml
48
$(XSLTPROC) $(XSLTPROC_COMMONOPTS) \
50
$(XSLBASE)/fo/docbook.xsl \
53
html: html/postgis.html
55
postgis.pdf: postgis-out.xml
56
@if test x"$(DB2PDF)" = x; then \
57
echo "Error: db2pdf not found, can't build posgis.pdf"; \
58
echo " try installing docbook-utils package"; \
61
$(DB2PDF) $< && mv postgis-out.pdf postgis.pdf; \
65
_postgis.pdf: postgis.fo
66
@if test x"$(PDFXMLTEX)" = x; then \
67
echo "Error: pdfxmltex not found, can't build posgis.pdf"; \
74
$(JW) $(JW_COMMONOPTS) -o html/ postgis-out.xml
87
postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}.pdf: postgis-out.xml
88
@if test x"$(DBLATEX)" = x; then \
89
echo "Error: dblatex not found, can't build pdf"; \
90
echo " try installing dblatex and then re-run configure"; \
93
cp reference.xml reference.xml.orig; \
94
cat reference.xml.orig | sed -e "s:term:listitem:g" > reference.xml; \
95
dblatex -T native -t pdf \
97
-P doc.collab.show=0 \
98
-P figure.note="${PWD}/html/images/note" \
99
-P figure.tip="${PWD}/html/images/tip" \
100
-P figure.important="${PWD}/html/images/important" \
101
-P figure.warning="${PWD}/html/images/warning" \
102
-P figure.caution="${PWD}/html/images/caution" \
103
-P latex.output.revhistory=0 \
104
-o postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}.pdf $<; \
105
cp reference.xml.orig reference.xml; \
106
rm -rf reference.xml.orig; \
109
pdf: postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}.pdf
111
doxygen.cfg: doxygen.cfg.in
112
cat $< | sed "s/@@LAST_RELEASE_VERSION@@/${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}/g" > $@
118
make -C html/image_src images
121
make -C html/image_src clean
122
@rm -f postgis-out.xml postgis_comments.sql postgis_aggs_mm.xml
85
124
maintainer-clean: clean
125
make -C html/image_src clean
127
postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}.pdf
129
comments: postgis_comments.sql
131
comments-install: comments
132
cp postgis_comments.sql $(PGSQL_SHAREDIR)/contrib/postgis_comments.sql
135
rm -f $(PGSQL_SHAREDIR)/contrib/postgis_comments.sql
88
137
install: html/postgis.html man/shp2pgsql.1 man/pgsql2shp.1
89
@mkdir -p $(DESTDIR)$(docdir)/postgis
90
@mkdir -p $(DESTDIR)$(mandir)/man1
91
$(INSTALL_DATA) html/postgis.html $(DESTDIR)$(docdir)/postgis/postgis.html
92
$(INSTALL_DATA) ../README.postgis $(DESTDIR)$(docdir)/postgis/README.postgis
93
$(INSTALL_DATA) man/pgsql2shp.1 $(DESTDIR)$(mandir)/man1/pgsql2shp.1
94
$(INSTALL_DATA) man/shp2pgsql.1 $(DESTDIR)$(mandir)/man1/shp2pgsql.1
138
@mkdir -p $(PGSQL_DOCDIR)/postgis
139
@mkdir -p $(PGSQL_MANDIR)/man1
140
cp html/postgis.html $(PGSQL_DOCDIR)/postgis/postgis.html
141
cp ../README.postgis $(PGSQL_DOCDIR)/postgis/README.postgis
142
cp man/pgsql2shp.1 $(PGSQL_MANDIR)/man1/pgsql2shp.1
143
cp man/shp2pgsql.1 $(PGSQL_MANDIR)/man1/shp2pgsql.1
97
rm -f $(DESTDIR)$(docdir)/postgis/postgis.html
98
rm -f $(DESTDIR)$(docdir)/postgis/README.postgis
99
rm -f $(DESTDIR)$(mandir)/man1/shp2pgsql.1
100
rm -f $(DESTDIR)$(mandir)/man1/pgsql2shp.1
146
rm -f $(PGSQL_DOCDIR)/postgis/postgis.html
147
rm -f $(PGSQL_DOCDIR)/postgis/README.postgis
148
rm -f $(PGSQL_MANDIR)/man1/shp2pgsql.1
149
rm -f $(PGSQL_MANDIR)/man1/pgsql2shp.1
151
requirements_not_met_xsltproc:
153
@echo "configure was unable to find 'xsltproc' which is required to build the documentation."
154
@echo "To build the documentation, install xsltproc and then re-run configure. Alternatively "
155
@echo "refer to online manual:"
157
@echo " http://postgis.refractions.net/docs"
160
requirements_not_met_xslbase:
162
@echo "configure was unable to find the Docbook XSL stylesheet directory which is required to build the documentation."
163
@echo "To build the documentation, install the Docbook XSL stylesheets and/or re-run configure with the --with-xsldir option. Alternatively "
164
@echo "refer to online manual:"
166
@echo " http://postgis.refractions.net/docs"
169
requirements_not_met_imagemagick:
171
@echo "configure was unable to find the ImageMagick's 'convert' utility program."
172
@echo "To build the documentation, install ImageMagick and then re-run configure. Alternatively "
173
@echo "refer to online manual:"
175
@echo " http://postgis.refractions.net/docs"