From 671be61916e7438c9d7ed46a3d14e15c195bb02f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 11 Mar 2001 11:07:01 +0000 Subject: [PATCH] Add uninstall target to Java build. Respect default port setting in JDBC driver. Pick up version number from Makefile.global. Change installation directory to share/java/. Document. --- build.xml | 8 +- contrib/retep/build.xml | 11 ++- doc/src/sgml/jdbc.sgml | 83 +++++++++---------- src/interfaces/jdbc/Makefile | 33 +++++--- src/interfaces/jdbc/build.xml | 18 +++- .../jdbc/org/postgresql/Driver.java.in | 2 +- 6 files changed, 94 insertions(+), 61 deletions(-) diff --git a/build.xml b/build.xml index c7f153018d..daee9f4bf1 100644 --- a/build.xml +++ b/build.xml @@ -12,7 +12,7 @@ detect the presence of both the JDK and ANT, and if both are found to build the jdbc driver and utils with the rest of postgresql. - $Id: build.xml,v 1.2 2001/03/05 09:38:54 peter Exp $ + $Id: build.xml,v 1.3 2001/03/11 11:06:59 petere Exp $ --> @@ -69,6 +69,12 @@ e.g. + + + + + + @@ -56,5 +56,12 @@ - + + + + + + + + diff --git a/doc/src/sgml/jdbc.sgml b/doc/src/sgml/jdbc.sgml index cf7b159dcf..0d02c03967 100644 --- a/doc/src/sgml/jdbc.sgml +++ b/doc/src/sgml/jdbc.sgml @@ -1,5 +1,5 @@ @@ -53,55 +53,49 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.19 2001/02/24 12:40:27 Starting with PostgreSQL version 7.1, - the preferred way to build the JDBC driver is - using Ant, a special tool for building + the JDBC driver is built using + Ant, a special tool for building Java-based packages. You should download - Ant from the Ant - web site and install it before proceeding. - - - - The build the driver, issue the command - -$ ant - - in the top level directory of the - PostgreSQL source distribution. - - - - To install the driver, enter the command - -$ ant -Dinstall.directory=mydir install - - Replace mydir with a directory name of - your choice; the directory will be created if necessary. The - PostgreSQL JDBC - driver consists of a postgresql.jar file that - will be copied to that directory. + Ant from the Ant + web site and install it before proceeding. Precompiled + Ant distributions are typically set up + to read a file .antrc in the current user's + home directory for configuration. For example, to use a different + JDK than the default, this may work: + +JAVA_HOME=/usr/local/sun-jdk1.3 +JAVACMD=$JAVA_HOME/bin/java + - Alternatively, you can use the old make-based - interface. The driver's source is located in the src/interfaces/jdbc directory of the - source tree. To compile, simply change directory to that - directory, and type: + The build the driver, add the option to your + configure command line, e.g., -$ gmake +$ ./configure --prefix=xxx --with-java ... - (Remember to use GNU make.) Upon completion, - you will find the archive postgresql.jar in - the current directory. This is the JDBC driver, - which you can copy to an appropriate directory in your system. + This will build and install the driver along with the rest of the + PostgreSQL package when you issue the + gmake and gmake install + commands. If you only want to build the driver and not the rest + of PostgreSQL, change into the + directory src/interfaces/jdbc and issue the + respective make command there. Refer to the + PostgreSQL installation instructions + for more information about the configuration and build process. - You must not use javac directly, as the - driver uses some dynamic loading techniques for performance - reasons, and javac cannot cope. + Do not try to build by calling javac directly, + as the driver uses some dynamic loading techniques for + performance reasons, and javac cannot cope. + Do not try to run ant directly either, because + some configuration information is communicated through the + makefiles. Running ant directly without + providing these parameters will result in a broken driver. @@ -114,7 +108,12 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.19 2001/02/24 12:40:27 postgresql.jar needs to be included in the class path, either by putting it in the CLASSPATH environment variable, or by using flags on the - java command line. + java command line. By default, the jar archive + is installed in the directory /usr/local/pgsql/share/java. You may + have it in a different directory if you used the + option when you ran + configure. @@ -128,7 +127,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.19 2001/02/24 12:40:27 /usr/local/jdk1.1.6. To run the application, I would use: -export CLASSPATH=/usr/local/lib/finder.jar:/usr/local/lib/postgresql.jar:. +export CLASSPATH=/usr/local/lib/finder.jar:/usr/local/pgsql/share/java/postgresql.jar:. java uk.org.retep.finder.Main diff --git a/src/interfaces/jdbc/Makefile b/src/interfaces/jdbc/Makefile index c88ad68339..cdb9a82e44 100644 --- a/src/interfaces/jdbc/Makefile +++ b/src/interfaces/jdbc/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.27 2001/03/05 09:39:53 peter Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.28 2001/03/11 11:07:00 petere Exp $ # #------------------------------------------------------------------------- @@ -12,17 +12,28 @@ subdir = src/interfaces/jdbc top_builddir = ../../.. include $(top_builddir)/src/Makefile.global -all distprep: - @$(ANT) -buildfile $(top_builddir)/build.xml +majorversion := $(shell echo $(VERSION) | sed 's/^\([0-9][0-9]*\)\..*$$/\1/') +minorversion := $(shell echo $(VERSION) | sed 's/^[0-9][0-9]*\.\([0-9][0-9]*\).*$$/\1/') -install: - @$(ANT) -Dinstall.directory=$(DESTDIR)$(libdir)/java \ - -buildfile $(top_builddir)/build.xml \ - install +properties := -Dmajor=$(majorversion) -Dminor=$(minorversion) \ + -Dfullversion=$(VERSION) \ + -Ddef_pgport=$(DEF_PGPORT) -installdirs uninstall dep depend: - @echo Nothing for JDBC +all: + $(ANT) -buildfile $(top_srcdir)/build.xml $(properties) -clean distclean maintainer-clean: - @$(ANT) -buildfile $(top_builddir)/build.xml clean +install: installdirs + $(ANT) -Dinstall.directory=$(DESTDIR)$(datadir)/java \ + -buildfile $(top_srcdir)/build.xml \ + install $(properties) + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(datadir)/java +uninstall: + $(ANT) -Dinstall.directory=$(DESTDIR)$(datadir)/java \ + -buildfile $(top_srcdir)/build.xml \ + uninstall + +clean distclean maintainer-clean: + $(ANT) -buildfile $(top_srcdir)/build.xml clean diff --git a/src/interfaces/jdbc/build.xml b/src/interfaces/jdbc/build.xml index ef2c45ceb1..54ed714419 100644 --- a/src/interfaces/jdbc/build.xml +++ b/src/interfaces/jdbc/build.xml @@ -3,7 +3,7 @@ build file to allow ant (http://jakarta.apache.org/ant/) to be used to build the PostgreSQL JDBC Driver. - $Id: build.xml,v 1.7 2001/03/05 09:40:01 peter Exp $ + $Id: build.xml,v 1.8 2001/03/11 11:07:00 petere Exp $ --> @@ -14,8 +14,6 @@ - - - + + @@ -153,6 +152,17 @@ + + + + + + + + + diff --git a/src/interfaces/jdbc/org/postgresql/Driver.java.in b/src/interfaces/jdbc/org/postgresql/Driver.java.in index d7452c6752..5d64a3f579 100644 --- a/src/interfaces/jdbc/org/postgresql/Driver.java.in +++ b/src/interfaces/jdbc/org/postgresql/Driver.java.in @@ -351,7 +351,7 @@ public class Driver implements java.sql.Driver */ public int port() { - return Integer.parseInt(props.getProperty("PGPORT","5432")); + return Integer.parseInt(props.getProperty("PGPORT","@DEF_PGPORT@")); } /** -- 2.40.0