-# $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
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}," \
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}
--- /dev/null
+.TH POSTGRESQL_AUTODOC 1 "19 July 2009"\r
+.SH NAME\r
+postgresql_autodoc \- creates postgresql tables overview\r
+.SH SYNOPSIS\r
+.B postgresql_autodoc\r
+[options]\r
+.SH DESCRIPTION\r
+This is a utility which will run through PostgreSQL system tables and\r
+returns HTML, DOT, and 2 styles of XML which describes the database.\r
+.PP\r
+The HTML is human readable (via webbrowser). The first style of XML is\r
+actually the fileformat of Dia, a UML diagram tool. The second type of\r
+XML is similar to the HTML but in the Docbook 4 format. It enables yous\r
+to mix in other docbook documentation via the XREFs, generating PDFs,\r
+HTML, RTF, or other formatted documents. Between these tools and JavaDoc\r
+with the appropriate XREFs, documentation about a project can be generated\r
+quickly and be easily updatable yet have a very professional look with\r
+some DSSSL work.\r
+.SH OPTIONS\r
+.TP\r
+.B \-d <dbname>\r
+Specify database name to connect to (default: current user)\r
+.TP\r
+.B \-f <file> \r
+Specify output file prefix (default: current user)\r
+.TP\r
+.B \-h <host> \r
+Specify database server host (default: localhost)\r
+.TP\r
+.B \-p <port> \r
+Specify database server port (default: 5432)\r
+.TP\r
+.B \-u <username>\r
+Specify database username (default: current user)\r
+.TP\r
+.B \-\-password=<pw>\r
+Specify database password (default: blank)\r
+\r
+If no password is specified, one is prompted for.\r
+.TP\r
+.B \-l <path>\r
+Path to the templates (default: @@TEMPLATE-DIR@@)\r
+.TP\r
+.B \-t <output>\r
+Type of output wanted (default: All in template library)\r
+.TP\r
+.B \-s <schema> \r
+Specify a specific schema to match. Technically this is a\r
+regular expression but anything other than a specific name\r
+may have unusual results.\r
+.TP\r
+.B \-m <regexp>\r
+Show only tables/objects with names matching the specified regular\r
+expression.\r
+.TP\r
+.B \-\-table=<args>\r
+Tables to export. Multiple tables may be provided using a\r
+comma-separated list, i.e. table,table2,table3.\r
+.TP\r
+.B \-\-statistics\r
+In 7.4 and later, with the contrib module pgstattuple installed we\r
+can gather statistics on the tables in the database\r
+(average size, free space, disk space used, dead tuple counts, etc.)\r
+This is disk intensive on large databases as all pages must be visited.\r
+.SH AUTHOR\r
+Rod Taylor <autodoc@rbt.ca>\r