1
0

- Update to 5.1.35 (see CHANGES for full list of issues)

bnc#927981 CVE-2015-2575:
  * http://dev.mysql.com/doc/relnotes/connector-j/en/news-5-1.html
- Remove not applicable patch:
  * mysql-connector-java-7-jdbc-4.1.patch
- Do not explicitely check for jdk6 but be happy with 7 and 8:
  * jdk6-check-use-jdk7.patch
- Do not require hibernate4 to actually build:
  * extra-libs-build.patch
- Do not build jdk5 depending jdbc3:
  * no-jdk5-requirement.patch
- Add and rebase jdbc4.1 patch:
  * mysql-connector-java-jdbc-4.1.patch

OBS-URL: https://build.opensuse.org/package/show/Java:packages/mysql-connector-java?expand=0&rev=21
This commit is contained in:
Tomáš Chvátal 2015-04-21 17:01:55 +00:00 committed by Git OBS Bridge
parent a7b9db33d6
commit 0397197231
9 changed files with 1228 additions and 1189 deletions

66
extra-libs-build.patch Normal file
View File

@ -0,0 +1,66 @@
Index: mysql-connector-java-5.1.35/build.xml
===================================================================
--- mysql-connector-java-5.1.35.orig/build.xml
+++ mysql-connector-java-5.1.35/build.xml
@@ -449,7 +449,7 @@ Java 6 (for JDBC4+ implementation) is al
<!-- Add commercial license configuration class (Build). -->
- <target name="-init-filter-license" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.filterLicense">
+ <target name="-init-filter-license" depends="-init-copy" if="com.mysql.jdbc.filterLicense">
<copy file="${com.mysql.jdbc.extra.libs}/CommercialLicenseConfiguration.notjava"
toFile="${buildDir}/${fullProdName}/com/mysql/jdbc/LicenseConfiguration.java"
overwrite="true" />
@@ -457,7 +457,7 @@ Java 6 (for JDBC4+ implementation) is al
<!-- Add no-crypto export control class (Build). -->
- <target name="-init-no-crypto" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.noCryptoBuild">
+ <target name="-init-no-crypto" depends="-init-copy" if="com.mysql.jdbc.noCryptoBuild">
<copy file="${com.mysql.jdbc.extra.libs}/ExportControlledNoCrypto.notjava"
toFile="${buildDir}/${fullProdName}/com/mysql/jdbc/ExportControlled.java"
overwrite="true" />
@@ -465,7 +465,7 @@ Java 6 (for JDBC4+ implementation) is al
<!-- Copy commercial license configuration class (Package). -->
- <target name="-copy-filter-license" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.filterLicense">
+ <target name="-copy-filter-license" depends="-init-copy" if="com.mysql.jdbc.filterLicense">
<copy file="${com.mysql.jdbc.extra.libs}/CommercialLicenseConfiguration.notjava"
toFile="${packageDest}/src/com/mysql/jdbc/LicenseConfiguration.java"
overwrite="true" />
@@ -473,7 +473,7 @@ Java 6 (for JDBC4+ implementation) is al
<!-- Copy no-crypto export control class (Package). -->
- <target name="-copy-no-crypto" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.noCryptoBuild">
+ <target name="-copy-no-crypto" depends="-init-copy" if="com.mysql.jdbc.noCryptoBuild">
<copy file="${com.mysql.jdbc.extra.libs}/ExportControlledNoCrypto.notjava"
toFile="${packageDest}/src/com/mysql/jdbc/ExportControlled.java"
overwrite="true" />
@@ -481,7 +481,7 @@ Java 6 (for JDBC4+ implementation) is al
<!-- Copy README-commercial info (Package). -->
- <target name="-copy-license-commercial" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.commercialBuild">
+ <target name="-copy-license-commercial" depends="-init-copy" if="com.mysql.jdbc.commercialBuild">
<copy file="${com.mysql.jdbc.extra.libs}/README-commercial" tofile="${packageDest}/README.txt" filtering="true">
<filterset refid="versionFilterset" />
<filterset refid="licenseFilterset" />
@@ -500,7 +500,7 @@ Java 6 (for JDBC4+ implementation) is al
<!-- Copy LICENCE.mysql and replace license commercial headers (Package). -->
- <target name="-replace-license-commercial" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.commercialBuild">
+ <target name="-replace-license-commercial" depends="-init-copy" if="com.mysql.jdbc.commercialBuild">
<delete file="${packageDest}/COPYING" />
<copy file="${com.mysql.jdbc.extra.libs}/LICENSE.mysql" toDir="${packageDest}" />
@@ -773,6 +773,7 @@ Java 6 (for JDBC4+ implementation) is al
compiler="modern"
includeantruntime="false">
<include name="**/*.java" />
+ <exclude name="demo/**" />
<exclude name="testsuite/**" />
<exclude name="com/mysql/jdbc/integration/**" />
<exclude name="com/mysql/jdbc/log/Log4JLogger.java" />

15
generate-tarball.sh Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
VERSION=$1
rm -rf mysql-connector-java-$VERSION
tar xfz mysql-connector-java-$VERSION.tar.gz || exit 1
find mysql-connector-java-$VERSION -name '*.jar' -exec rm {} \; -o -name '*.zip' -exec rm {} \;
tar cfJ mysql-connector-java-$VERSION-suse.tar.xz mysql-connector-java-$VERSION || exit 1
rm -rf mysql-connector-java-$VERSION
exit 0

16
jdk6-check-use-jdk7.patch Normal file
View File

@ -0,0 +1,16 @@
Index: mysql-connector-java-5.1.35/build.xml
===================================================================
--- mysql-connector-java-5.1.35.orig/build.xml
+++ mysql-connector-java-5.1.35/build.xml
@@ -267,10 +267,7 @@ Java 6 (for JDBC4+ implementation) is al
<fail message="Java 6 (for JDBC4+ implementation) is required. Set the full path to this JDK home with the property 'com.mysql.jdbc.jdk6'. Default: '/usr/lib/jvm/jdk1.6'.">
<condition>
<not>
- <and>
- <equals arg1="${jdk6checkexitstatus}" arg2="0" />
- <contains string="${com.mysql.jdbc.jdk6.version}" substring="java version &quot;1.6" casesensitive="true" />
- </and>
+ <equals arg1="${jdk6checkexitstatus}" arg2="0" />
</not>
</condition>
</fail>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:37a31f6afea8ce3b4c382dd0b0e93b284bdbb3e9c7180919581c0fbfdf551260
size 1336544

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9c2e0805b8e40d6b09b5dccfaf0f071d6e35470d7c392d019feddf885c1fe5d0
size 1432996

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Tue Apr 21 15:22:44 UTC 2015 - tchvatal@suse.com
- Update to 5.1.35 (see CHANGES for full list of issues)
bnc#927981 CVE-2015-2575:
* http://dev.mysql.com/doc/relnotes/connector-j/en/news-5-1.html
- Remove not applicable patch:
* mysql-connector-java-7-jdbc-4.1.patch
- Do not explicitely check for jdk6 but be happy with 7 and 8:
* jdk6-check-use-jdk7.patch
- Do not require hibernate4 to actually build:
* extra-libs-build.patch
- Do not build jdk5 depending jdbc3:
* no-jdk5-requirement.patch
- Add and rebase jdbc4.1 patch:
* mysql-connector-java-jdbc-4.1.patch
-------------------------------------------------------------------
Wed Mar 18 09:46:18 UTC 2015 - tchvatal@suse.com

View File

@ -17,32 +17,31 @@
Name: mysql-connector-java
Version: 5.1.25
Version: 5.1.35
Release: 0
Summary: Official JDBC Driver for MySQL
License: GPL-2.0+
Group: Development/Libraries/Java
Url: http://www.mysql.com/downloads/api-jdbc-stable.html
# url-for-download: http://dev.mysql.com/get/Downloads/Connector-J/%{name}-%{version}.zip/from/pick#mirrors
# docs are now under very strict proprietary license by Oracle, so lets not distribute them
# remove bundled jars as well
# tar -xf %{name}-%{version}.tar.gz
# rm -rf %{name}-%{version}/docs
# find %{name}-%{version} -name '*jar' -delete
# tar -xJf %{name}-%{version}-suse.tar.xz
Url: http://dev.mysql.com/downloads/connector/j/
Source0: %{name}-%{version}-suse.tar.xz
# Patch to build Java 7/jdbc 4.1
Patch0: mysql-connector-java-7-jdbc-4.1.patch
# Script to repack upstream tarball
# ./generate-tarball.sh VERSION
Source99: generate-tarball.sh
# PATCH-FIX-UPSTREAM: do not strictly require jdk6 to compile
Patch0: jdk6-check-use-jdk7.patch
# PATCH-FIX-UPSTREAM: do not require hibernate4 to actually just build
Patch1: extra-libs-build.patch
# PATCH-FIX-SUSE: do not build jdbc3 driver needing too old java
Patch2: no-jdk5-requirement.patch
# PATCH-FIX-UPSTREAM: build with jdbc4.1 and also with new javac
Patch3: mysql-connector-java-jdbc-4.1.patch
BuildRequires: ant
BuildRequires: ant-contrib
BuildRequires: apache-commons-logging
#BuildRequires: jta >= 1.0
BuildRequires: geronimo-jta-1_1-api
#BuildRequires: java-1_5_0-gcj-compat-devel
BuildRequires: java-devel >= 1.6.0
BuildRequires: javapackages-tools
BuildRequires: junit
#!BuildIgnore: maven2-bootstrap
BuildRequires: log4j-mini
BuildRequires: slf4j
BuildRequires: xz
@ -69,6 +68,9 @@ set that supports the capabilities of MySQL.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
# dup
rm -f README
@ -76,13 +78,15 @@ rm -f README
sed -i -e 's/.$//' README.txt
%build
# disable jboss integration
rm -rf src/com/mysql/jdbc/integration/jboss
rm src/testsuite/regression/ConnectionRegressionTest.java
rm src/testsuite/regression/DataSourceRegressionTest.java
rm src/testsuite/simple/ReadOnlyCallableStatementTest.java
rm src/testsuite/simple/jdbc4/StatementsTest.java
# disable hibernate integration
rm -rf src/com/mysql/fabric/hibernate
rm -rf src/demo
export CLASSPATH=$(build-classpath \
ant-contrib \
@ -93,16 +97,12 @@ export CLASSPATH=$(build-classpath \
junit \
log4j)
# we need jdk5 for jdbc3.0
# XXX: JAVA_HOME must be setup **after** CLASSPATH
#export JAVA_HOME=%{_libdir}/jvm/java-1.5.0-gcj
ant \
-Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 \
-DbuildDir=build-mysql-jdbc \
-DdistDir=dist-mysql-jdbc \
-Dcom.mysql.jdbc.java6.javac="%{javac}" \
-Dcom.mysql.jdbc.java6.java="%{java}" \
-Dcom.mysql.jdbc.java6.rtjar"=%{java_home}/jre/lib/rt.jar"
-Dcom.mysql.jdbc.jdk6.javac="%{javac}" \
-Dcom.mysql.jdbc.jdk6.java="%{java}"
%install
install -d -m 755 %{buildroot}%{_javadir}

31
no-jdk5-requirement.patch Normal file
View File

@ -0,0 +1,31 @@
Index: mysql-connector-java-5.1.35/build.xml
===================================================================
--- mysql-connector-java-5.1.35.orig/build.xml
+++ mysql-connector-java-5.1.35/build.xml
@@ -219,7 +219,7 @@ com.mysql.jdbc.noCleanBetweenCompiles=ye
<!-- Check for required JDKs for compilation. -->
- <target name="-compiler-check" depends="-jdk5-check, -jdk6-check" />
+ <target name="-compiler-check" depends="-jdk6-check" />
<!-- Check for required JDK5 for compilation of JDBC3 implementation. -->
@@ -756,7 +756,7 @@ Java 6 (for JDBC4+ implementation) is al
<!-- Compile the driver including JDBC3 and JDBC4+ implementations only. -->
<target name="compile-driver"
description="Compiles driver including JDBC3 and JDBC4+ implementations only."
- depends="-compile-driver-jdbc3, -compile-driver-jdbc4" />
+ depends="-compile-driver-jdbc4" />
<!-- Compile JDBC3 implementation. -->
@@ -786,7 +786,7 @@ Java 6 (for JDBC4+ implementation) is al
<!-- Compile JDBC4+ implementation. -->
- <target name="-compile-driver-jdbc4" depends="-compile-driver-jdbc3">
+ <target name="-compile-driver-jdbc4" depends="init, -clean-output">
<echo>Compiling MySQL Connector/J JDBC4+ implementation with '${com.mysql.jdbc.jdk6}' to '${compiler.output}'</echo>
<javac sourcepath=""