[packages/java-ecj] - initial, ecj.jar built from source with Fedora patch to avoid .dummy resources
qboosh
qboosh at pld-linux.org
Sun Sep 6 16:15:04 CEST 2015
commit cc63d8df1b949c777f342c60be90549773830b8b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Sep 6 16:16:24 2015 +0200
- initial, ecj.jar built from source with Fedora patch to avoid .dummy resources
java-ecj-nodummysymbol.patch | 37 ++++++++++++++++++++++++
java-ecj.spec | 67 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 104 insertions(+)
---
diff --git a/java-ecj.spec b/java-ecj.spec
new file mode 100644
index 0000000..11f9214
--- /dev/null
+++ b/java-ecj.spec
@@ -0,0 +1,67 @@
+%include /usr/lib/rpm/macros.java
+Summary: Eclipse Compiler for Java
+Summary(pl.UTF-8): Eclipse Compiler for Java - kompilator Javy platformy Eclipse
+Name: java-ecj
+Version: 4.9
+Release: 1
+License: Eclipse Public License v1.0
+Group: Development/Languages/Java
+Source0: ftp://sourceware.org/pub/java/ecj-%{version}-source.tar.bz2
+# Source0-md5: 056b8a279a6cb6a6baef4205ef0be5a8
+Patch0: %{name}-nodummysymbol.patch
+URL: http://www.eclipse.org/jdt/core/
+BuildRequires: jdk
+BuildRequires: jpackage-utils
+BuildRequires: rpm-javaprov
+BuildRequires: rpmbuild(macros) >= 1.300
+BuildRequires: sed >= 4.0
+# for %{_javadir}
+Requires: jpackage-utils
+Requires: jre
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+ECJ is the Java bytecode compiler of the Eclipse Platform. It is also
+known as the JDT Core batch compiler.
+
+%description -l pl.UTF-8
+ECJ to kompilator kodu bajtowego Javy platformy Eclipse. Jest znany
+także jako kompilator wsadowy JDT Core.
+
+%prep
+%setup -q -c
+%patch0 -p1
+
+%{__sed} -i -e 's/^ ecj / $(ECJ) /' Makefile
+%{__sed} -i -e 's/-1\.5/-source 1.5/' Makefile
+
+%build
+#export JAVA_HOME="%{java_home}"
+
+%{__make} compile \
+ ECJ=javac
+
+%{__make} ecj.jar
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_javadir}}
+
+cp -p ecj.jar $RPM_BUILD_ROOT%{_javadir}
+
+cat >$RPM_BUILD_ROOT%{_bindir}/ecj <<EOF
+#!/bin/sh
+
+CLASSPATH="%{_datadir}/ecj.jar${CLASSPATH:+:$CLASSPATH}" \
+java org.eclipse.jdk.internal.compiler.batch.Main "$@"
+EOF
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc ChangeLog
+%attr(755,root,root) %{_bindir}/ecj
+%{_javadir}/ecj.jar
diff --git a/java-ecj-nodummysymbol.patch b/java-ecj-nodummysymbol.patch
new file mode 100644
index 0000000..fe84050
--- /dev/null
+++ b/java-ecj-nodummysymbol.patch
@@ -0,0 +1,37 @@
+diff -u -r org/eclipse/jdt/internal/compiler/batch/GCCMain.java org/eclipse/jdt/internal/compiler/batch/GCCMain.java
+--- a/org/eclipse/jdt/internal/compiler/batch/GCCMain.java 2012-10-29 21:12:37.244254740 -0400
++++ b/org/eclipse/jdt/internal/compiler/batch/GCCMain.java 2012-10-29 21:13:55.661107108 -0400
+@@ -101,16 +101,6 @@
+ }
+ zipStream = new ZipOutputStream(new BufferedOutputStream(os));
+ zipStream.setMethod(ZipOutputStream.STORED);
+- // Sun/OpenJDK require at least one entry in the zip file.
+- ZipEntry entry = new ZipEntry(".dummy");
+- byte[] contents = new byte[0];
+- CRC32 crc = new CRC32();
+- crc.update(contents);
+- entry.setSize(contents.length);
+- entry.setCrc(crc.getValue());
+- zipStream.putNextEntry(entry);
+- zipStream.write(contents);
+- zipStream.closeEntry();
+ }
+ return zipStream;
+ }
+@@ -120,16 +110,6 @@
+ OutputStream os = new FileOutputStream(zipDependencyDestination);
+ zipDependencyStream = new ZipOutputStream(new BufferedOutputStream(os));
+ zipDependencyStream.setMethod(ZipOutputStream.STORED);
+- // Sun/OpenJDK require at least one entry in the zip file.
+- ZipEntry entry = new ZipEntry(".dummy");
+- byte[] contents = new byte[0];
+- CRC32 crc = new CRC32();
+- crc.update(contents);
+- entry.setSize(contents.length);
+- entry.setCrc(crc.getValue());
+- zipDependencyStream.putNextEntry(entry);
+- zipDependencyStream.write(contents);
+- zipDependencyStream.closeEntry();
+ }
+ return zipDependencyStream;
+ }
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/java-ecj.git/commitdiff/cc63d8df1b949c777f342c60be90549773830b8b
More information about the pld-cvs-commit
mailing list