mysql-connector-java/mysql-connector-java.spec

133 lines
4.4 KiB
RPMSpec

#
# spec file for package mysql-connector-java
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: mysql-connector-java
Version: 5.1.42
Release: 0
Summary: Official JDBC Driver for MySQL
License: GPL-2.0+
Group: Development/Libraries/Java
Url: http://dev.mysql.com/downloads/connector/j/
Source0: %{name}-%{version}-suse.tar.xz
# 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
# PATCH-FIX-UPSTREAM: do not lose classpath during tests build
Patch4: use-classpath-in-tests.patch
BuildRequires: ant
BuildRequires: ant-contrib
BuildRequires: apache-commons-logging
BuildRequires: geronimo-jta-1_1-api
BuildRequires: java-devel >= 1.6.0
BuildRequires: javapackages-tools
BuildRequires: junit
BuildRequires: log4j-mini
BuildRequires: slf4j
BuildRequires: xz
Requires: jta >= 1.0
Requires: log4j
Requires: slf4j
Provides: mm.mysql = %{version}
Obsoletes: mm.mysql < %{version}
# manual is no longer distributed
Provides: %{name}-manual = %{version}
Obsoletes: %{name}-manual < %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
MySQL Connector/J is a native Java driver that converts JDBC (Java
Database Connectivity) calls into the network protocol used by the
MySQL database. It lets developers working with the Java programming
language easily build programs and applets that interact with MySQL and
connect all corporate data, even in a heterogeneous environment. MySQL
Connector/J is a Type IV JDBC driver and has a complete JDBC feature
set that supports the capabilities of MySQL.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
# dup
rm -f README
# wrong end of line encoding
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 hibernate4 integration
rm -rf src/com/mysql/fabric/hibernate
rm -rf src/demo
export CLASSPATH=$(build-classpath \
ant-contrib \
commons-logging \
slf4j \
jdbc-stdext\
jta \
junit \
log4j)
ant \
-Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 \
-DbuildDir=build-mysql-jdbc \
-DdistDir=dist-mysql-jdbc \
-Dcom.mysql.jdbc.jdk6.javac="%{javac}" \
-Dcom.mysql.jdbc.jdk6.java="%{java}" \
dist
%install
install -d -m 755 %{buildroot}%{_javadir}
install ./build-mysql-jdbc/%{name}-%{version}-SNAPSHOT/%{name}-%{version}-SNAPSHOT-bin.jar \
%{buildroot}%{_javadir}/%{name}.jar
rm -rf %{buildroot}%{name}-%{version}/docs/release-test-output
# Install the Maven build information
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -pm 644 src/doc/sources/pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
sed -i 's/>@.*</>%{version}</' %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap JPP-%{name}.pom %{name}.jar
%files
%defattr(0644,root,root,0755)
%doc CHANGES COPYING README.txt
%attr(0644,root,root) %{_javadir}/%{name}.jar
%config(noreplace) %{_datadir}/maven-metadata/%{name}.xml*
%{_mavenpomdir}/*.pom
%changelog