summaryrefslogtreecommitdiff
path: root/dev-java/jdbc-postgresql
diff options
context:
space:
mode:
Diffstat (limited to 'dev-java/jdbc-postgresql')
-rw-r--r--dev-java/jdbc-postgresql/Manifest15
-rw-r--r--dev-java/jdbc-postgresql/files/jdbc-postgresql-9.4_p1201-remove-osgi.patch37
-rw-r--r--dev-java/jdbc-postgresql/files/jdbc-postgresql-9.4_p1204-remove-sspi.patch138
-rw-r--r--dev-java/jdbc-postgresql/jdbc-postgresql-9.2_p1003.ebuild78
-rw-r--r--dev-java/jdbc-postgresql/jdbc-postgresql-9.2_p1004.ebuild78
-rw-r--r--dev-java/jdbc-postgresql/jdbc-postgresql-9.3_p1100.ebuild78
-rw-r--r--dev-java/jdbc-postgresql/jdbc-postgresql-9.4_p1205.ebuild102
-rw-r--r--dev-java/jdbc-postgresql/jdbc-postgresql-9.4_p1206.ebuild102
-rw-r--r--dev-java/jdbc-postgresql/metadata.xml8
9 files changed, 636 insertions, 0 deletions
diff --git a/dev-java/jdbc-postgresql/Manifest b/dev-java/jdbc-postgresql/Manifest
new file mode 100644
index 000000000000..c340d05b18c0
--- /dev/null
+++ b/dev-java/jdbc-postgresql/Manifest
@@ -0,0 +1,15 @@
+AUX jdbc-postgresql-9.4_p1201-remove-osgi.patch 1629 SHA256 cfe41a3ad3727a513ce2fab910b4ee3b9cb071bfe732fa40f21f1ca3b9e15231 SHA512 dcb831f6828980b5ada1158cb80c2e5c8d6921b24b69cd0f40faec9b8d41bdaa468ca995e4a804282b816ab8b0120e371e5f21a2aff7fee6068f13affc6b097a WHIRLPOOL 5e319d73f9676ed44130f035780e0ddf8c469cb96f0b7eac14db7759295ad4cc5f7732f791b5e0442267e0a552c763248020c2c7e92bb11eebb82c911336eca8
+AUX jdbc-postgresql-9.4_p1204-remove-sspi.patch 6853 SHA256 c870ab7feaa09d0848a9047b6db44d7e3e98d2534af47ba6ebc2f0148192edfd SHA512 17d6a1514fc824008c8f0464c4af30d038a379ade44120dc24d8f9a4f495393c6e75e82f8e9da1e51c6d22c2301ec83a842d0db6e22842661b4dda97b8335dc6 WHIRLPOOL a2d832c729f809e294ee47c995d6f1a035e33deaede374c00bb3316fd98979e1de05f6daf64391f80c2cda1d6aeee7b25ca5ee1783549a22d7da02f2ad513b2f
+DIST postgresql-jdbc-9.2-1003.src.tar.gz 1843082 SHA256 d61449b8a17ce540b26437382c33a59a49a94c578c943fccf91139ee06478968 SHA512 f91d9617726722998a51275c625f6ea89dfe0ac7ce415cc6fa76302b13762bcf825cd61ec69d25d0199ca21de8a24286eeffb843ad59c06fd3049a289ac2b702 WHIRLPOOL a7994d7ce38bd17e9353339d2838601a22328c8eff03baa122663526ef2c0c2afa8b16d9c93ea9fbff7a756612cddffef41ec00552640766acc5e1fbe4996282
+DIST postgresql-jdbc-9.2-1004.src.tar.gz 1842921 SHA256 eeadff0d830cd19a4f52a9489748a7126b0c1d4863bf9a5d65618158dfc6ae68 SHA512 6e218b7df3d772e4fb9053672f5f77f6012fe6e652a536dfe171408e957465520b05994d4fa13c4d478b595a55b8068da663b9f3dcb544a46fcf91d71ba8fdf5 WHIRLPOOL f1afa3201fbaaf47edb0224d3263642b3202fbf6fc922318354db86e394f0005611b0981da043a4e14cbb67224ac8fa6d96880e0763fcd4d5b502423c7eaa0c7
+DIST postgresql-jdbc-9.3-1100.src.tar.gz 1852465 SHA256 e6be53d4cda04735f5f147d2296acb9a22630b062fa3a4ef894073f23efc6d55 SHA512 43968a62f9443739721016ede186b2f41fa6db2d1ef319cd65059f8715e90eda7c7f568995b293578c39e04d43085cfdfece587500f99ed1a49964c12d8c747a WHIRLPOOL 9bf218936a00df00fb4b4f6ed6c3bbe06cdcfcd14d306a4f7bf3073e83f1c51bc85c0a061c2e04790bcebf9183b8aabd056522fa5d18b0734a4aec34b3ab14a0
+DIST postgresql-jdbc-9.4-1205.src.tar.gz 2028968 SHA256 bb06d9d94ce1f873df4f6090b26f8d2bb358601f71ba1fbdb782bb58a1164366 SHA512 ebb46c0cfcabc34083e6f481bc97536fba98d082462670d39efdd75e6463f1286db6fa07cd35546c749e456f1c06fb1d022cbc9f5cace2a1b968fab76a57d281 WHIRLPOOL a501cb12486ea1903442aa15c03ba7e9f5b127d3e1aa0d90991f6ded517b4dc792488431cf2047efe1a3ac8652ff527d810e1138235a4353cf5cd44031d2b641
+DIST postgresql-jdbc-9.4-1206.src.tar.gz 2029837 SHA256 2793d89eb87f913f82af0898fbb17c2d1b64c4b39a444fe19fe621cb5f11fc80 SHA512 b16816f1afd3ee5986fca197bd7608c2e2f334054e41a8c541c47985827f4f59d7691d23983bdac01c85fc364cd001c991ac6b4e8567429b9d1f4161388dd6bd WHIRLPOOL 0729913fd98088c4f8caeafbb519b45ac673cdb9ff1342f0a1146a2dc87d0c530385089c80c498d416d6601151e00d863831be22b570c3c19070ba3f1ea3ff73
+EBUILD jdbc-postgresql-9.2_p1003.ebuild 1952 SHA256 04a42f061b711b0600085092114fc8fd2466f15754c65ee1749adcd113f2dd23 SHA512 96b02628ac725712fc9cef2fd8769c2efe6f44fe676f8069d9c2973725969f49615f028f7f5ba7d0bc8f92fe04eabd08c96cb4995cc5a27e7c3f7a1c73d9a19c WHIRLPOOL 1d93e4e0dc171cf093eb7b2c02f743b44acc9f092f9a746efe791ad2caf02dfebf82630a9c60505f9369fadb6f326a20be0ee72a8913b9607f05a62f1145bc3a
+EBUILD jdbc-postgresql-9.2_p1004.ebuild 1955 SHA256 8361e4d3d459a9d53871b7e9e104847dfee31a50e5b9115274d765cea3658b06 SHA512 bce895daf8e33e08f8240fce8ddf0755cfdb76af71a9157681504d4ff4ac560af34164dad3a195f91f808f635dadbe7627ee2c28f37be8337ef740151a5efcf0 WHIRLPOOL a42f9bad01158db345b8548bcb355123789afdc6bd0e4e6feb8837786aa692ff449b5c3250d4671fa7ad55759a2582f1b741b52835b667518cb91f3aa9ff745c
+EBUILD jdbc-postgresql-9.3_p1100.ebuild 1955 SHA256 8361e4d3d459a9d53871b7e9e104847dfee31a50e5b9115274d765cea3658b06 SHA512 bce895daf8e33e08f8240fce8ddf0755cfdb76af71a9157681504d4ff4ac560af34164dad3a195f91f808f635dadbe7627ee2c28f37be8337ef740151a5efcf0 WHIRLPOOL a42f9bad01158db345b8548bcb355123789afdc6bd0e4e6feb8837786aa692ff449b5c3250d4671fa7ad55759a2582f1b741b52835b667518cb91f3aa9ff745c
+EBUILD jdbc-postgresql-9.4_p1205.ebuild 3125 SHA256 bb712c03104d4fcf6e9ff3820db45b2adc54ce8f0745c48fa3dbcdfc513407a5 SHA512 8fe2eee869e0d58c98e2fb55e2ecb7b362e0e88f7f1c40ec696def253fa49a4dd7c2b6357321abb111f64349508fe7ac395613b4ddf2e7378acc58edf2130bf4 WHIRLPOOL dc1cdb65d8c24c55d94c546a6a9610f0b68a5d1318c9f2eb7c76ea6e1717d7897894ad209a81e112e30ee51b30195b3a3e535de41a60e3aa5357283a443d5363
+EBUILD jdbc-postgresql-9.4_p1206.ebuild 3122 SHA256 29e56de6c31600950aebf51b9edcd53690d87e48c3a38ce8f070b16c1129226f SHA512 48debfc40a905a1cdcd041a6cc501c040491105ded4cdd49d898f4e6f25cae15b6f12f93cd60f36516b01e690646ccae093e983c74d69f6a68907bc0605092e7 WHIRLPOOL 59991b4c1142e2689ebc993b1c4c3c17f00cfb7a7b20cc22431103a83b7e58828766c200c0796c8587001e5e06bf5cabd38a27074c6b991a479699cb3b301c3e
+MISC ChangeLog 6114 SHA256 2595c21c22beec81cd70396222cbbf792c797edb5a417abd23ddc8404a8d6620 SHA512 b0b074b1686b7a724c1340ff71c22d55aed3d17c78ecff28ece1ad31a5d11da16de1318a48bf7675b2c0fcad5e3ea9dc362f899623ac029ee3f50c88d217668c WHIRLPOOL b5b9445bc8dc256169a076f8c53ca7ab99df994b66b5557d186de33bb5dde77399320851612bed04bd8999d1e084e0c151480d9d2ba411a5f5ad28a886386d1a
+MISC ChangeLog-2015 11039 SHA256 741385d4a0f10e7a85ff99553dda613b4b1b5b6c8a58364db0a81d6221811432 SHA512 936f5533597f7fe0f1c6c705c414ceed518438bf7f001f6b6cc3e702f6466308c5eb231df4f9d8fae7559c7f55ea1ab02fb79eda0744f0da7f067caffcfde001 WHIRLPOOL 2cc233cd7a9c78c68655a27c6bb834fb100d971f1ac3bea5f5b375641e4e59c414e40be9d82ad74af5f2742f06ba72e4186a3e33bee03a3386cd011d754e096b
+MISC metadata.xml 232 SHA256 0c8d91b3d514ac42d0eaca567346ab909c0f947049c85c25a380ec2400f1b3fb SHA512 00beaf2c81112ff757c4395f4ea47e85f2d48e369e241f10ddf200090dd6513d52ae2b1aef6d28b7417f1cf34608a7258a167eb307d5670323a2190f3710f893 WHIRLPOOL 3a1a6d054edc9177d85ca868f9b0a6e84ee51bab4fbdbb9b1ead1a03874036bcc3f96e903fb751dc4d29fdb7d6b5f3d8dbe7b042fc697c887e23f41cc9c8c4ac
diff --git a/dev-java/jdbc-postgresql/files/jdbc-postgresql-9.4_p1201-remove-osgi.patch b/dev-java/jdbc-postgresql/files/jdbc-postgresql-9.4_p1201-remove-osgi.patch
new file mode 100644
index 000000000000..15b1860d2aa7
--- /dev/null
+++ b/dev-java/jdbc-postgresql/files/jdbc-postgresql-9.4_p1201-remove-osgi.patch
@@ -0,0 +1,37 @@
+--- a/build.xml 2015-02-18 17:44:58.000000000 +0100
++++ b/build.xml 2015-03-23 02:19:03.951945663 +0100
+@@ -403,34 +403,6 @@
+ <attribute name="Implementation-Vendor" value="PostgreSQL Global Development Group" />
+ </manifest>
+ </jar>
+-
+- <!-- add OSGi meta information -->
+- <property name="osgidir" value="${builddir}/osgi"/>
+- <mkdir dir="${osgidir}"/>
+-
+- <!-- create a bnd file named after the JAR file so that bnd wrap tool find it -->
+- <echo file="${osgidir}/${artifact.version.string}.bnd">
+-Bundle-ManifestVersion: 2
+-
+-Bundle-Name: PostgreSQL JDBC Driver ${jdbc.version.upper}
+-Bundle-SymbolicName: org.postgresql.${jdbc.version}
+-Bundle-Version: ${osgi.version}
+-
+-Bundle-Vendor: PostgreSQL Global Development Group
+-Bundle-Copyright: Copyright (c) 2003-2015, PostgreSQL Global Development Group
+-Bundle-License: http://www.postgresql.org/about/licence/
+-Bundle-DocURL: http://jdbc.postgresql.org/
+-
+-Bundle-Classpath: .
+-Bundle-Activator: org.postgresql.osgi.PGBundleActivator
+-Require-Capability: osgi.ee;filter:="(&amp;(|(osgi.ee=J2SE)(osgi.ee=JavaSE))(version>=${java.specification.version}))"
+-Export-Package: org.postgresql*; version=${fullversion}
+-Import-Package: javax.sql, javax.transaction.xa, javax.naming, *;resolution:=optional
+- </echo>
+-
+- <!-- run wrap task from bnd -->
+- <taskdef resource="aQute/bnd/ant/taskdef.properties" classpathref="dependency.build.classpath"/>
+- <bndwrap jars="${artifact.jar.build}" output="${artifact.jar}" definitions="${osgidir}"/>
+ </target>
+
+ <!-- create a distribution with docs, dependencies, and driver jar -->
diff --git a/dev-java/jdbc-postgresql/files/jdbc-postgresql-9.4_p1204-remove-sspi.patch b/dev-java/jdbc-postgresql/files/jdbc-postgresql-9.4_p1204-remove-sspi.patch
new file mode 100644
index 000000000000..16996892b192
--- /dev/null
+++ b/dev-java/jdbc-postgresql/files/jdbc-postgresql-9.4_p1204-remove-sspi.patch
@@ -0,0 +1,138 @@
+--- a/org/postgresql/core/v3/ConnectionFactoryImpl.java 2015-10-09 20:55:53.000000000 +0200
++++ b/org/postgresql/core/v3/ConnectionFactoryImpl.java 2015-10-14 20:42:48.816753341 +0200
+@@ -32,7 +32,6 @@
+ import org.postgresql.hostchooser.HostChooserFactory;
+ import org.postgresql.hostchooser.HostRequirement;
+ import org.postgresql.hostchooser.HostStatus;
+-import org.postgresql.sspi.SSPIClient;
+ import org.postgresql.util.GT;
+ import org.postgresql.util.HostSpec;
+ import org.postgresql.util.MD5Digest;
+@@ -394,11 +393,7 @@
+ // or an authentication request
+
+ String password = PGProperty.PASSWORD.get(info);
+-
+- /* SSPI negotiation state, if used */
+- SSPIClient sspiClient = null;
+
+- try {
+ authloop:
+ while (true)
+ {
+@@ -514,88 +509,16 @@
+ case AUTH_REQ_SSPI:
+ /*
+ * Use GSSAPI if requested on all platforms, via JSSE.
+- *
+- * For SSPI auth requests, if we're on Windows attempt native SSPI
+- * authentication if available, and if not disabled by setting a
+- * kerberosServerName. On other platforms, attempt JSSE GSSAPI
+- * negotiation with the SSPI server.
+- *
+- * Note that this is slightly different to libpq, which uses SSPI
+- * for GSSAPI where supported. We prefer to use the existing Java
+- * JSSE Kerberos support rather than going to native (via JNA) calls
+- * where possible, so that JSSE system properties etc continue
+- * to work normally.
+- *
+- * Note that while SSPI is often Kerberos-based there's no guarantee
+- * it will be; it may be NTLM or anything else. If the client responds
+- * to an SSPI request via GSSAPI and the other end isn't using Kerberos
+- * for SSPI then authentication will fail.
+ */
+- final String gsslib = PGProperty.GSS_LIB.get(info);
+- final boolean usespnego = PGProperty.USE_SPNEGO.getBoolean(info);
+-
+- boolean useSSPI = false;
++ org.postgresql.gss.MakeGSS.authenticate(pgStream, host,
++ user, password,
++ PGProperty.JAAS_APPLICATION_NAME.get(info),
++ PGProperty.KERBEROS_SERVER_NAME.get(info),
++ logger,
++ PGProperty.USE_SPNEGO.getBoolean(info));
++
++ break;
+
+- /*
+- * Use SSPI if we're in auto mode on windows and have a
+- * request for SSPI auth, or if it's forced. Otherwise
+- * use gssapi. If the user has specified a Kerberos server
+- * name we'll always use JSSE GSSAPI.
+- */
+- if (gsslib.equals("gssapi"))
+- logger.debug("Using JSSE GSSAPI, param gsslib=gssapi");
+- else if (areq == AUTH_REQ_GSS && !gsslib.equals("sspi"))
+- logger.debug("Using JSSE GSSAPI, gssapi requested by server and gsslib=sspi not forced");
+- else
+- {
+- /* Determine if SSPI is supported by the client */
+- sspiClient = new SSPIClient(pgStream,
+- PGProperty.SSPI_SERVICE_CLASS.get(info),
+- /* Use negotiation for SSPI, or if explicitly requested for GSS */
+- areq == AUTH_REQ_SSPI || (areq == AUTH_REQ_GSS && usespnego),
+- logger);
+-
+- useSSPI = sspiClient.isSSPISupported();
+- logger.debug("SSPI support detected: " + useSSPI);
+-
+- if (!useSSPI) {
+- /* No need to dispose() if no SSPI used */
+- sspiClient = null;
+-
+- if (gsslib.equals("sspi"))
+- throw new PSQLException("SSPI forced with gsslib=sspi, but SSPI not available; set loglevel=2 for details",
+- PSQLState.CONNECTION_UNABLE_TO_CONNECT);
+- }
+-
+- logger.debug("Using SSPI: " + useSSPI + ", gsslib="+gsslib+" and SSPI support detected");
+- }
+-
+- if (useSSPI)
+- {
+- /* SSPI requested and detected as available */
+- sspiClient.startSSPI();
+- }
+- else
+- {
+- /* Use JGSS's GSSAPI for this request */
+- org.postgresql.gss.MakeGSS.authenticate(pgStream, host,
+- user, password,
+- PGProperty.JAAS_APPLICATION_NAME.get(info),
+- PGProperty.KERBEROS_SERVER_NAME.get(info),
+- logger,
+- usespnego);
+- }
+-
+- break;
+-
+- case AUTH_REQ_GSS_CONTINUE:
+- /*
+- * Only called for SSPI, as GSS is handled by an inner loop
+- * in MakeGSS.
+- */
+- sspiClient.continueSSPI(l_msgLen - 8);
+- break;
+-
+ case AUTH_REQ_OK:
+ /* Cleanup after successful authentication */
+ if (logger.logDebug())
+@@ -616,18 +539,6 @@
+ throw new PSQLException(GT.tr("Protocol error. Session setup failed."), PSQLState.PROTOCOL_VIOLATION);
+ }
+ }
+- } finally {
+- /* Cleanup after successful or failed authentication attempts */
+- if (sspiClient != null)
+- {
+- try {
+- sspiClient.dispose();
+- } catch (RuntimeException ex) {
+- logger.log("Unexpected error during SSPI context disposal", ex);
+- }
+-
+- }
+- }
+
+ }
+
diff --git a/dev-java/jdbc-postgresql/jdbc-postgresql-9.2_p1003.ebuild b/dev-java/jdbc-postgresql/jdbc-postgresql-9.2_p1003.ebuild
new file mode 100644
index 000000000000..c69374a06794
--- /dev/null
+++ b/dev-java/jdbc-postgresql/jdbc-postgresql-9.2_p1003.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+JAVA_PKG_IUSE="doc source"
+
+inherit java-pkg-2 java-ant-2
+
+MY_PN="postgresql-jdbc"
+MY_PV="${PV/_p/-}"
+MY_P="${MY_PN}-${MY_PV}.src"
+
+DESCRIPTION="JDBC Driver for PostgreSQL"
+SRC_URI="http://jdbc.postgresql.org/download/${MY_P}.tar.gz"
+HOMEPAGE="http://jdbc.postgresql.org/"
+
+LICENSE="POSTGRESQL"
+SLOT="0"
+KEYWORDS="amd64 ppc64 x86"
+IUSE="test"
+
+DEPEND="
+ >=virtual/jdk-1.6
+ doc? (
+ dev-libs/libxslt
+ app-text/docbook-xsl-stylesheets
+ )
+ test? (
+ dev-java/ant-junit
+ dev-db/postgresql[server]
+ )"
+RDEPEND=">=virtual/jre-1.6"
+
+S="${WORKDIR}/postgresql-jdbc-${MY_PV}.src"
+
+java_prepare() {
+ find -name "*.class" -type f -exec rm -v {} + || die
+}
+
+JAVA_ANT_REWRITE_CLASSPATH="yes"
+EANT_DOC_TARGET="publicapi"
+
+src_compile() {
+ java-pkg-2_src_compile
+
+ # There is a task that creates this doc but I didn't find a way how to use system catalog
+ # to lookup the stylesheet so the 'doc' target is rewritten here to use system call instead.
+ if use doc; then
+ mkdir -p "${S}/build/doc"
+ xsltproc -o "${S}/build/doc/pgjdbc.html" http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl \
+ "${S}/doc/pgjdbc.xml"
+ fi
+}
+
+src_test() {
+ einfo "In order to run the tests successfully, you have to have:"
+ einfo "1) PostgreSQL server running"
+ einfo "2) database 'test' defined with user 'test' with password 'password'"
+ einfo " as owner of the database"
+ einfo "3) plpgsql support in the 'test' database"
+ einfo
+ einfo "You can find a general info on how to perform these steps at"
+ einfo "https://wiki.gentoo.org/wiki/PostgreSQL"
+
+ ANT_TASKS="ant-junit" eant test -Dgentoo.classpath=$(java-pkg_getjars --build-only junit)
+}
+
+src_install() {
+ java-pkg_newjar jars/postgresql.jar jdbc-postgresql.jar
+
+ if use doc ; then
+ java-pkg_dojavadoc build/publicapi
+ dohtml build/doc/pgjdbc.html
+ fi
+
+ use source && java-pkg_dosrc org
+}
diff --git a/dev-java/jdbc-postgresql/jdbc-postgresql-9.2_p1004.ebuild b/dev-java/jdbc-postgresql/jdbc-postgresql-9.2_p1004.ebuild
new file mode 100644
index 000000000000..a0f2da4263f0
--- /dev/null
+++ b/dev-java/jdbc-postgresql/jdbc-postgresql-9.2_p1004.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+JAVA_PKG_IUSE="doc source"
+
+inherit java-pkg-2 java-ant-2
+
+MY_PN="postgresql-jdbc"
+MY_PV="${PV/_p/-}"
+MY_P="${MY_PN}-${MY_PV}.src"
+
+DESCRIPTION="JDBC Driver for PostgreSQL"
+SRC_URI="http://jdbc.postgresql.org/download/${MY_P}.tar.gz"
+HOMEPAGE="http://jdbc.postgresql.org/"
+
+LICENSE="POSTGRESQL"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+IUSE="test"
+
+DEPEND="
+ >=virtual/jdk-1.6
+ doc? (
+ dev-libs/libxslt
+ app-text/docbook-xsl-stylesheets
+ )
+ test? (
+ dev-java/ant-junit
+ dev-db/postgresql[server]
+ )"
+RDEPEND=">=virtual/jre-1.6"
+
+S="${WORKDIR}/postgresql-jdbc-${MY_PV}.src"
+
+java_prepare() {
+ find -name "*.class" -type f -exec rm -v {} + || die
+}
+
+JAVA_ANT_REWRITE_CLASSPATH="yes"
+EANT_DOC_TARGET="publicapi"
+
+src_compile() {
+ java-pkg-2_src_compile
+
+ # There is a task that creates this doc but I didn't find a way how to use system catalog
+ # to lookup the stylesheet so the 'doc' target is rewritten here to use system call instead.
+ if use doc; then
+ mkdir -p "${S}/build/doc"
+ xsltproc -o "${S}/build/doc/pgjdbc.html" http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl \
+ "${S}/doc/pgjdbc.xml"
+ fi
+}
+
+src_test() {
+ einfo "In order to run the tests successfully, you have to have:"
+ einfo "1) PostgreSQL server running"
+ einfo "2) database 'test' defined with user 'test' with password 'password'"
+ einfo " as owner of the database"
+ einfo "3) plpgsql support in the 'test' database"
+ einfo
+ einfo "You can find a general info on how to perform these steps at"
+ einfo "https://wiki.gentoo.org/wiki/PostgreSQL"
+
+ ANT_TASKS="ant-junit" eant test -Dgentoo.classpath=$(java-pkg_getjars --build-only junit)
+}
+
+src_install() {
+ java-pkg_newjar jars/postgresql.jar jdbc-postgresql.jar
+
+ if use doc ; then
+ java-pkg_dojavadoc build/publicapi
+ dohtml build/doc/pgjdbc.html
+ fi
+
+ use source && java-pkg_dosrc org
+}
diff --git a/dev-java/jdbc-postgresql/jdbc-postgresql-9.3_p1100.ebuild b/dev-java/jdbc-postgresql/jdbc-postgresql-9.3_p1100.ebuild
new file mode 100644
index 000000000000..a0f2da4263f0
--- /dev/null
+++ b/dev-java/jdbc-postgresql/jdbc-postgresql-9.3_p1100.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+JAVA_PKG_IUSE="doc source"
+
+inherit java-pkg-2 java-ant-2
+
+MY_PN="postgresql-jdbc"
+MY_PV="${PV/_p/-}"
+MY_P="${MY_PN}-${MY_PV}.src"
+
+DESCRIPTION="JDBC Driver for PostgreSQL"
+SRC_URI="http://jdbc.postgresql.org/download/${MY_P}.tar.gz"
+HOMEPAGE="http://jdbc.postgresql.org/"
+
+LICENSE="POSTGRESQL"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+IUSE="test"
+
+DEPEND="
+ >=virtual/jdk-1.6
+ doc? (
+ dev-libs/libxslt
+ app-text/docbook-xsl-stylesheets
+ )
+ test? (
+ dev-java/ant-junit
+ dev-db/postgresql[server]
+ )"
+RDEPEND=">=virtual/jre-1.6"
+
+S="${WORKDIR}/postgresql-jdbc-${MY_PV}.src"
+
+java_prepare() {
+ find -name "*.class" -type f -exec rm -v {} + || die
+}
+
+JAVA_ANT_REWRITE_CLASSPATH="yes"
+EANT_DOC_TARGET="publicapi"
+
+src_compile() {
+ java-pkg-2_src_compile
+
+ # There is a task that creates this doc but I didn't find a way how to use system catalog
+ # to lookup the stylesheet so the 'doc' target is rewritten here to use system call instead.
+ if use doc; then
+ mkdir -p "${S}/build/doc"
+ xsltproc -o "${S}/build/doc/pgjdbc.html" http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl \
+ "${S}/doc/pgjdbc.xml"
+ fi
+}
+
+src_test() {
+ einfo "In order to run the tests successfully, you have to have:"
+ einfo "1) PostgreSQL server running"
+ einfo "2) database 'test' defined with user 'test' with password 'password'"
+ einfo " as owner of the database"
+ einfo "3) plpgsql support in the 'test' database"
+ einfo
+ einfo "You can find a general info on how to perform these steps at"
+ einfo "https://wiki.gentoo.org/wiki/PostgreSQL"
+
+ ANT_TASKS="ant-junit" eant test -Dgentoo.classpath=$(java-pkg_getjars --build-only junit)
+}
+
+src_install() {
+ java-pkg_newjar jars/postgresql.jar jdbc-postgresql.jar
+
+ if use doc ; then
+ java-pkg_dojavadoc build/publicapi
+ dohtml build/doc/pgjdbc.html
+ fi
+
+ use source && java-pkg_dosrc org
+}
diff --git a/dev-java/jdbc-postgresql/jdbc-postgresql-9.4_p1205.ebuild b/dev-java/jdbc-postgresql/jdbc-postgresql-9.4_p1205.ebuild
new file mode 100644
index 000000000000..8da80597d544
--- /dev/null
+++ b/dev-java/jdbc-postgresql/jdbc-postgresql-9.4_p1205.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+JAVA_PKG_IUSE="doc source"
+
+inherit eutils java-pkg-2 java-ant-2
+
+MY_PN="postgresql-jdbc"
+MY_PV="${PV/_p/-}"
+MY_P="${MY_PN}-${MY_PV}.src"
+
+DESCRIPTION="JDBC Driver for PostgreSQL"
+SRC_URI="http://jdbc.postgresql.org/download/${MY_P}.tar.gz"
+HOMEPAGE="http://jdbc.postgresql.org/"
+
+LICENSE="POSTGRESQL"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+IUSE="test"
+
+DEPEND="
+ >=virtual/jdk-1.6
+ doc? (
+ dev-libs/libxslt
+ app-text/docbook-xsl-stylesheets
+ )
+ test? (
+ >=dev-db/postgresql-9.3[server]
+ dev-java/ant-junit
+ dev-java/junit:4
+ dev-java/xml-commons
+ )"
+RDEPEND=">=virtual/jre-1.6"
+
+RESTRICT="test" # Requires external postgresql server setup
+
+S="${WORKDIR}/postgresql-jdbc-${MY_PV}.src"
+
+JAVA_ANT_REWRITE_CLASSPATH="yes"
+EANT_DOC_TARGET="publicapi"
+
+java_prepare() {
+ # Strip build.xml of maven deps
+ sed -i -e '/<classpath.*dependency\.compile\.classpath/c\' build.xml || die
+ sed -i -e '/<classpath.*dependency\.runtime\.classpath/c\' build.xml || die
+ sed -i -e '/<classpath.*dependency\.test\.classpath/c\' build.xml || die
+ sed -i -e '/<target name="artifact-version"/,/<[/]target>/{s/depends="maven-dependencies"//}' build.xml || die
+ sed -i -e '/<target name="compile"/ s/,maven-dependencies//' build.xml || die
+
+ # Remove SSPI, it pulls in Waffle-JNA and is only used on Windows
+ sed -i -e '/<include.*sspi/c\' build.xml || die
+ rm -vrf org/postgresql/sspi || die "Error removing sspi"
+ epatch "${FILESDIR}"/${PN}-9.4_p1204-remove-sspi.patch
+
+ # FIXME @someone who cares: enable through osgi flag?
+ sed -i -e '/<include.*osgi/c\' build.xml || die
+ sed -i -e '/<test.*osgi/c\' build.xml || die
+ rm -vrf org/postgresql/osgi || die "Error removing osgi"
+ rm -vrf org/postgresql/test/osgi || die "Error removing osgi tests"
+ epatch "${FILESDIR}"/${PN}-9.4_p1201-remove-osgi.patch
+
+ java-pkg_clean
+}
+
+src_compile() {
+ EANT_BUILD_TARGET="release-version jar"
+ java-pkg-2_src_compile
+
+ # There is a task that creates this doc but I didn't find a way how to use system catalog
+ # to lookup the stylesheet so the 'doc' target is rewritten here to use system call instead.
+ if use doc; then
+ mkdir -p "${S}/build/doc" || die
+ xsltproc -o "${S}/build/doc/pgjdbc.html" http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl \
+ "${S}/doc/pgjdbc.xml" || die
+ fi
+}
+
+src_test() {
+ einfo "In order to run the tests successfully, you have to have:"
+ einfo "1) PostgreSQL server running"
+ einfo "2) database 'test' defined with user 'test' with password 'test'"
+ einfo " as owner of the database"
+ einfo "3) plpgsql support in the 'test' database"
+ einfo
+ einfo "You can find a general info on how to perform these steps at"
+ einfo "https://wiki.gentoo.org/wiki/PostgreSQL"
+
+ ANT_TASKS="ant-junit" eant test -Dgentoo.classpath=$(java-pkg_getjars --build-only "junit-4,xml-commons")
+}
+
+src_install() {
+ java-pkg_newjar build/jars/postgresql*.jar jdbc-postgresql.jar
+
+ if use doc ; then
+ java-pkg_dojavadoc build/publicapi
+ dohtml build/doc/pgjdbc.html
+ fi
+
+ use source && java-pkg_dosrc org
+}
diff --git a/dev-java/jdbc-postgresql/jdbc-postgresql-9.4_p1206.ebuild b/dev-java/jdbc-postgresql/jdbc-postgresql-9.4_p1206.ebuild
new file mode 100644
index 000000000000..6db452316d8c
--- /dev/null
+++ b/dev-java/jdbc-postgresql/jdbc-postgresql-9.4_p1206.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+JAVA_PKG_IUSE="doc source"
+
+inherit eutils java-pkg-2 java-ant-2
+
+MY_PN="postgresql-jdbc"
+MY_PV="${PV/_p/-}"
+MY_P="${MY_PN}-${MY_PV}.src"
+
+DESCRIPTION="JDBC Driver for PostgreSQL"
+SRC_URI="http://jdbc.postgresql.org/download/${MY_P}.tar.gz"
+HOMEPAGE="http://jdbc.postgresql.org/"
+
+LICENSE="POSTGRESQL"
+SLOT="0"
+KEYWORDS="amd64 ppc64 x86"
+IUSE="test"
+
+DEPEND="
+ >=virtual/jdk-1.6
+ doc? (
+ dev-libs/libxslt
+ app-text/docbook-xsl-stylesheets
+ )
+ test? (
+ >=dev-db/postgresql-9.3[server]
+ dev-java/ant-junit
+ dev-java/junit:4
+ dev-java/xml-commons
+ )"
+RDEPEND=">=virtual/jre-1.6"
+
+RESTRICT="test" # Requires external postgresql server setup
+
+S="${WORKDIR}/postgresql-jdbc-${MY_PV}.src"
+
+JAVA_ANT_REWRITE_CLASSPATH="yes"
+EANT_DOC_TARGET="publicapi"
+
+java_prepare() {
+ # Strip build.xml of maven deps
+ sed -i -e '/<classpath.*dependency\.compile\.classpath/c\' build.xml || die
+ sed -i -e '/<classpath.*dependency\.runtime\.classpath/c\' build.xml || die
+ sed -i -e '/<classpath.*dependency\.test\.classpath/c\' build.xml || die
+ sed -i -e '/<target name="artifact-version"/,/<[/]target>/{s/depends="maven-dependencies"//}' build.xml || die
+ sed -i -e '/<target name="compile"/ s/,maven-dependencies//' build.xml || die
+
+ # Remove SSPI, it pulls in Waffle-JNA and is only used on Windows
+ sed -i -e '/<include.*sspi/c\' build.xml || die
+ rm -vrf org/postgresql/sspi || die "Error removing sspi"
+ epatch "${FILESDIR}"/${PN}-9.4_p1204-remove-sspi.patch
+
+ # FIXME @someone who cares: enable through osgi flag?
+ sed -i -e '/<include.*osgi/c\' build.xml || die
+ sed -i -e '/<test.*osgi/c\' build.xml || die
+ rm -vrf org/postgresql/osgi || die "Error removing osgi"
+ rm -vrf org/postgresql/test/osgi || die "Error removing osgi tests"
+ epatch "${FILESDIR}"/${PN}-9.4_p1201-remove-osgi.patch
+
+ java-pkg_clean
+}
+
+src_compile() {
+ EANT_BUILD_TARGET="release-version jar"
+ java-pkg-2_src_compile
+
+ # There is a task that creates this doc but I didn't find a way how to use system catalog
+ # to lookup the stylesheet so the 'doc' target is rewritten here to use system call instead.
+ if use doc; then
+ mkdir -p "${S}/build/doc" || die
+ xsltproc -o "${S}/build/doc/pgjdbc.html" http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl \
+ "${S}/doc/pgjdbc.xml" || die
+ fi
+}
+
+src_test() {
+ einfo "In order to run the tests successfully, you have to have:"
+ einfo "1) PostgreSQL server running"
+ einfo "2) database 'test' defined with user 'test' with password 'test'"
+ einfo " as owner of the database"
+ einfo "3) plpgsql support in the 'test' database"
+ einfo
+ einfo "You can find a general info on how to perform these steps at"
+ einfo "https://wiki.gentoo.org/wiki/PostgreSQL"
+
+ ANT_TASKS="ant-junit" eant test -Dgentoo.classpath=$(java-pkg_getjars --build-only "junit-4,xml-commons")
+}
+
+src_install() {
+ java-pkg_newjar build/jars/postgresql*.jar jdbc-postgresql.jar
+
+ if use doc ; then
+ java-pkg_dojavadoc build/publicapi
+ dohtml build/doc/pgjdbc.html
+ fi
+
+ use source && java-pkg_dosrc org
+}
diff --git a/dev-java/jdbc-postgresql/metadata.xml b/dev-java/jdbc-postgresql/metadata.xml
new file mode 100644
index 000000000000..2444066aa02b
--- /dev/null
+++ b/dev-java/jdbc-postgresql/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>java@gentoo.org</email>
+ <name>Java</name>
+</maintainer>
+</pkgmetadata>