From 71fa85a084547e308d399f5a8fd90830718eceae Mon Sep 17 00:00:00 2001 From: rbt Date: Fri, 7 Aug 2009 02:48:26 +0000 Subject: [PATCH] Add a manpage for PostgreSQL Autodoc (Tim Retout) It always installs at the moment (BSD Port won't like that). --- Makefile | 16 ++++++++-- postgresql_autodoc.1.in | 66 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 postgresql_autodoc.1.in diff --git a/Makefile b/Makefile index f67043d..fd95bf3 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,19 @@ -# $Header: /cvsroot/autodoc/autodoc/Makefile,v 1.7 2009/05/01 02:31:10 rbt Exp $ +# $Header: /cvsroot/autodoc/autodoc/Makefile,v 1.8 2009/08/07 02:48:26 rbt Exp $ # install configuration DESTDIR = PREFIX = /usr/local BINDIR = ${PREFIX}/bin DATADIR = ${PREFIX}/share/postgresql_autodoc +MANDIR = ${PREFIX}/share/man/man1 # build configuration TEMPLATES = dia.tmpl dot.tmpl html.tmpl neato.tmpl xml.tmpl zigzag.dia.tmpl BINARY = postgresql_autodoc SOURCE = ${BINARY}.pl +MANPAGE = ${BINARY}.1 +MANPAGE_SOURCE = ${MANPAGE}.in RELEASE_FILES = Makefile ChangeLog ${SOURCE} ${TEMPLATES} RELEASE_DIR=postgresql_autodoc @@ -20,7 +23,12 @@ PERL = $$(which perl) SED = $$(which sed) -all: ${BINARY} +all: ${BINARY} ${MANPAGE} + +${MANPAGE}: ${MANPAGE_SOURCE} + ${SED} -e "s,@@TEMPLATE-DIR@@,${DATADIR}," \ + ${MANPAGE_SOURCE} > ${MANPAGE} + ${BINARY}: ${SOURCE} ${SED} -e "s,/usr/bin/env perl,${PERL}," \ @@ -31,16 +39,20 @@ ${BINARY}: ${SOURCE} install: all ${INSTALL_SCRIPT} -d ${DESTDIR}${BINDIR} ${INSTALL_SCRIPT} -d ${DESTDIR}${DATADIR} + ${INSTALL_SCRIPT} -d ${DESTDIR}${MANDIR} ${INSTALL_SCRIPT} -m 755 ${BINARY} ${DESTDIR}${BINDIR} for entry in ${TEMPLATES} ; \ do ${INSTALL_SCRIPT} -m 644 $${entry} ${DESTDIR}${DATADIR} ; \ done + ${INSTALL_SCRIPT} ${MANPAGE} ${DESTDIR}${MANDIR} uninstall: -rm ${DESTDIR}${BINDIR}/${BINARY} -for entry in ${TEMPLATES} ; \ do rm ${DESTDIR}${DATADIR}/$${entry} ; \ done + -rm ${DESTDIR}${MANDIR}/${MANPAGE} + -rmdir ${DESTDIR}${MANDIR} -rmdir ${DESTDIR}${DATADIR} -rmdir ${DESTDIR}${BINDIR} diff --git a/postgresql_autodoc.1.in b/postgresql_autodoc.1.in new file mode 100644 index 0000000..82dd7bf --- /dev/null +++ b/postgresql_autodoc.1.in @@ -0,0 +1,66 @@ +.TH POSTGRESQL_AUTODOC 1 "19 July 2009" +.SH NAME +postgresql_autodoc \- creates postgresql tables overview +.SH SYNOPSIS +.B postgresql_autodoc +[options] +.SH DESCRIPTION +This is a utility which will run through PostgreSQL system tables and +returns HTML, DOT, and 2 styles of XML which describes the database. +.PP +The HTML is human readable (via webbrowser). The first style of XML is +actually the fileformat of Dia, a UML diagram tool. The second type of +XML is similar to the HTML but in the Docbook 4 format. It enables yous +to mix in other docbook documentation via the XREFs, generating PDFs, +HTML, RTF, or other formatted documents. Between these tools and JavaDoc +with the appropriate XREFs, documentation about a project can be generated +quickly and be easily updatable yet have a very professional look with +some DSSSL work. +.SH OPTIONS +.TP +.B \-d +Specify database name to connect to (default: current user) +.TP +.B \-f +Specify output file prefix (default: current user) +.TP +.B \-h +Specify database server host (default: localhost) +.TP +.B \-p +Specify database server port (default: 5432) +.TP +.B \-u +Specify database username (default: current user) +.TP +.B \-\-password= +Specify database password (default: blank) + +If no password is specified, one is prompted for. +.TP +.B \-l +Path to the templates (default: @@TEMPLATE-DIR@@) +.TP +.B \-t +Type of output wanted (default: All in template library) +.TP +.B \-s +Specify a specific schema to match. Technically this is a +regular expression but anything other than a specific name +may have unusual results. +.TP +.B \-m +Show only tables/objects with names matching the specified regular +expression. +.TP +.B \-\-table= +Tables to export. Multiple tables may be provided using a +comma-separated list, i.e. table,table2,table3. +.TP +.B \-\-statistics +In 7.4 and later, with the contrib module pgstattuple installed we +can gather statistics on the tables in the database +(average size, free space, disk space used, dead tuple counts, etc.) +This is disk intensive on large databases as all pages must be visited. +.SH AUTHOR +Rod Taylor -- 2.40.0