~ubuntu-branches/ubuntu/trusty/postgis/trusty-security

« back to all changes in this revision

Viewing changes to doc/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2009-12-11 13:10:34 UTC
  • mfrom: (1.1.9 upstream) (5.2.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20091211131034-wmsz69wxvt95pe5r
Tags: 1.4.0-2
* Upload to unstable.
* Better parameterized debian/rules against postgis $(VERSION).
* Added dblatex and libcunit1-dev among build-deps.
* Added postgis_comments.sql to contrib/ SQL templates.
* Dropping 8.3 support, no more supported for squeeze.
  (closes: #559587)
* Do not stop on error in postrm if the target dir does not exist.
  (closes: #560409)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
include ../Makefile.config
2
 
include ../Version.config
3
 
 
4
 
LAST_RELEASE_VERSION = $(REL_MAJOR_VERSION).$(REL_MINOR_VERSION).$(REL_MICRO_VERSION)
5
 
 
6
 
JW_COMMONOPTS = -f docbook -b html -e no-valid
 
1
#
 
2
# PostGIS documentation build Makefile
 
3
#
 
4
# Written by Mark Cave-Ayland
 
5
#
 
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)
 
10
#
 
11
 
 
12
POSTGIS_MAJOR_VERSION=1
 
13
POSTGIS_MINOR_VERSION=4
 
14
POSTGIS_MICRO_VERSION=0
 
15
 
 
16
XSLTPROC = /usr/bin/xsltproc
 
17
XSLBASE = /opt/local/share/xsl/docbook-xsl
7
18
 
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
12
30
 
13
31
XSLTPROC_HTMLOPTS = \
14
32
        --stringparam html.stylesheet style.css \
15
33
 
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
19
 
 
20
 
all: $(DOC_RULE)
21
 
 
22
 
requirements_not_met:
23
 
        @echo
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:"
27
 
        @echo
28
 
        @echo "  http://postgis.refractions.net/docs"
29
 
        @echo
30
 
 
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
 
36
 
 
37
# DBLatex's dblatex script for PDF generation from DocBook
 
38
DBLATEX = 
 
39
 
 
40
# Imagemagick's convert utility program for generated images used in the documentation
 
41
IMAGEMAGICK = /opt/local/bin/convert
 
42
 
 
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
 
47
 
 
48
# If XSLTPROC or XSLBASE were not found during configure, we cannot
 
49
# build the documentation
 
50
ifeq ($(XSLTPROC),)
 
51
all: requirements_not_met_xsltproc
 
52
else
 
53
ifeq ($(XSLBASE),)
 
54
all: requirements_not_met_xslbase
 
55
else
 
56
ifeq ($(IMAGEMAGICK),)
 
57
all: requirements_not_met_imagemagick
 
58
else
 
59
all: html/postgis.html postgis_comments.sql
 
60
endif
 
61
endif
 
62
endif
 
63
 
 
64
postgis_aggs_mm.xml: ./xsl/postgis_aggs_mm.xml.xsl reference.xml
 
65
        $(XSLTPROC) ./xsl/postgis_aggs_mm.xml.xsl reference.xml > $@
 
66
 
 
67
postgis_comments.sql: ./xsl/postgis_comments.sql.xsl reference.xml
 
68
        $(XSLTPROC) ./xsl/postgis_comments.sql.xsl reference.xml > $@
 
69
 
 
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" > $@
33
72
 
34
73
chunked-html: postgis-out.xml
35
74
        $(XSLTPROC) $(XSLTPROC_COMMONOPTS) $(XSLTPROC_HTMLOPTS) \
44
83
                $(HTML_DOCBOOK_XSL) \
45
84
                $<
46
85
 
47
 
postgis.fo: postgis-out.xml
48
 
        $(XSLTPROC) $(XSLTPROC_COMMONOPTS) \
49
 
                --output $@ \
50
 
                $(XSLBASE)/fo/docbook.xsl \
51
 
                $<
52
 
 
53
 
html: html/postgis.html
54
 
 
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"; \
59
 
           false; \
60
 
        else \
61
 
           $(DB2PDF) $< && mv postgis-out.pdf postgis.pdf; \
62
 
        fi
63
 
 
64
 
# this is broken
65
 
_postgis.pdf: postgis.fo
66
 
        @if test x"$(PDFXMLTEX)" = x; then \
67
 
           echo "Error: pdfxmltex not found, can't build posgis.pdf"; \
68
 
           false; \
69
 
        else \
70
 
           $(PDFXMLTEX) $<;  \
71
 
        fi
72
 
 
73
 
jw: postgis-out.xml
74
 
        $(JW) $(JW_COMMONOPTS) -o html/ postgis-out.xml
75
 
 
 
86
 
 
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"; \
 
91
           false; \
 
92
        else \
 
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 \
 
96
                   -I "${PWD}/html" \
 
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; \
 
107
        fi
 
108
 
 
109
pdf: postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}.pdf
 
110
 
 
111
doxygen.cfg: doxygen.cfg.in
 
112
        cat $< | sed "s/@@LAST_RELEASE_VERSION@@/${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}/g" > $@
 
113
 
 
114
doxygen: doxygen.cfg
 
115
        doxygen $<
 
116
 
 
117
images: 
 
118
        make -C html/image_src images
 
119
        
76
120
clean:
77
 
        @rm -f \
78
 
                postgis-out.xml \
79
 
                postgis.aux \
80
 
                postgis.fo \
81
 
                postgis.pdf \
82
 
                postgis.out \
83
 
                postgis.log
 
121
        make -C html/image_src clean
 
122
        @rm -f postgis-out.xml postgis_comments.sql postgis_aggs_mm.xml
84
123
 
85
124
maintainer-clean: clean
86
 
        @rm -f html/*.html
 
125
        make -C html/image_src clean
 
126
        @rm -f html/*.html \
 
127
                postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}.pdf
 
128
 
 
129
comments: postgis_comments.sql
 
130
 
 
131
comments-install: comments
 
132
        cp postgis_comments.sql $(PGSQL_SHAREDIR)/contrib/postgis_comments.sql
 
133
 
 
134
comments-uninstall:
 
135
        rm -f $(PGSQL_SHAREDIR)/contrib/postgis_comments.sql
87
136
 
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
95
144
 
96
145
uninstall:
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
101
 
 
102
 
.PHONY: html 
 
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
 
150
 
 
151
requirements_not_met_xsltproc:
 
152
        @echo
 
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:"
 
156
        @echo
 
157
        @echo "  http://postgis.refractions.net/docs"
 
158
        @echo
 
159
 
 
160
requirements_not_met_xslbase:
 
161
        @echo
 
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:"
 
165
        @echo
 
166
        @echo "  http://postgis.refractions.net/docs"
 
167
        @echo
 
168
 
 
169
requirements_not_met_imagemagick:
 
170
        @echo 
 
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:"
 
174
        @echo
 
175
        @echo "  http://postgis.refractions.net/docs"
 
176
        @echo 
 
177
        
 
178
.PHONY: html
 
179