445e50
# Copyright (c) 2000-2005, JPackage Project
445e50
# All rights reserved.
445e50
#
445e50
# Redistribution and use in source and binary forms, with or without
445e50
# modification, are permitted provided that the following conditions
445e50
# are met:
445e50
#
445e50
# 1. Redistributions of source code must retain the above copyright
445e50
#    notice, this list of conditions and the following disclaimer.
445e50
# 2. Redistributions in binary form must reproduce the above copyright
445e50
#    notice, this list of conditions and the following disclaimer in the
445e50
#    documentation and/or other materials provided with the
445e50
#    distribution.
445e50
# 3. Neither the name of the JPackage Project nor the names of its
445e50
#    contributors may be used to endorse or promote products derived
445e50
#    from this software without specific prior written permission.
445e50
#
445e50
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
445e50
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
445e50
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
445e50
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
445e50
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
445e50
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
445e50
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
445e50
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
445e50
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
445e50
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
445e50
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
445e50
#
445e50
445e50
%global section		devel
445e50
%global upstreamver	9.2-1002
445e50
445e50
Summary:	JDBC driver for PostgreSQL
445e50
Name:		postgresql-jdbc
445e50
Version:	9.2.1002
86fbe1
Release:	8%{?dist}
445e50
# ASL 2.0 applies only to postgresql-jdbc.pom file, the rest is BSD
445e50
License:	BSD and ASL 2.0
445e50
Group:		Applications/Databases
445e50
URL:		http://jdbc.postgresql.org/
445e50
445e50
Source0:	http://jdbc.postgresql.org/download/%{name}-%{upstreamver}.src.tar.gz
445e50
# originally http://repo2.maven.org/maven2/postgresql/postgresql/8.4-701.jdbc4/postgresql-8.4-701.jdbc4.pom:
445e50
Source1:	%{name}.pom
445e50
7ef03e
# patches are self-documented inside the files
7ef03e
Patch1:		postgresql-jdbc-9.2.1002-version-compare.patch
7ef03e
Patch2:		postgresql-jdbc-9.2.1002-getIndexInfo-and-9.6-server.patch
86fbe1
Patch3:		fix-XXE-vulnerability.patch
7ef03e
445e50
BuildArch:	noarch
86fbe1
BuildRequires:	java-1.7.0-openjdk-devel
86fbe1
BuildRequires:	java-1.7.0-openjdk
445e50
BuildRequires:	jpackage-utils
445e50
BuildRequires:	ant
445e50
BuildRequires:	ant-junit
445e50
BuildRequires:	junit
445e50
# gettext is only needed if we try to update translations
445e50
#BuildRequires:	gettext
7ef03e
Requires:	java-headless
445e50
Requires:	jpackage-utils
445e50
445e50
%description
445e50
PostgreSQL is an advanced Object-Relational database management
445e50
system. The postgresql-jdbc package includes the .jar files needed for
445e50
Java programs to access a PostgreSQL database.
445e50
445e50
%package javadoc
445e50
Summary:        API docs for %{name}
445e50
Group:          Documentation
445e50
445e50
%description javadoc
445e50
This package contains the API Documentation for %{name}.
445e50
445e50
%prep
445e50
%setup -c -q
445e50
mv -f %{name}-%{upstreamver}.src/* .
445e50
rm -f %{name}-%{upstreamver}.src/.gitignore
445e50
rmdir %{name}-%{upstreamver}.src
445e50
7ef03e
%patch1 -p1 -b .version
7ef03e
%patch2 -p1 -b .getIndexInfo
86fbe1
%patch3 -p1
7ef03e
445e50
# remove any binary libs
445e50
find -name "*.jar" -or -name "*.class" | xargs rm -f
445e50
445e50
%build
445e50
export OPT_JAR_LIST="ant/ant-junit junit"
445e50
export CLASSPATH=
445e50
445e50
# Ideally we would run "sh update-translations.sh" here, but that results
445e50
# in inserting the build timestamp into the generated messages_*.class
445e50
# files, which makes rpmdiff complain about multilib conflicts if the
445e50
# different platforms don't build in the same minute.  For now, rely on
445e50
# upstream to have updated the translations files before packaging.
445e50
445e50
ant jar publicapi
445e50
445e50
%install
445e50
install -d $RPM_BUILD_ROOT%{_javadir}
445e50
# Per jpp conventions, jars have version-numbered names and we add
445e50
# versionless symlinks.
445e50
install -m 644 jars/postgresql.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
445e50
445e50
pushd $RPM_BUILD_ROOT%{_javadir}
445e50
# Also, for backwards compatibility with our old postgresql-jdbc packages,
445e50
# add these symlinks.  (Probably only the jdbc3 symlink really makes sense?)
445e50
ln -s postgresql-jdbc.jar postgresql-jdbc2.jar
445e50
ln -s postgresql-jdbc.jar postgresql-jdbc2ee.jar
445e50
ln -s postgresql-jdbc.jar postgresql-jdbc3.jar
445e50
popd
445e50
445e50
# Install the pom after inserting the correct version number
445e50
sed 's/UPSTREAM_VERSION/%{upstreamver}/g' %{SOURCE1} >JPP-%{name}.pom
445e50
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}/
445e50
install -m 644 JPP-%{name}.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
445e50
%add_maven_depmap
445e50
445e50
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}
445e50
cp -ra build/publicapi $RPM_BUILD_ROOT%{_javadocdir}/%{name}
445e50
install -d build/publicapi docs/%{name}
445e50
445e50
%files -f .mfiles
445e50
%doc LICENSE README doc/*
445e50
%{_javadir}/%{name}2.jar
445e50
%{_javadir}/%{name}2ee.jar
445e50
%{_javadir}/%{name}3.jar
445e50
445e50
%files javadoc
445e50
%doc LICENSE
445e50
%doc %{_javadocdir}/%{name}
445e50
445e50
%changelog
86fbe1
* Tue Jul 28 2020 Ondrej Dubaj <odubaj@redhat.com> - 9.2.1002-8
86fbe1
- require explicitly jdk-1.7 due to ABI bytecode compatibility
86fbe1
86fbe1
* Fri Jul 24 2020 Ondrej Dubaj <odubaj@redhat.com> - 9.2.1002-7
86fbe1
- fixed XXE vulnerability (CVE-2020-13692)
86fbe1
7ef03e
* Fri Apr 20 2018 Pavel Raiskup <praiskup@redhat.com> - 9.2.1002-6
7ef03e
- fix incompatibility with 9.6+ (rhbz#1547424)
7ef03e
- it's unnecessary to depend on whole java (rhbz#1406931)
7ef03e
58071b
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 9.2.1002-5
58071b
- Mass rebuild 2013-12-27
58071b
445e50
* Tue Aug 06 2013 Pavel Raiskup <praiskup@redhat.com> - 9.2.1002-4
445e50
- add javadoc subpackage
445e50
445e50
* Tue Aug 06 2013 Pavel Raiskup <praiskup@redhat.com> - 9.2.1002-4
445e50
- don't use removed macro %%add_to_maven_depmap (#992816)
445e50
- lint: trim-lines, reuse %%{name} macro, fedora-review fixes
445e50
- merge cleanup changes by Stano Ochotnicky
445e50
445e50
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.2.1002-3
445e50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
445e50
445e50
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.2.1002-2
445e50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
445e50
445e50
* Wed Nov 14 2012 Tom Lane <tgl@redhat.com> 9.2.1002-1
445e50
- Update to build 9.2-1002 (just to correct mispackaging of source tarball)
445e50
445e50
* Tue Nov 13 2012 Tom Lane <tgl@redhat.com> 9.2.1001-1
445e50
- Update to build 9.2-1001 for compatibility with PostgreSQL 9.2
445e50
445e50
* Sun Jul 22 2012 Tom Lane <tgl@redhat.com> 9.1.902-1
445e50
- Update to build 9.1-902
445e50
445e50
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.1.901-4
445e50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
445e50
445e50
* Thu Feb 23 2012 Tom Lane <tgl@redhat.com> 9.1.901-3
445e50
- Change BuildRequires: java-1.6.0-openjdk-devel to just java-devel.
445e50
  As of 9.1-901, upstream has support for JDBC4.1, so we don't have to
445e50
  restrict to JDK6 anymore, and Fedora is moving to JDK7
445e50
Resolves: #796580
445e50
445e50
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.1.901-2
445e50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
445e50
445e50
* Mon Sep 12 2011 Tom Lane <tgl@redhat.com> 9.1.901-1
445e50
- Update to build 9.1-901 for compatibility with PostgreSQL 9.1
445e50
445e50
* Mon Aug 15 2011 Tom Lane <tgl@redhat.com> 9.0.801-4
445e50
- Add BuildRequires: java-1.6.0-openjdk-devel to ensure we have recent JDK
445e50
Related: #730588
445e50
- Remove long-obsolete minimum versions from BuildRequires
445e50
445e50
* Sun Jul 17 2011 Tom Lane <tgl@redhat.com> 9.0.801-3
445e50
- Switch to non-GCJ build, since GCJ is now deprecated in Fedora
445e50
Resolves: #722247
445e50
- Use %%{_mavendepmapfragdir} to fix FTBFS with maven 3
445e50
445e50
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.0.801-2
445e50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
445e50
445e50
* Wed Dec 29 2010 Tom Lane <tgl@redhat.com> 9.0.801-1
445e50
- Update to build 9.0-801
445e50
445e50
* Mon May 31 2010 Tom Lane <tgl@redhat.com> 8.4.701-4
445e50
- Update gcj_support sections to meet Packaging/GCJGuidelines;
445e50
  fixes FTBFS in F-14 rawhide
445e50
445e50
* Tue Nov 24 2009 Tom Lane <tgl@redhat.com> 8.4.701-3
445e50
- Seems the .pom file *must* have a package version number in it, sigh
445e50
Resolves: #538487
445e50
445e50
* Mon Nov 23 2009 Tom Lane <tgl@redhat.com> 8.4.701-2
445e50
- Add a .pom file to ease use by maven-based packages (courtesy Deepak Bhole)
445e50
Resolves: #538487
445e50
445e50
* Tue Aug 18 2009 Tom Lane <tgl@redhat.com> 8.4.701-1
445e50
- Update to build 8.4-701
445e50
445e50
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:8.3.603-4
445e50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
445e50
445e50
* Tue Apr 21 2009 Tom Lane <tgl@redhat.com> 8.3.603-3
445e50
- Avoid multilib conflict caused by overeager attempt to rebuild translations
445e50
445e50
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:8.3.603-2.1
445e50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
445e50
445e50
* Wed Jul  9 2008 Tom "spot" Callaway <tcallawa@redhat.com> 8.3.603-1.1
445e50
- drop repotag
445e50
445e50
* Tue Feb 12 2008 Tom Lane <tgl@redhat.com> 8.3.603-1jpp
445e50
- Update to build 8.3-603
445e50
445e50
* Sun Aug 12 2007 Tom Lane <tgl@redhat.com> 8.2.506-1jpp
445e50
- Update to build 8.2-506
445e50
445e50
* Tue Apr 24 2007 Tom Lane <tgl@redhat.com> 8.2.505-1jpp
445e50
- Update to build 8.2-505
445e50
- Work around 1.4 vs 1.5 versioning inconsistency
445e50
445e50
* Fri Dec 15 2006 Tom Lane <tgl@redhat.com> 8.2.504-1jpp
445e50
- Update to build 8.2-504
445e50
445e50
* Wed Aug 16 2006 Tom Lane <tgl@redhat.com> 8.1.407-1jpp.4
445e50
- Fix Requires: for rebuild-gcj-db (bz #202544)
445e50
445e50
* Wed Aug 16 2006 Fernando Nasser <fnasser@redhat.com> 8.1.407-1jpp.3
445e50
- Merge with upstream
445e50
445e50
* Sat Jul 22 2006 Jakub Jelinek <jakub@redhat.com> 8.1.407-1jpp.2
445e50
- Rebuilt
445e50
445e50
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 0:8.1.407-1jpp.1
445e50
- rebuild
445e50
445e50
* Wed Jun 14 2006 Tom Lane <tgl@redhat.com> 8.1.407-1jpp
445e50
- Update to build 8.1-407
445e50
445e50
* Mon Mar 27 2006 Tom Lane <tgl@redhat.com> 8.1.405-2jpp
445e50
- Back-patch upstream fix to support unspecified-type strings.
445e50
445e50
* Thu Feb 16 2006 Tom Lane <tgl@redhat.com> 8.1.405-1jpp
445e50
- Split postgresql-jdbc into its own SRPM (at last).
445e50
- Build it from source.  Add support for gcj compilation.