Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit671be61

Browse files
committed
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.
1 parent9c2c9fc commit671be61

File tree

6 files changed

+94
-61
lines changed

6 files changed

+94
-61
lines changed

‎build.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
detect the presence of both the JDK and ANT, and if both are found
1313
to build the jdbc driver and utils with the rest of postgresql.
1414
15-
$Id: build.xml,v 1.2 2001/03/05 09:38:54 peter Exp $
15+
$Id: build.xml,v 1.3 2001/03/11 11:06:59 petere Exp $
1616
1717
-->
1818

@@ -69,6 +69,12 @@ e.g.
6969
</antcall>
7070
</target>
7171

72+
<targetname="uninstall"if="install.directory">
73+
<antcalltarget="call">
74+
<paramname="target"value="uninstall" />
75+
</antcall>
76+
</target>
77+
7278
<!--
7379
This actually calls the other two build.xml files.
7480
To use it, use the <antcall> tag, and pass the destination target

‎contrib/retep/build.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
build file to build the donated retep tools packages
44
5-
$Id: build.xml,v 1.3 2001/03/05 09:15:35 peter Exp $
5+
$Id: build.xml,v 1.4 2001/03/11 11:06:59 petere Exp $
66
77
-->
88

@@ -56,5 +56,12 @@
5656
</copy>
5757
</target>
5858

59-
</project>
59+
<targetname="uninstall"if="install.directory">
60+
<delete>
61+
<filesetdir="${install.directory}">
62+
<includename="**/*.jar" />
63+
</fileset>
64+
</delete>
65+
</target>
6066

67+
</project>

‎doc/src/sgml/jdbc.sgml

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.19 2001/02/24 12:40:27 petere Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.20 2001/03/11 11:06:59 petere Exp $
33
-->
44

55
<chapter id="jdbc">
@@ -53,55 +53,49 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.19 2001/02/24 12:40:27
5353

5454
<para>
5555
Starting with <productname>PostgreSQL</productname> version 7.1,
56-
thepreferred way to build the<acronym>JDBC</acronym> driver is
57-
using <productname>Ant</productname>, a special tool for building
56+
the <acronym>JDBC</acronym> driver is built using
57+
<application>Ant</application>, a special tool for building
5858
Java-based packages. You should download
59-
<productname>Ant</productname> from the <ulink
60-
url="http://jakarta.apache.org/ant/index.html"><productname>Ant</productname>
61-
web site</ulink> and install it before proceeding.
62-
</para>
63-
64-
<para>
65-
The build the driver, issue the command
66-
<screen>
67-
<prompt>$</prompt> <userinput>ant</userinput>
68-
</screen>
69-
in the top level directory of the
70-
<productname>PostgreSQL</productname> source distribution.
71-
</para>
72-
73-
<para>
74-
To install the driver, enter the command
75-
<screen>
76-
<prompt>$</prompt> <userinput>ant -Dinstall.directory=<replaceable>mydir</replaceable> install</userinput>
77-
</screen>
78-
Replace <replaceable>mydir</replaceable> with a directory name of
79-
your choice; the directory will be created if necessary. The
80-
<productname>PostgreSQL</productname> <acronym>JDBC</acronym>
81-
driver consists of a <filename>postgresql.jar</filename> file that
82-
will be copied to that directory.
59+
<application>Ant</application> from the <ulink
60+
url="http://jakarta.apache.org/ant/index.html"><application>Ant</application>
61+
web site</ulink> and install it before proceeding. Precompiled
62+
<application>Ant</application> distributions are typically set up
63+
to read a file <filename>.antrc</filename> in the current user's
64+
home directory for configuration. For example, to use a different
65+
<acronym>JDK</acronym> than the default, this may work:
66+
<programlisting>
67+
JAVA_HOME=/usr/local/sun-jdk1.3
68+
JAVACMD=$JAVA_HOME/bin/java
69+
</programlisting>
8370
</para>
8471

8572
<para>
86-
Alternatively, you can use the old <command>make</command>-based
87-
interface. The driver's source is located in the <filename
88-
class="directory">src/interfaces/jdbc</filename> directory of the
89-
source tree. To compile, simply change directory to that
90-
directory, and type:
73+
The build the driver, add the <option>--with-java</option> option to your
74+
<filename>configure</filename> command line, e.g.,
9175
<screen>
92-
<prompt>$</prompt> <userinput>gmake</userinput>
76+
<prompt>$</prompt> <userinput>./configure --prefix=<replaceable>xxx</replaceable> --with-java ...</userinput>
9377
</screen>
94-
(Remember to use <acronym>GNU</acronym> make.) Upon completion,
95-
you will find the archive <filename>postgresql.jar</filename> in
96-
the current directory. This is the <acronym>JDBC</acronym> driver,
97-
which you can copy to an appropriate directory in your system.
78+
This will build and install the driver along with the rest of the
79+
<productname>PostgreSQL</productname> package when you issue the
80+
<literal>gmake</literal> and <literal>gmake install</literal>
81+
commands. If you only want to build the driver and not the rest
82+
of <productname>PostgreSQL</productname>, change into the
83+
directory <filename
84+
class="directory">src/interfaces/jdbc</filename> and issue the
85+
respective <literal>make</literal> command there. Refer to the
86+
<productname>PostgreSQL</productname> installation instructions
87+
for more information about the configuration and build process.
9888
</para>
9989

10090
<note>
10191
<para>
102-
You must not use <command>javac</command> directly, as the
103-
driver uses some dynamic loading techniques for performance
104-
reasons, and <command>javac</command> cannot cope.
92+
Do not try to build by calling <command>javac</command> directly,
93+
as the driver uses some dynamic loading techniques for
94+
performance reasons, and <command>javac</command> cannot cope.
95+
Do not try to run <command>ant</command> directly either, because
96+
some configuration information is communicated through the
97+
makefiles. Running <command>ant</command> directly without
98+
providing these parameters will result in a broken driver.
10599
</para>
106100
</note>
107101
</sect2>
@@ -114,7 +108,12 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.19 2001/02/24 12:40:27
114108
<filename>postgresql.jar</filename> needs to be included in the
115109
class path, either by putting it in the <envar>CLASSPATH</envar>
116110
environment variable, or by using flags on the
117-
<command>java</command> command line.
111+
<command>java</command> command line. By default, the jar archive
112+
is installed in the directory <filename
113+
class="directory">/usr/local/pgsql/share/java</filename>. You may
114+
have it in a different directory if you used the
115+
<option>--prefix</option> option when you ran
116+
<filename>configure</filename>.
118117
</para>
119118

120119
<informalexample>
@@ -128,7 +127,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.19 2001/02/24 12:40:27
128127
<filename>/usr/local/jdk1.1.6</filename>. To run the
129128
application, I would use:
130129
<programlisting>
131-
export CLASSPATH=/usr/local/lib/finder.jar<co id="co.jdbc-finder">:/usr/local/lib/postgresql.jar:.
130+
export CLASSPATH=/usr/local/lib/finder.jar<co id="co.jdbc-finder">:/usr/local/pgsql/share/java/postgresql.jar:.
132131
java uk.org.retep.finder.Main
133132
</programlisting>
134133
<calloutlist>

‎src/interfaces/jdbc/Makefile

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,36 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.27 2001/03/05 09:39:53 peter Exp $
7+
# $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.28 2001/03/11 11:07:00 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

1111
subdir = src/interfaces/jdbc
1212
top_builddir = ../../..
1313
include$(top_builddir)/src/Makefile.global
1414

15-
alldistprep:
16-
@$(ANT) -buildfile$(top_builddir)/build.xml
15+
majorversion :=$(shell echo$(VERSION) | sed 's/^\([0-9][0-9]*\)\..*$$/\1/')
16+
minorversion :=$(shell echo$(VERSION) | sed 's/^[0-9][0-9]*\.\([0-9][0-9]*\).*$$/\1/')
1717

18-
install:
19-
@$(ANT) -Dinstall.directory=$(DESTDIR)$(libdir)/java\
20-
-buildfile$(top_builddir)/build.xml\
21-
install
18+
properties := -Dmajor=$(majorversion) -Dminor=$(minorversion)\
19+
-Dfullversion=$(VERSION)\
20+
-Ddef_pgport=$(DEF_PGPORT)
2221

23-
installdirsuninstalldepdepend:
24-
@echo Nothingfor JDBC
22+
all:
23+
$(ANT) -buildfile$(top_srcdir)/build.xml$(properties)
2524

26-
cleandistcleanmaintainer-clean:
27-
@$(ANT) -buildfile$(top_builddir)/build.xml clean
25+
install: installdirs
26+
$(ANT) -Dinstall.directory=$(DESTDIR)$(datadir)/java\
27+
-buildfile$(top_srcdir)/build.xml\
28+
install$(properties)
29+
30+
installdirs:
31+
$(mkinstalldirs)$(DESTDIR)$(datadir)/java
2832

33+
uninstall:
34+
$(ANT) -Dinstall.directory=$(DESTDIR)$(datadir)/java\
35+
-buildfile$(top_srcdir)/build.xml\
36+
uninstall
37+
38+
cleandistcleanmaintainer-clean:
39+
$(ANT) -buildfile$(top_srcdir)/build.xml clean

‎src/interfaces/jdbc/build.xml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
build file to allow ant (http://jakarta.apache.org/ant/) to be used
44
to build the PostgreSQL JDBC Driver.
55
6-
$Id: build.xml,v 1.7 2001/03/05 09:40:01 peter Exp $
6+
$Id: build.xml,v 1.8 2001/03/11 11:07:00 petere Exp $
77
88
-->
99

@@ -14,8 +14,6 @@
1414
<propertyname="jars"value="jars" />
1515
<propertyname="dest"value="build" />
1616
<propertyname="package"value="org/postgresql" />
17-
<propertyname="major"value="7" />
18-
<propertyname="minor"value="1" />
1917

2018
<!--
2119
defaults for the tests - overide these if required
@@ -68,8 +66,9 @@
6866
<!-- Some defaults-->
6967
<filtertoken="MAJORVERSION"value="${major}" />
7068
<filtertoken="MINORVERSION"value="${minor}" />
71-
<filtertoken="VERSION"value="PostgreSQL${major}.${minor}${edition}" />
69+
<filtertoken="VERSION"value="PostgreSQL${fullversion}${edition}" />
7270
<filtertoken="JDBCCONNECTCLASS"value="${connectclass}" />
71+
<filtertoken="DEF_PGPORT"value="${def_pgport}" />
7372

7473
<!-- Put a check for the current version here-->
7574

@@ -153,6 +152,17 @@
153152
</copy>
154153
</target>
155154

155+
<!--
156+
Uninstall the jar file.
157+
-->
158+
<targetname="uninstall"if="install.directory">
159+
<delete>
160+
<filesetdir="${install.directory}">
161+
<includename="**/*.jar" />
162+
</fileset>
163+
</delete>
164+
</target>
165+
156166
<!--
157167
This compiles and executes the JUnit tests
158168
-->

‎src/interfaces/jdbc/org/postgresql/Driver.java.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public class Driver implements java.sql.Driver
351351
*/
352352
public int port()
353353
{
354-
return Integer.parseInt(props.getProperty("PGPORT","5432"));
354+
return Integer.parseInt(props.getProperty("PGPORT","@DEF_PGPORT@"));
355355
}
356356

357357
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp