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

205 lines
6.8 KiB
RPMSpec
Raw Normal View History

#
# spec file for package mysql-connector-java (Version 5.1.6)
#
# Copyright (c) 2008 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/
#
# norootforbuild
# 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
Version: 5.1.6
Release: 1
License: GPL v2 or later
Group: Development/Libraries/Java
Source0: %{name}-%{version}.tar.bz2
Patch1: %{name}-target-javadoc.patch
Patch2: %{name}-%{version}-java6-compatibility.patch
Patch3: %{name}-%{version}-disableJDBC4.patch
Url: http://www.mysql.com/downloads/api-jdbc-stable.html
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
BuildRequires: ant
BuildRequires: ant-contrib
BuildRequires: java-devel
BuildRequires: jakarta-commons-logging
%if %{with_jboss4}
BuildRequires: jboss4-common
BuildRequires: jboss4-connector
%endif
BuildRequires: jpackage-utils
BuildRequires: junit
BuildRequires: log4j-mini
Requires: log4j
Provides: mm.mysql
Obsoletes: mm.mysql
%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.
%package javadoc
License: GPL v2 or later
Summary: Official JDBC Driver for MySQL
Group: Development/Libraries/Java
Requires(post): /bin/ln
Requires(post): /bin/rm
Requires(postun): /bin/rm
%description javadoc
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.
%package manual
License: GPL v2 or later
Summary: Official JDBC Driver for MySQL
Group: Development/Libraries/Java
Requires(post): /bin/ln
Requires(post): /bin/rm
Requires(postun): /bin/rm
%description manual
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}
%patch1 -b .sav1
# patch only for javac 1.6.0
if [[ "$(javac -version 2>&1 | grep '1\.6\.0')" != "" ]]; then
%patch2 -b .sav2
fi
%patch3
# 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
# duplicate-waste
rm docs/README.txt README
# wrong end of line necoding
sed -i -e 's/.$//' README.txt EXCEPTIONS-CONNECTOR-J
%build
# jboss jars needed for test suite
export CLASSPATH="$(build-classpath ant-contrib \
jakarta-commons-logging \
%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.5 \
-Dant.build.javac.target=1.5 \
-DbuildDir="%{builddir}" \
-DdistDir="%{distdir}" \
-Dcom.mysql.jdbc.java6.javac="%{javac}" \
-Dcom.mysql.jdbc.java6.rtjar="%{java_home}/jre/lib/rt.jar" \
dist javadoc
%install
%{__install} -d -m 755 ${RPM_BUILD_ROOT}%{_javadir}
%{__install} -m 644 %{builddir}/%{name}-%{version}/%{name}-%{version}-bin.jar \
${RPM_BUILD_ROOT}%{_javadir}/%{name}-%{version}.jar
(
cd ${RPM_BUILD_ROOT}%{_javadir} && \
for jar in *-%{version}*.jar; do
%{__ln_s} -f ${jar} `echo $jar | %{__sed} "s|-%{version}||g"`
done
)
%{__rm} -rf ${RPM_BUILD_DIR}%{name}-%{version}/docs/release-test-output
# javadoc
%{__install} -d -m 755 ${RPM_BUILD_ROOT}%{_javadocdir}/%{name}-%{version}
%{__cp} -pr build-mysql-jdbc/javadoc/* \
${RPM_BUILD_ROOT}%{_javadocdir}/%{name}-%{version}
%{__ln_s} %{name}-%{version} ${RPM_BUILD_ROOT}%{_javadocdir}/%{name}
%clean
%{__rm} -rf $RPM_BUILD_ROOT
%files
%defattr(0644,root,root,0755)
%doc CHANGES COPYING EXCEPTIONS-CONNECTOR-J README.txt
%attr(0644,root,root) %{_javadir}/*.jar
%files manual
%defattr(0644,root,root,0755)
%doc docs
%files javadoc
%defattr(0644,root,root,0755)
%ghost %doc %{_javadocdir}/%{name}
%doc %{_javadocdir}/%{name}-%{version}
%changelog
* Thu Sep 11 2008 anosek@suse.cz
- updated to version 5.1.6
- introduces driver which conforms to the JDBC 4.0 specifications.
However this was disabled because of missing dependencies
- dropped obsoleted patch (build_xml.patch)
- added patch (disableJDBC4.patch) taken from Debian
* Thu Aug 07 2008 mvyskocil@suse.cz
- update to the 5.0.8 (improved spec from jpackage.org)
- fix of [bnc#99151]
- added two new subpackages (javadoc and manual)
- removed the dependency on jboss4
- add a support for build with java6 and java5 together (ia64 build fix)
- use source="1.5" and target="1.5"
* Thu Jul 17 2008 coolo@suse.de
- trying to avoid another build cycle
* Wed Sep 27 2006 skh@suse.de
- don't use icecream
- use source="1.4" and target="1.4" for build with java 1.5
* Tue Feb 07 2006 jsmeix@suse.de
- Current version 3.1.12 from JPackage.org
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Thu Jul 28 2005 jsmeix@suse.de
- Adjustments in the spec file.
* Mon Jul 18 2005 jsmeix@suse.de
- Current version 3.1.8 from JPackage.org
* Fri Feb 18 2005 skh@suse.de
- update to version 3.1.6
- don't use icecream
* Thu Sep 02 2004 skh@suse.de
- Initial package created with version 3.0.11 (JPackage 1.5)