These are the follow-up patches to Peter Mount's recent Java build improvements. * implement 'make uninstall' for the java directories * pick up the version information from Makefile.global * honour the default port as specified to configure * allow building outside the source tree (This doesn't actually work, because Ant always puts the build dir relative to the source dir, but at least the whole thing will proceed smoothly when the rest of the tree builds this way.) I'd install these patches soon unless someone objects. -- Peter Eisentraut [EMAIL PROTECTED] http://yi.org/peter-e/
Index: build.xml =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/build.xml,v retrieving revision 1.2 diff -u -r1.2 build.xml --- build.xml 2001/03/05 09:38:54 1.2 +++ build.xml 2001/03/09 22:24:15 @@ -69,6 +69,12 @@ </antcall> </target> + <target name="uninstall" if="install.directory"> + <antcall target="call"> + <param name="target" value="uninstall" /> + </antcall> + </target> + <!-- This actually calls the other two build.xml files. To use it, use the <antcall> tag, and pass the destination target Index: contrib/retep/build.xml =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/contrib/retep/build.xml,v retrieving revision 1.3 diff -u -r1.3 build.xml --- contrib/retep/build.xml 2001/03/05 09:15:35 1.3 +++ contrib/retep/build.xml 2001/03/09 22:24:16 @@ -56,5 +56,12 @@ </copy> </target> -</project> + <target name="uninstall" if="install.directory"> + <delete> + <fileset dir="${install.directory}"> + <include name="**/*.jar" /> + </fileset> + </delete> + </target> +</project> Index: src/interfaces/jdbc/Makefile =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/jdbc/Makefile,v retrieving revision 1.27 diff -u -r1.27 Makefile --- src/interfaces/jdbc/Makefile 2001/03/05 09:39:53 1.27 +++ src/interfaces/jdbc/Makefile 2001/03/09 22:24:22 @@ -12,17 +12,28 @@ 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 Index: src/interfaces/jdbc/build.xml =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/jdbc/build.xml,v retrieving revision 1.7 diff -u -r1.7 build.xml --- src/interfaces/jdbc/build.xml 2001/03/05 09:40:01 1.7 +++ src/interfaces/jdbc/build.xml 2001/03/09 22:24:22 @@ -14,8 +14,6 @@ <property name="jars" value="jars" /> <property name="dest" value="build" /> <property name="package" value="org/postgresql" /> - <property name="major" value="7" /> - <property name="minor" value="1" /> <!-- defaults for the tests - overide these if required @@ -68,8 +66,9 @@ <!-- Some defaults --> <filter token="MAJORVERSION" value="${major}" /> <filter token="MINORVERSION" value="${minor}" /> - <filter token="VERSION" value="PostgreSQL ${major}.${minor} ${edition}" /> + <filter token="VERSION" value="PostgreSQL ${fullversion} ${edition}" /> <filter token="JDBCCONNECTCLASS" value="${connectclass}" /> + <filter token="DEF_PGPORT" value="${def_pgport}" /> <!-- Put a check for the current version here --> @@ -151,6 +150,17 @@ <include name="**/*.jar" /> </fileset> </copy> + </target> + + <!-- + Uninstall the jar file. + --> + <target name="uninstall" if="install.directory"> + <delete> + <fileset dir="${install.directory}"> + <include name="**/*.jar" /> + </fileset> + </delete> </target> <!-- Index: src/interfaces/jdbc/org/postgresql/Driver.java.in =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Driver.java.in,v retrieving revision 1.4 diff -u -r1.4 Driver.java.in --- src/interfaces/jdbc/org/postgresql/Driver.java.in 2001/03/05 09:17:43 1.4 +++ src/interfaces/jdbc/org/postgresql/Driver.java.in 2001/03/09 22:24:23 @@ -351,7 +351,7 @@ */ public int port() { - return Integer.parseInt(props.getProperty("PGPORT","5432")); + return Integer.parseInt(props.getProperty("PGPORT","@DEF_PGPORT@")); } /**
---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster