@ -4,16 +4,17 @@
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/doc/Makefile,v 1.20 2000/12/26 20:47:07 petere Exp $
# $Header: /cvsroot/pgsql/doc/Makefile,v 1.21 2001/08/29 19:14:39 petere Exp $
#
#----------------------------------------------------------------------------
# This directory doesn't build anything, it is only responsible for
# installing the documenation. It is invoked automatically by the
# top-level makefile. The files to be installed are prepared specially
# and are placed in this directory during distribution bundling. In
# CVS-based trees these files don't exist, so we skip the installation
# in that case.
# This makefile is responsible for installing the documentation. The
# files to be installed are prepared specially and are placed in this
# directory during distribution bundling. In CVS-based trees these
# files don't exist, so we skip the installation in that case.
#
# Before we install the man pages, we massage the section numbers to
# follow the local conventions.
#
# To actually build the documenation, look into the src/ and src/sgml
# subdirectories.
@ -22,17 +23,47 @@ subdir = doc
top_builddir = ..
i n c l u d e $( top_builddir ) / s r c / M a k e f i l e . g l o b a l
.NOTPARALLEL :
i f n e q ( $( wildcard $ ( srcdir ) /postgres .tar .gz ) , )
found_html := yes
e n d i f
i f n e q ( $( wildcard $ ( srcdir ) /man .tar .gz ) , )
# SCO OpenServer's man system is sufficiently different to not bother.
i f n e q ( $( PORTNAME ) , s c o )
found_man := yes
e n d i f
e n d i f
i f d e f f o u n d _ m a n
i f n d e f s q l m a n s e c t
sqlmansect = 7
e n d i f
sqlmansectnum = $( shell expr X'$(sqlmansect)' : X'\([0-9]\)' )
all : man 1/.timestamp man $( sqlmansectnum ) /.timestamp
man1/.timestamp man$(sqlmansect_dummy)/.timestamp : man .tar .gz
gzip -d -c $< | $( TAR) xf -
for file in man1/*.1; do \
mv $$ file $$ file.bak && \
sed -e 's/\\fR($(sqlmansect_dummy))/\\fR($(sqlmansectnum))/' $$ file.bak >$$ file && \
rm $$ file.bak || exit; \
done
@echo timestamp >man1/.timestamp
@echo timestamp >man$( sqlmansect_dummy) /.timestamp
all :
man$(sqlmansectnum)/.timestamp : man $( sqlmansect_dummy ) /.timestamp
$( mkinstalldirs) man$( sqlmansectnum)
for file in man$( sqlmansect_dummy) /*.$( sqlmansect_dummy) ; do \
sed -e '/^\.TH/s/"$(sqlmansect_dummy)"/"$(sqlmansect)"/' \
-e 's/\\fR($(sqlmansect_dummy))/\\fR($(sqlmansectnum))/' \
$$ file >man$( sqlmansectnum) /` basename $$ file | sed 's/.$(sqlmansect_dummy)$$/.$(sqlmansect)/' ` || exit; \
done
@echo timestamp >$@
e n d i f # found_man
install : all installdirs
@ -40,12 +71,19 @@ ifdef found_html
gzip -d -c postgres.tar.gz | ( cd $( DESTDIR) $( docdir) /html && $( TAR) xf - )
e n d i f
i f d e f f o u n d _ m a n
gzip -d -c man.tar.gz | ( cd $( DESTDIR) $( mandir) && $( TAR) xf - )
for file in man1/*.1 man$( sqlmansectnum) /*.$( sqlmansect) ; do \
$( INSTALL_DATA) $$ file $( DESTDIR) $( mandir) /$$ file || exit; \
done
e n d i f
installdirs :
$( mkinstalldirs) $( DESTDIR) $( mandir) $( DESTDIR) $( docdir) /html
i f d e f f o u n d _ h t m l
$( mkinstalldirs) $( DESTDIR) $( docdir) /html
e n d i f
i f d e f f o u n d _ m a n
$( mkinstalldirs) $( addprefix $( DESTDIR) $( mandir) /man, 1 $( sqlmansectnum) )
e n d i f
uninstall :
@ -53,5 +91,11 @@ ifdef found_html
-rm -f $( addprefix $( DESTDIR) $( docdir) /html/, $( shell gunzip -c $( srcdir) /postgres.tar.gz | tar tf -) )
e n d i f
i f d e f f o u n d _ m a n
-rm -f $( addprefix $( DESTDIR) $( mandir) /, $( shell gunzip -c $( srcdir) /man.tar.gz | tar tf -) )
-rm -f $( addprefix $( DESTDIR) $( mandir) /, $( shell gunzip -c $( srcdir) /man.tar.gz | tar tf - | sed -e 's,man$(sqlmansect_dummy)/,man$(sqlmansectnum)/,' -e 's/.$(sqlmansect_dummy)$$/.$(sqlmansect)/' ) )
e n d i f
clean :
rm -rf man1/ man$( sqlmansectnum) / man$( sqlmansect_dummy) /
distclean maintainer-clean : clean