1
0
mysql-connector-java/mysql-connector-java.spec
Stephan Kulow 1a8db28968 Accepting request 116436 from Java:packages
- remove the docs/ from source tarball due license issues

- update to 5.1.19
  * plugable authentication via com.mysql.jdbc.AuthenticationPlugin
  * retrieve servet charset name using index
  * ability to determine if the connection is against server on the same host
  * added slf4j logging adapter
  * and many more features and bugfixes
- removed -javadoc patch and package
- add maven pom

OBS-URL: https://build.opensuse.org/request/show/116436
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mysql-connector-java?expand=0&rev=12
2012-05-21 06:06:41 +00:00

141 lines
4.6 KiB
RPMSpec

#
# spec file for package mysql-connector-java
#
# Copyright (c) 2012 SUSE LINUX Products 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/
#
# icecream 0
%define section free
%define builddir build-mysql-jdbc
%define distdir dist-mysql-jdbc
%define with_jboss4 0
Name: mysql-connector-java
Summary: Official JDBC Driver for MySQL
License: GPL-2.0+
Group: Development/Libraries/Java
Version: 5.1.19
Release: 0
# docs are now under very strict proprietary license by Oracle, so lets not distribute them
# tar -xf %{name}-%{version}.tar.gz
# rm -rf %{name}-%{version}/docs %{name}-%{version}/%{name}-%{version}-bin.jar
# tar -xJf %{name}-%{version}-suse.tar.xz
Source0: %{name}-%{version}-suse.tar.xz
Patch2: %{name}-5.1.6-java6-compatibility.patch
Patch3: %{name}-5.1.6-disableJDBC4.patch
#PATCH-FIX-SUSE: inform users about fact the documentation is not distributed anymore
Patch4: mysql-connector-java-suse-docs.patch
Url: http://www.mysql.com/downloads/api-jdbc-stable.html
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
BuildRequires: ant
BuildRequires: ant-contrib
BuildRequires: apache-commons-logging
BuildRequires: java-devel
BuildRequires: slf4j
#!BuildIgnore: maven2-bootstrap
%if %{with_jboss4}
BuildRequires: jboss4-common
BuildRequires: jboss4-connector
%endif
BuildRequires: jpackage-utils
BuildRequires: junit
BuildRequires: log4j-mini
Requires: log4j
Provides: mm.mysql = %{version}
Obsoletes: mm.mysql < %{version}
# manual is no longer distributed
Provides: %{name}-manual = %{version}
Obsoletes: %{name}-manual < %{version}
%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 -n %{name}-%{version}
# patch only for javac 1.6.0
if [[ "$(javac -version 2>&1 | grep '1\.6\.0')" != "" ]]; then
%patch2 -b .sav2
fi
%patch3
%patch4 -p1
# remove all binary libs
find . \( -name "*.jar" -o -name "*.class" \) | xargs -t %{__rm} -f
%if ! %{with_jboss4}
rm -r src/com/mysql/jdbc/integration/jboss/
rm -r src/testsuite/regression/DataSourceRegressionTest.java
%endif
# dup
rm -f README
# wrong end of line encoding
sed -i -e 's/.$//' README.txt
%build
# jboss jars needed for test suite
export CLASSPATH="$(build-classpath ant-contrib \
commons-logging slf4j \
%if %{with_jboss4}
jboss4/jboss-common-jdbc-wrapper \
%endif
jdbc-stdext jta \
junit log4j xml-commons-jaxp-1.3-apis)"
ant -Dant.build.javac.source=1.6 \
-Dant.build.javac.target=1.6 \
-DbuildDir="%{builddir}" \
-DdistDir="%{distdir}" \
-Dcom.mysql.jdbc.java6.javac="%{javac}" \
-Dcom.mysql.jdbc.java6.rtjar="%{java_home}/jre/lib/rt.jar" \
dist
%install
install -d -m 755 %{buildroot}%{_javadir}
install ./build-mysql-jdbc/%{name}-%{version}-SNAPSHOT/%{name}-%{version}-SNAPSHOT-bin.jar \
%{buildroot}%{_javadir}/%{name}-%{version}.jar
(
cd %{buildroot}%{_javadir} && \
for jar in *-%{version}*.jar; do
%{__ln_s} -f ${jar} `echo $jar | %{__sed} "s|-%{version}||g"`
done
)
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_to_maven_depmap mysql %{name} %{version} JPP %{name}
%clean
%{__rm} -rf $RPM_BUILD_ROOT
%files
%defattr(0644,root,root,0755)
%doc CHANGES COPYING
%attr(0644,root,root) %{_javadir}/*.jar
%config(noreplace) %{_mavendepmapfragdir}/*
%{_mavenpomdir}/*.pom
%changelog