638612
# Copyright (c) 2000-2005, JPackage Project
638612
# All rights reserved.
638612
#
638612
# Redistribution and use in source and binary forms, with or without
638612
# modification, are permitted provided that the following conditions
638612
# are met:
638612
#
638612
# 1. Redistributions of source code must retain the above copyright
638612
#    notice, this list of conditions and the following disclaimer.
638612
# 2. Redistributions in binary form must reproduce the above copyright
638612
#    notice, this list of conditions and the following disclaimer in the
638612
#    documentation and/or other materials provided with the
638612
#    distribution.
638612
# 3. Neither the name of the JPackage Project nor the names of its
638612
#    contributors may be used to endorse or promote products derived
638612
#    from this software without specific prior written permission.
638612
#
638612
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
638612
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
638612
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
638612
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
638612
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
638612
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
638612
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
638612
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
638612
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
638612
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
638612
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
638612
638612
638612
# Configuration for rpmbuild, might be specified by options
638612
# like e.g. 'rpmbuild --define "runselftest 0"'.
638612
638612
%{!?runselftest:%global runselftest 1}
638612
638612
638612
%global section		devel
638612
%global source_path	pgjdbc/src/main/java/org/postgresql
638612
%global parent_ver	1.1.5
638612
%global parent_poms_builddir	./pgjdbc-parent-poms
638612
638612
%global pgjdbc_mvn_options -DwaffleEnabled=false -DosgiEnabled=false \\\
638612
	-DexcludePackageNames=org.postgresql.osgi:org.postgresql.sspi
