[mysql-connector-java] Clean-up of the spec file, including gcj support Remove jar files from the tar ball

Honza Horak hhorak at fedoraproject.org
Thu Oct 24 10:48:40 UTC 2013


commit a1b938601caa565bdb682049828480957b568265
Author: Honza HorĂ¡k <hhorak at redhat.com>
Date:   Thu Oct 24 12:48:34 2013 +0200

    Clean-up of the spec file, including gcj support
    Remove jar files from the tar ball

 .gitignore                |    1 +
 generate-tarball.sh       |   15 +++++++++++
 mysql-connector-java.spec |   60 +++++++++-----------------------------------
 sources                   |    2 +-
 4 files changed, 30 insertions(+), 48 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 7b24d9c..255d747 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
 /mysql-connector-java-5.1.24.tar.gz
 /mysql-connector-java-5.1.25.tar.gz
 /mysql-connector-java-5.1.26.tar.gz
+/mysql-connector-java-5.1.26-nojars.tar.xz
diff --git a/generate-tarball.sh b/generate-tarball.sh
new file mode 100755
index 0000000..2931510
--- /dev/null
+++ b/generate-tarball.sh
@@ -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 {} \;
+
+tar cfJ mysql-connector-java-$VERSION-nojars.tar.xz mysql-connector-java-$VERSION || exit 1
+
+rm -rf mysql-connector-java-$VERSION
+
+exit 0
diff --git a/mysql-connector-java.spec b/mysql-connector-java.spec
index 7baa13b..d0428c1 100644
--- a/mysql-connector-java.spec
+++ b/mysql-connector-java.spec
@@ -1,6 +1,5 @@
 %global     builddir        build-mysql-jdbc
 %global     distdir         dist-mysql-jdbc
-%global     gcj_support     0
 %global     java6_rtpath    %{java_home}/jre/lib/rt.jar
 %global     java6_javacpath /usr/bin/javac
 %global     java6_javapath  /usr/bin/javac
@@ -8,7 +7,7 @@
 Summary:    Official JDBC driver for MySQL
 Name:       mysql-connector-java
 Version:    5.1.26
-Release:    1%{?dist}
+Release:    2%{?dist}
 Epoch:      1 
 
 # MySQL FLOSS Exception
@@ -31,20 +30,17 @@ URL:        http://dev.mysql.com/downloads/connector/j/
 # src/lib/slf4j-api-1.6.1.jar
 #
 # See http://bugs.mysql.com/bug.php?id=28512 for details.
-Source0:            %{name}-%{version}.tar.gz
+Source0:            %{name}-%{version}-nojars.tar.xz
+
+# To make it easier a script generate-tarball.sh has been created:
+# ./generate-tarball.sh version
+# will create a new tarball compressed with xz and without those jar files.
+Source1:           generate-tarball.sh 
 
 # Patch to build with JDBC 4.1/Java 7
 Patch0:             %{name}-jdbc-4.1.patch
 
-%if ! %{gcj_support}
 BuildArch:          noarch
-%endif
-
-%if %{gcj_support}
-BuildRequires:      java-gcj-compat-devel >= 1.0.31
-Requires(post):     java-gcj-compat >= 1.0.31
-Requires(postun):   java-gcj-compat >= 1.0.31
-%endif
 
 BuildRequires:      java-devel >= 1:1.6.0
 BuildRequires:      ant >= 1.6.0
@@ -53,9 +49,6 @@ BuildRequires:      jpackage-utils >= 1.6
 BuildRequires:      jta >= 1.0
 BuildRequires:      junit
 BuildRequires:      slf4j
-%if %{gcj_support}
-BuildRequires:      java-1.5.0-gcj-devel
-%endif
 BuildRequires:      apache-commons-logging
 
 Requires:           java >= 1:1.6.0
@@ -87,9 +80,6 @@ sed -i 's/\r//' docs/README.txt
 
 # We need both JDK1.5 (for JDBC3.0; appointed by $JAVA_HOME) and JDK1.6 (for JDBC4.0; appointed in the build.xml)
 export CLASSPATH=$(build-classpath jdbc-stdext jta junit slf4j commons-logging.jar)
-%if %{gcj_support}
-export JAVA_HOME=/usr/lib/jvm/java-1.5.0-gcj
-%endif
 
 # We currently need to disable jboss integration because of missing jboss-common-jdbc-wrapper.jar (built from sources).
 # See BZ#480154 and BZ#471915 for details.
@@ -106,14 +96,7 @@ rm -rf $RPM_BUILD_ROOT
 
 install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
 install -m 644 %{builddir}/%{name}-%{version}-SNAPSHOT/%{name}-%{version}-SNAPSHOT-bin.jar \
-    $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
-
-(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*.jar; do mv ${jar} `echo $jar| sed  "s|-%{version}||g"` ; done)
-
-# natively compile
-%if %{gcj_support}
-%{_bindir}/aot-compile-rpm
-%endif
+    $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
 
 # Install the Maven build information
 install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
@@ -122,34 +105,17 @@ sed -i 's/>@.*</>%{version}</' $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
 
 %add_maven_depmap
 
-
-%post
-%if %{gcj_support}
-if [ -x %{_bindir}/rebuild-gcj-db ]
-then
-  %{_bindir}/rebuild-gcj-db
-fi
-%endif
-
-%postun
-%if %{gcj_support}
-if [ -x %{_bindir}/rebuild-gcj-db ]
-then
-  %{_bindir}/rebuild-gcj-db
-fi
-%endif
-
 %files
-%defattr(0644,root,root,0755)
 %doc CHANGES COPYING docs
-%attr(0644,root,root) %{_javadir}/*.jar
+%{_javadir}/*.jar
 %config(noreplace) %{_mavendepmapfragdir}/*
 %{_mavenpomdir}/*.pom
-%if %{gcj_support}
-%attr(-,root,root) %{_libdir}/gcj/%{name}
-%endif
 
 %changelog
+* Thu Oct 24 2013 Honza Horak <hhorak at redhat.com> - 1:5.1.26-2
+- Clean-up of the spec file, including gcj support
+- Remove jar files from the tar ball
+
 * Wed Oct 23 2013 Honza Horak <hhorak at redhat.com> - 1:5.1.26-1
 - Update to 5.1.26
 - Remove versioned jars 
diff --git a/sources b/sources
index de84765..d7ca397 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-1a7af1458f9a615802a17e3a2f07b942  mysql-connector-java-5.1.26.tar.gz
+ed71a00e04d9c55f3150d08369627c80  mysql-connector-java-5.1.26-nojars.tar.xz


More information about the scm-commits mailing list