From 233054676ab762836805fa1a19df36a625a3ad02 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 14 2018 13:04:54 +0000 Subject: import postgresql-jdbc-9.2.1002-6.el7_5 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d11022 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/postgresql-jdbc-9.2-1002.src.tar.gz diff --git a/.postgresql-jdbc.metadata b/.postgresql-jdbc.metadata new file mode 100644 index 0000000..ecab418 --- /dev/null +++ b/.postgresql-jdbc.metadata @@ -0,0 +1 @@ +ac5efbe2a3acf8fdb443bda874f97b1928f23efc SOURCES/postgresql-jdbc-9.2-1002.src.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/postgresql-jdbc-9.2.1002-getIndexInfo-and-9.6-server.patch b/SOURCES/postgresql-jdbc-9.2.1002-getIndexInfo-and-9.6-server.patch new file mode 100644 index 0000000..1efb239 --- /dev/null +++ b/SOURCES/postgresql-jdbc-9.2.1002-getIndexInfo-and-9.6-server.patch @@ -0,0 +1,35 @@ +This is backport of fixes from upstream pull request 560 and 569, +excluding the testsuite fixes, namely commits: + 3ff47daf68bf45694d5671eef1d9d32fb87f00d3 + c9e5fc8bf53ead845f7b56c9cbe3c1058b636ca5 +Fixes rhbz#1547424 + + +diff --git a/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java b/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java +index f1109f5..fa4d6c0 100644 +--- a/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java ++++ b/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java +@@ -4094,6 +4094,15 @@ public abstract class AbstractJdbc2DatabaseMetaData + + " END AS TYPE, " + + " (i.keys).n AS ORDINAL_POSITION, " + + " pg_catalog.pg_get_indexdef(ci.oid, (i.keys).n, false) AS COLUMN_NAME, " ++ + (connection.haveMinimumServerVersion("9.6") ++ ? " CASE am.amname " ++ + " WHEN 'btree' THEN CASE i.indoption[(i.keys).n - 1] & 1 " ++ + " WHEN 1 THEN 'D' " ++ + " ELSE 'A' " ++ + " END " ++ + " ELSE NULL " ++ + " END AS ASC_OR_DESC, " ++ : "" + + " CASE am.amcanorder " + + " WHEN true THEN CASE i.indoption[(i.keys).n - 1] & 1 " + + " WHEN 1 THEN 'D' " +@@ -4101,6 +4110,7 @@ public abstract class AbstractJdbc2DatabaseMetaData + + " END " + + " ELSE NULL " + + " END AS ASC_OR_DESC, " ++ ) + + " ci.reltuples AS CARDINALITY, " + + " ci.relpages AS PAGES, " + + " pg_catalog.pg_get_expr(i.indpred, i.indrelid) AS FILTER_CONDITION " diff --git a/SOURCES/postgresql-jdbc-9.2.1002-version-compare.patch b/SOURCES/postgresql-jdbc-9.2.1002-version-compare.patch new file mode 100644 index 0000000..272d2dc --- /dev/null +++ b/SOURCES/postgresql-jdbc-9.2.1002-version-compare.patch @@ -0,0 +1,62 @@ +The (pretty old) RHEL7 jdbc connector might well be run against newer +PostgreSQL servers; newer than the system-default PostgreSQL 9.2, +especially if we consider that we are asynchronously adding new servers +into RHSCL channel. + +During the lifetime of postgresql-jdbc package, PostgreSQL upstream bumped +major version from 9.6 to 10 (together with changing of the versioning +scheme), which caused troubles with the implemented server-version +comparator in pgjdbc; that code did not count with two-digit numbers in +version string. This patch fixes the problem downstream-only way, since +backporting related upstream fixes would lead to much larger patch and +risks that something goes wrong. We still fallback to the old comparison +method when we are not sure about the comparison (that is when isNewerOrEqual +throws some exception). + +diff --git a/org/postgresql/jdbc2/AbstractJdbc2Connection.java b/org/postgresql/jdbc2/AbstractJdbc2Connection.java +index 2fb37f4..d889247 100644 +--- a/org/postgresql/jdbc2/AbstractJdbc2Connection.java ++++ b/org/postgresql/jdbc2/AbstractJdbc2Connection.java +@@ -1061,14 +1061,39 @@ public abstract class AbstractJdbc2Connection implements BaseConnection + } + } + ++ private static boolean ++ isNewerOrEqual(String v1, String v2) ++ { ++ Iterator i1 = Arrays.asList(v1.split("\\.")).iterator(); ++ Iterator i2 = Arrays.asList(v2.split("\\.")).iterator(); ++ ++ while (true) { ++ if (!i1.hasNext()) ++ return true; ++ if (!i2.hasNext()) ++ return false; ++ ++ int left = Integer.parseInt(i1.next()); ++ int right = Integer.parseInt(i2.next()); ++ ++ if (right == left) ++ continue; ++ ++ return right >= left; ++ } ++ } ++ + /** + * Is the server we are connected to running at least this version? +- * This comparison method will fail whenever a major or minor version +- * goes to two digits (10.3.0) or (7.10.1). + */ + public boolean haveMinimumServerVersion(String ver) + { +- return (dbVersionNumber.compareTo(ver) >= 0); ++ try { ++ return isNewerOrEqual(ver, dbVersionNumber); ++ } ++ catch (Exception e) { ++ return (dbVersionNumber.compareTo(ver) >= 0); ++ } + } + + /* diff --git a/SOURCES/postgresql-jdbc.pom b/SOURCES/postgresql-jdbc.pom new file mode 100644 index 0000000..a242066 --- /dev/null +++ b/SOURCES/postgresql-jdbc.pom @@ -0,0 +1,23 @@ + + + 4.0.0 + postgresql + postgresql + jar + PostgreSQL JDBC Driver + + UPSTREAM_VERSION + http://jdbc.postgresql.org + The PostgreSQL Driver JDBC4 + + + BSD License + http://jdbc.postgresql.org/license.html + + repo + + + + http://gborg.postgresql.org/project/pgjdbc/cvs/cvs.php + + diff --git a/SPECS/postgresql-jdbc.spec b/SPECS/postgresql-jdbc.spec new file mode 100644 index 0000000..bee7cbc --- /dev/null +++ b/SPECS/postgresql-jdbc.spec @@ -0,0 +1,254 @@ +# Copyright (c) 2000-2005, JPackage Project +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the +# distribution. +# 3. Neither the name of the JPackage Project nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +%global section devel +%global upstreamver 9.2-1002 + +Summary: JDBC driver for PostgreSQL +Name: postgresql-jdbc +Version: 9.2.1002 +Release: 6%{?dist} +# ASL 2.0 applies only to postgresql-jdbc.pom file, the rest is BSD +License: BSD and ASL 2.0 +Group: Applications/Databases +URL: http://jdbc.postgresql.org/ + +Source0: http://jdbc.postgresql.org/download/%{name}-%{upstreamver}.src.tar.gz +# originally http://repo2.maven.org/maven2/postgresql/postgresql/8.4-701.jdbc4/postgresql-8.4-701.jdbc4.pom: +Source1: %{name}.pom + +# patches are self-documented inside the files +Patch1: postgresql-jdbc-9.2.1002-version-compare.patch +Patch2: postgresql-jdbc-9.2.1002-getIndexInfo-and-9.6-server.patch + +BuildArch: noarch +BuildRequires: java-devel +BuildRequires: jpackage-utils +BuildRequires: ant +BuildRequires: ant-junit +BuildRequires: junit +# gettext is only needed if we try to update translations +#BuildRequires: gettext +Requires: java-headless +Requires: jpackage-utils + +%description +PostgreSQL is an advanced Object-Relational database management +system. The postgresql-jdbc package includes the .jar files needed for +Java programs to access a PostgreSQL database. + +%package javadoc +Summary: API docs for %{name} +Group: Documentation + +%description javadoc +This package contains the API Documentation for %{name}. + +%prep +%setup -c -q +mv -f %{name}-%{upstreamver}.src/* . +rm -f %{name}-%{upstreamver}.src/.gitignore +rmdir %{name}-%{upstreamver}.src + +%patch1 -p1 -b .version +%patch2 -p1 -b .getIndexInfo + +# remove any binary libs +find -name "*.jar" -or -name "*.class" | xargs rm -f + +%build +export OPT_JAR_LIST="ant/ant-junit junit" +export CLASSPATH= + +# Ideally we would run "sh update-translations.sh" here, but that results +# in inserting the build timestamp into the generated messages_*.class +# files, which makes rpmdiff complain about multilib conflicts if the +# different platforms don't build in the same minute. For now, rely on +# upstream to have updated the translations files before packaging. + +ant jar publicapi + +%install +install -d $RPM_BUILD_ROOT%{_javadir} +# Per jpp conventions, jars have version-numbered names and we add +# versionless symlinks. +install -m 644 jars/postgresql.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar + +pushd $RPM_BUILD_ROOT%{_javadir} +# Also, for backwards compatibility with our old postgresql-jdbc packages, +# add these symlinks. (Probably only the jdbc3 symlink really makes sense?) +ln -s postgresql-jdbc.jar postgresql-jdbc2.jar +ln -s postgresql-jdbc.jar postgresql-jdbc2ee.jar +ln -s postgresql-jdbc.jar postgresql-jdbc3.jar +popd + +# Install the pom after inserting the correct version number +sed 's/UPSTREAM_VERSION/%{upstreamver}/g' %{SOURCE1} >JPP-%{name}.pom +install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}/ +install -m 644 JPP-%{name}.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom +%add_maven_depmap + +install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir} +cp -ra build/publicapi $RPM_BUILD_ROOT%{_javadocdir}/%{name} +install -d build/publicapi docs/%{name} + +%files -f .mfiles +%doc LICENSE README doc/* +%{_javadir}/%{name}2.jar +%{_javadir}/%{name}2ee.jar +%{_javadir}/%{name}3.jar + +%files javadoc +%doc LICENSE +%doc %{_javadocdir}/%{name} + +%changelog +* Fri Apr 20 2018 Pavel Raiskup - 9.2.1002-6 +- fix incompatibility with 9.6+ (rhbz#1547424) +- it's unnecessary to depend on whole java (rhbz#1406931) + +* Fri Dec 27 2013 Daniel Mach - 9.2.1002-5 +- Mass rebuild 2013-12-27 + +* Tue Aug 06 2013 Pavel Raiskup - 9.2.1002-4 +- add javadoc subpackage + +* Tue Aug 06 2013 Pavel Raiskup - 9.2.1002-4 +- don't use removed macro %%add_to_maven_depmap (#992816) +- lint: trim-lines, reuse %%{name} macro, fedora-review fixes +- merge cleanup changes by Stano Ochotnicky + +* Sun Aug 04 2013 Fedora Release Engineering - 9.2.1002-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 9.2.1002-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Nov 14 2012 Tom Lane 9.2.1002-1 +- Update to build 9.2-1002 (just to correct mispackaging of source tarball) + +* Tue Nov 13 2012 Tom Lane 9.2.1001-1 +- Update to build 9.2-1001 for compatibility with PostgreSQL 9.2 + +* Sun Jul 22 2012 Tom Lane 9.1.902-1 +- Update to build 9.1-902 + +* Sat Jul 21 2012 Fedora Release Engineering - 9.1.901-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Feb 23 2012 Tom Lane 9.1.901-3 +- Change BuildRequires: java-1.6.0-openjdk-devel to just java-devel. + As of 9.1-901, upstream has support for JDBC4.1, so we don't have to + restrict to JDK6 anymore, and Fedora is moving to JDK7 +Resolves: #796580 + +* Sat Jan 14 2012 Fedora Release Engineering - 9.1.901-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Sep 12 2011 Tom Lane 9.1.901-1 +- Update to build 9.1-901 for compatibility with PostgreSQL 9.1 + +* Mon Aug 15 2011 Tom Lane 9.0.801-4 +- Add BuildRequires: java-1.6.0-openjdk-devel to ensure we have recent JDK +Related: #730588 +- Remove long-obsolete minimum versions from BuildRequires + +* Sun Jul 17 2011 Tom Lane 9.0.801-3 +- Switch to non-GCJ build, since GCJ is now deprecated in Fedora +Resolves: #722247 +- Use %%{_mavendepmapfragdir} to fix FTBFS with maven 3 + +* Wed Feb 09 2011 Fedora Release Engineering - 9.0.801-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Dec 29 2010 Tom Lane 9.0.801-1 +- Update to build 9.0-801 + +* Mon May 31 2010 Tom Lane 8.4.701-4 +- Update gcj_support sections to meet Packaging/GCJGuidelines; + fixes FTBFS in F-14 rawhide + +* Tue Nov 24 2009 Tom Lane 8.4.701-3 +- Seems the .pom file *must* have a package version number in it, sigh +Resolves: #538487 + +* Mon Nov 23 2009 Tom Lane 8.4.701-2 +- Add a .pom file to ease use by maven-based packages (courtesy Deepak Bhole) +Resolves: #538487 + +* Tue Aug 18 2009 Tom Lane 8.4.701-1 +- Update to build 8.4-701 + +* Sun Jul 26 2009 Fedora Release Engineering - 0:8.3.603-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Tue Apr 21 2009 Tom Lane 8.3.603-3 +- Avoid multilib conflict caused by overeager attempt to rebuild translations + +* Thu Feb 26 2009 Fedora Release Engineering - 0:8.3.603-2.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Wed Jul 9 2008 Tom "spot" Callaway 8.3.603-1.1 +- drop repotag + +* Tue Feb 12 2008 Tom Lane 8.3.603-1jpp +- Update to build 8.3-603 + +* Sun Aug 12 2007 Tom Lane 8.2.506-1jpp +- Update to build 8.2-506 + +* Tue Apr 24 2007 Tom Lane 8.2.505-1jpp +- Update to build 8.2-505 +- Work around 1.4 vs 1.5 versioning inconsistency + +* Fri Dec 15 2006 Tom Lane 8.2.504-1jpp +- Update to build 8.2-504 + +* Wed Aug 16 2006 Tom Lane 8.1.407-1jpp.4 +- Fix Requires: for rebuild-gcj-db (bz #202544) + +* Wed Aug 16 2006 Fernando Nasser 8.1.407-1jpp.3 +- Merge with upstream + +* Sat Jul 22 2006 Jakub Jelinek 8.1.407-1jpp.2 +- Rebuilt + +* Wed Jul 12 2006 Jesse Keating - 0:8.1.407-1jpp.1 +- rebuild + +* Wed Jun 14 2006 Tom Lane 8.1.407-1jpp +- Update to build 8.1-407 + +* Mon Mar 27 2006 Tom Lane 8.1.405-2jpp +- Back-patch upstream fix to support unspecified-type strings. + +* Thu Feb 16 2006 Tom Lane 8.1.405-1jpp +- Split postgresql-jdbc into its own SRPM (at last). +- Build it from source. Add support for gcj compilation.