638612
638612
Summary:	JDBC driver for PostgreSQL
638612
Name:		postgresql-jdbc
638612
Version:	42.2.3
638612
Release:	3%{?dist}
638612
License:	BSD
638612
URL:		http://jdbc.postgresql.org/
638612
638612
Source0:	https://github.com/pgjdbc/pgjdbc/archive/REL%{version}/pgjdbc-REL%{version}.tar.gz
638612
Provides:	pgjdbc = %version-%release
638612
638612
# Upstream moved parent pom.xml into separate project (even though there is only
638612
# one dependant project on it?).  Let's try to not complicate packaging by
638612
# having separate spec file for it, too.
638612
Source1:	https://github.com/pgjdbc/pgjdbc-parent-poms/archive/REL%parent_ver/pgjdbc-parent-poms-REL%{parent_ver}.tar.gz
638612
638612
# disable test that makes unpredictable assumptions about non-routable IPs
638612
# See https://github.com/pgjdbc/pgjdbc/issues/556
638612
Patch0:         disable-ConnectTimeoutTest.patch
638612
Patch1:         fix-XXE-vulnerability.patch
638612
638612
BuildArch:	noarch
638612
BuildRequires:	java-devel >= 1.8
638612
BuildRequires:	maven-local
638612
BuildRequires:	java-comment-preprocessor
638612
BuildRequires:	properties-maven-plugin
638612
BuildRequires:	maven-enforcer-plugin
638612
BuildRequires:	maven-plugin-bundle
638612
BuildRequires:	maven-plugin-build-helper
638612
BuildRequires:	classloader-leak-test-framework
638612
638612
BuildRequires:	mvn(com.ongres.scram:client)
638612
BuildRequires:	mvn(org.apache.maven.plugins:maven-clean-plugin)
638612
638612
638612
%if %runselftest
638612
BuildRequires:	postgresql-contrib
638612
BuildRequires:	postgresql-test-rpm-macros
638612
%endif
638612
638612
# gettext is only needed if we try to update translations
638612
#BuildRequires:	gettext
638612
638612
Obsoletes:      %{name}-parent-poms < 42.2.2-2
638612
638612
%description
638612
PostgreSQL is an advanced Object-Relational database management
638612
system. The postgresql-jdbc package includes the .jar files needed for
638612
Java programs to access a PostgreSQL database.
638612
638612
638612
%package javadoc
638612
Summary:	API docs for %{name}
638612
638612
%description javadoc
638612
This package contains the API Documentation for %{name}.
638612
638612
638612
%prep
638612
%setup -c -q -a 1
638612
638612
mv pgjdbc-REL%version/* .
638612
mv pgjdbc-parent-poms-REL%parent_ver pgjdbc-parent-poms
638612
638612
%patch0 -p1
638612
%patch1 -p1
638612
638612
# remove any binary libs
638612
find -name "*.jar" -or -name "*.class" | xargs rm -f
638612
638612
# Build parent POMs in the same Maven call.
638612
%pom_xpath_inject pom:modules "<module>%parent_poms_builddir</module>"
638612
%pom_xpath_inject pom:parent "<relativePath>pgjdbc-parent-poms/pgjdbc-versions</relativePath>"
638612
%pom_xpath_set pom:relativePath ../pgjdbc-parent-poms/pgjdbc-core-parent pgjdbc
638612
%pom_xpath_remove "pom:plugin[pom:artifactId = 'maven-shade-plugin']" pgjdbc
638612
638612
# compat symlink: requested by dtardon (libreoffice), reverts part of
638612
# 0af97ce32de877 commit.
638612
%mvn_file org.postgresql:postgresql %{name}/postgresql %{name} postgresql
638612
638612
# Parent POMs should not be installed.
638612
%mvn_package ":*{parent,versions,prevjre}*" __noinstall
638612
638612
# For compat reasons, make Maven artifact available under older coordinates.
638612
%mvn_alias org.postgresql:postgresql postgresql:postgresql
638612
638612
# Hack #1!  This directory is missing for some reason, it is most probably some
638612
# misunderstanding between maven, maven-compiler-plugin and
638612
# java-comment-preprocessor?  Not solved yet.  See rhbz#1325060.
638612
mkdir -p pgjdbc/target/generated-sources/annotations
638612
638612
638612
%build
638612
# Ideally we would run "sh update-translations.sh" here, but that results
638612
# in inserting the build timestamp into the generated messages_*.class
638612
# files, which makes rpmdiff complain about multilib conflicts if the
638612
# different platforms don't build in the same minute.  For now, rely on
638612
# upstream to have updated the translations files before packaging.
638612
638612
# Include PostgreSQL testing methods and variables.
638612
%if %runselftest
638612
%postgresql_tests_init
638612
638612
PGTESTS_LOCALE=C.UTF-8
638612
638612
cat <<EOF > build.local.properties
638612
server=localhost
638612
port=$PGTESTS_PORT
638612
database=test
638612
username=test
638612
password=test
638612
privilegedUser=$PGTESTS_ADMIN
638612
privilegedPassword=$PGTESTS_ADMINPASS
638612
preparethreshold=5
638612
loglevel=0
638612
protocolVersion=0
638612
EOF
638612
638612
# Start the local PG cluster.
638612
%postgresql_tests_start
638612
%else
638612
# -f is equal to -Dmaven.test.skip=true
638612
opts="-f"
638612
%endif
638612
638612
%mvn_build $opts -- %pgjdbc_mvn_options
638612
638612
638612
%install
638612
%mvn_install
638612
638612
638612
%files -f .mfiles
638612
%license LICENSE
638612
%doc README.md
638612
638612
638612
%files javadoc -f .mfiles-javadoc
638612
%license LICENSE
638612
638612
638612
%changelog
638612
* Wed Jul 22 2020 Ondrej Dubaj <odubaj@redhat.com> - 42.2.3-3
638612
- fixed XXE vulnerability unit test
638612
638612
* Tue Jul 14 2020 Ondrej Dubaj <odubaj@redhat.com> - 42.2.3-2
638612
- fixed XXE vulnerability (CVE-2020-13692)
638612
638612
* Fri Jul 13 2018 Pavel Raiskup <praiskup@redhat.com> - 42.2.3-1
638612
- new upstream release (rhbz#1600759)
638612
638612
* Wed May 30 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 42.2.2-2
638612
- Remove and obsolete parent-poms subpackage
638612
638612
* Fri Apr 20 2018 Pavel Raiskup <praiskup@redhat.com> - 42.2.2-2
638612
- provide postgresql.jar, as that's the upstream's artifactId
638612
638612
* Fri Apr 13 2018 Pavel Raiskup <praiskup@redhat.com> - 42.2.2-1
638612
- rebase to latest upstream release
638612
638612
* Fri Apr 13 2018 Pavel Raiskup <praiskup@redhat.com> - 42.2.0-1
638612
- rebase to the latest upstream release
638612
- nicer github source urls
638612
- sync with upstream spec
638612
- use new postgresql testing macros (rawhide only)
638612
- depend on postgresql-test-rpm-macros
638612
638612
* Wed Aug 23 2017 Pavel Raiskup <praiskup@redhat.com> - 42.1.4-1
638612
- rebase to latest upstream release
638612
638612
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 9.4.1212-4
638612
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
638612
638612
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 9.4.1212-3
638612
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
638612
638612
* Thu Dec 22 2016 Pavel Raiskup <praiskup@redhat.com> - 9.4.1212-2
638612
- Disable unpredictable test to fix FTBFS (BZ#1406931),
638612
  patch by Merlin Mathesius
638612
638612
* Thu Nov 03 2016 Pavel Raiskup <praiskup@redhat.com> - 9.4.1212-1
638612
- new release, rhbz#1377317, per announcement:
638612
  https://www.postgresql.org/message-id/CAB=Je-FjbvQ_MmAGmhZ-1sSMnodpjr9Uz6Q=faxqCxOvpRO-UQ@mail.gmail.com
638612
638612
* Tue Oct 04 2016 Pavel Raiskup <praiskup@redhat.com> - 9.4.1210-2
638612
- depend on test macros from postgresql-setup
638612
638612
* Thu Sep 08 2016 Pavel Raiskup <praiskup@redhat.com> - 9.4.1210-1
638612
- new release, rhbz#1374106, per announcement:
638612
  https://www.postgresql.org/message-id/CAB=Je-FzuqwDXLTT62VfzvTUhR4QTfLjmw2D5QfgaykDkhW7nw@mail.gmail.com
638612
638612
* Mon Aug 29 2016 Pavel Raiskup <praiskup@redhat.com> - 9.4.1209-6
638612
- fix License, pgjdbc is BSD only
638612
638612
* Thu Jul 21 2016 gil cattaneo <puntogil@libero.it> 9.4.1209-5
638612
- fix postgresql-jdbc.jar symlink using javapackages macros
638612
- adapt to current guideline
638612
- install doc and license file in parent-poms sub package
638612
- simplified runselftest check
638612
638612
* Wed Jul 20 2016 Pavel Raiskup <praiskup@redhat.com> - 9.4.1209-4
638612
- restore one compat symlink
638612
638612
* Wed Jul 20 2016 Pavel Raiskup <praiskup@redhat.com> - 9.4.1209-3
638612
- bump: for Mikolaj's fixes
638612
638612
* Wed Jul 20 2016 Pavel Raiskup <praiskup@redhat.com> - 9.4.1209-2
638612
- update to latest release version, thanks to Pavel Kajaba, Michael Simacek and
638612
  Vladimir Sitnikov for big help
638612
- fix Provides, remove old compatibility hacks
638612
638612
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 9.4.1200-3
638612
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
638612
638612
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.4.1200-2
638612
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
638612
638612
* Wed Feb 04 2015 Pavel Raiskup <praiskup@redhat.com> - 9.4.1200-1
638612
- rebase to most recent version (#1188827)
638612
638612
* Mon Jul 14 2014 Pavel Raiskup <praiskup@redhat.com> - 9.3.1102-1
638612
- Rebase to most recent version (#1118667)
638612
- revert back upstream commit for travis build
638612
638612
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.3.1101-4
638612
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
638612
638612
* Mon May 19 2014 Pavel Raiskup <praiskup@redhat.com> - 9.3.1101-3
638612
- run upstream testsuite when '%%runselftest' defined
638612
638612
* Wed Apr 23 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 9.3.1101-2
638612
- Add explicit requires on java-headless
638612
638612
* Wed Apr 23 2014 Pavel Raiskup <praiskup@redhat.com> - 9.3.1101-1
638612
- Rebase to most recent version (#1090366)
638612
638612
* Fri Mar 28 2014 Michael Simacek <msimacek@redhat.com> - 9.2.1002-5
638612
- Use Requires: java-headless rebuild (#1067528)
638612
638612
* Tue Aug 06 2013 Pavel Raiskup <praiskup@redhat.com> - 9.2.1002-4
638612
- add javadoc subpackage
638612
638612
* Tue Aug 06 2013 Pavel Raiskup <praiskup@redhat.com> - 9.2.1002-4
638612
- don't use removed macro %%add_to_maven_depmap (#992816)
638612
- lint: trim-lines, reuse %%{name} macro, fedora-review fixes
638612
- merge cleanup changes by Stano Ochotnicky
638612
638612
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.2.1002-3
638612
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
638612
638612
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.2.1002-2
638612
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
638612
638612
* Wed Nov 14 2012 Tom Lane <tgl@redhat.com> 9.2.1002-1
638612
- Update to build 9.2-1002 (just to correct mispackaging of source tarball)
638612
638612
* Tue Nov 13 2012 Tom Lane <tgl@redhat.com> 9.2.1001-1
638612
- Update to build 9.2-1001 for compatibility with PostgreSQL 9.2
638612
638612
* Sun Jul 22 2012 Tom Lane <tgl@redhat.com> 9.1.902-1
638612
- Update to build 9.1-902
638612
638612
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.1.901-4
638612
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
638612
638612
* Thu Feb 23 2012 Tom Lane <tgl@redhat.com> 9.1.901-3
638612
- Change BuildRequires: java-1.6.0-openjdk-devel to just java-devel.
638612
  As of 9.1-901, upstream has support for JDBC4.1, so we don't have to
638612
  restrict to JDK6 anymore, and Fedora is moving to JDK7
638612
Resolves: #796580
638612
638612
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.1.901-2
638612
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
638612
638612
* Mon Sep 12 2011 Tom Lane <tgl@redhat.com> 9.1.901-1
638612
- Update to build 9.1-901 for compatibility with PostgreSQL 9.1
638612
638612
* Mon Aug 15 2011 Tom Lane <tgl@redhat.com> 9.0.801-4
638612
- Add BuildRequires: java-1.6.0-openjdk-devel to ensure we have recent JDK
638612
Related: #730588
638612
- Remove long-obsolete minimum versions from BuildRequires
638612
638612
* Sun Jul 17 2011 Tom Lane <tgl@redhat.com> 9.0.801-3
638612
- Switch to non-GCJ build, since GCJ is now deprecated in Fedora
638612
Resolves: #722247
638612
- Use %%{_mavendepmapfragdir} to fix FTBFS with maven 3
638612
638612
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.0.801-2
638612
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
638612
638612
* Wed Dec 29 2010 Tom Lane <tgl@redhat.com> 9.0.801-1
638612
- Update to build 9.0-801
638612
638612
* Mon May 31 2010 Tom Lane <tgl@redhat.com> 8.4.701-4
638612
- Update gcj_support sections to meet Packaging/GCJGuidelines;
638612
  fixes FTBFS in F-14 rawhide
638612
638612
* Tue Nov 24 2009 Tom Lane <tgl@redhat.com> 8.4.701-3
638612
- Seems the .pom file *must* have a package version number in it, sigh
638612
Resolves: #538487
638612
638612
* Mon Nov 23 2009 Tom Lane <tgl@redhat.com> 8.4.701-2
638612
- Add a .pom file to ease use by maven-based packages (courtesy Deepak Bhole)
638612
Resolves: #538487
638612
638612
* Tue Aug 18 2009 Tom Lane <tgl@redhat.com> 8.4.701-1
638612
- Update to build 8.4-701
638612
638612
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:8.3.603-4
638612
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
638612
638612
* Tue Apr 21 2009 Tom Lane <tgl@redhat.com> 8.3.603-3
638612
- Avoid multilib conflict caused by overeager attempt to rebuild translations
638612
638612
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:8.3.603-2.1
638612
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
638612
638612
* Wed Jul  9 2008 Tom "spot" Callaway <tcallawa@redhat.com> 8.3.603-1.1
638612
- drop repotag
638612
638612
* Tue Feb 12 2008 Tom Lane <tgl@redhat.com> 8.3.603-1jpp
638612
- Update to build 8.3-603
638612
638612
* Sun Aug 12 2007 Tom Lane <tgl@redhat.com> 8.2.506-1jpp
638612
- Update to build 8.2-506
638612
638612
* Tue Apr 24 2007 Tom Lane <tgl@redhat.com> 8.2.505-1jpp
638612
- Update to build 8.2-505
638612
- Work around 1.4 vs 1.5 versioning inconsistency
638612
638612
* Fri Dec 15 2006 Tom Lane <tgl@redhat.com> 8.2.504-1jpp
638612
- Update to build 8.2-504
638612
638612
* Wed Aug 16 2006 Tom Lane <tgl@redhat.com> 8.1.407-1jpp.4
638612
- Fix Requires: for rebuild-gcj-db (bz #202544)
638612
638612
* Wed Aug 16 2006 Fernando Nasser <fnasser@redhat.com> 8.1.407-1jpp.3
638612
- Merge with upstream
638612
638612
* Sat Jul 22 2006 Jakub Jelinek <jakub@redhat.com> 8.1.407-1jpp.2
638612
- Rebuilt
638612
638612
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 0:8.1.407-1jpp.1
638612
- rebuild
638612
638612
* Wed Jun 14 2006 Tom Lane <tgl@redhat.com> 8.1.407-1jpp
638612
- Update to build 8.1-407
638612
638612
* Mon Mar 27 2006 Tom Lane <tgl@redhat.com> 8.1.405-2jpp
638612
- Back-patch upstream fix to support unspecified-type strings.
638612
638612
* Thu Feb 16 2006 Tom Lane <tgl@redhat.com> 8.1.405-1jpp
638612
- Split postgresql-jdbc into its own SRPM (at last).
638612
- Build it from source.  Add support for gcj compilation.