ecj-vl.spec 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. %define qualifier 201006080911
  2. Summary: Eclipse Compiler for Java
  3. Name: ecj
  4. Version: 3.6
  5. Release: 1%{?_dist_release}
  6. URL: http://www.eclipse.org
  7. License: EPL
  8. Group: Development/Languages
  9. #Source0: ftp://sourceware.org/pub/java/ecj-latest.jar
  10. #Source1: ecj-gij.sh.in
  11. Source0: http://download.eclipse.org/eclipse/downloads/drops/R-%{version}-%{qualifier}/%{name}src-%{version}.zip
  12. Source1: ecj.sh.in
  13. # Use ECJ for GCJ
  14. # cvs -d:pserver:anonymous@sourceware.org:/cvs/rhug co eclipse-gcj
  15. # tar cjf ecj-gcj.tar.bz2 eclipse-gcj
  16. Source2: %{name}-gcj.tar.bz2
  17. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  18. #BuildArch: noarch
  19. BuildRequires: jpackage-utils
  20. BuildRequires: gcc-java >= 4.0.0
  21. BuildRequires: fastjar
  22. # for /usr/bin/aot-compile-rpm
  23. BuildRequires: java-gcj-compat-devel
  24. Requires: libgcj >= 4.0.0
  25. # for /usr/bin/rebuild-gcj-db
  26. Requires(post): java-gcj-compat
  27. Requires(postun): java-gcj-compat
  28. Provides: eclipse-ecj = %{version}-%{release}
  29. #Obsoletes: eclipse-ecj < 3.4.2-4
  30. %description
  31. ECJ is the Java bytecode compiler of the Eclipse Platform. It is also known as
  32. the JDT Core batch compiler.
  33. %prep
  34. %setup -q -c
  35. # Use ECJ for GCJ's bytecode compiler
  36. tar jxf %{SOURCE2}
  37. mv eclipse-gcj/org/eclipse/jdt/internal/compiler/batch/GCCMain.java \
  38. org/eclipse/jdt/internal/compiler/batch/
  39. cat eclipse-gcj/gcc.properties >> \
  40. org/eclipse/jdt/internal/compiler/batch/messages.properties
  41. rm -rf eclipse-gcj
  42. # Remove bits of JDT Core we don't want to build
  43. rm -r org/eclipse/jdt/internal/compiler/tool
  44. rm -r org/eclipse/jdt/internal/compiler/apt
  45. # JDTCompilerAdapter isn't used by the batch compiler
  46. rm -f org/eclipse/jdt/core/JDTCompilerAdapter.java
  47. %build
  48. for f in `find -name '*.java' | cut -c 3- | LC_ALL=C sort`; do
  49. gcj -Wno-deprecated -C $f
  50. done
  51. find -name '*.class' -or -name '*.properties' -or -name '*.rsc' |\
  52. xargs fastjar cf %{name}-%{version}.jar
  53. %install
  54. rm -rf $RPM_BUILD_ROOT
  55. rm -rf aot-compile-rpm
  56. mkdir -p $RPM_BUILD_ROOT%{_javadir}
  57. #install -m644 %{SOURCE0} $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
  58. install -m644 *.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
  59. pushd $RPM_BUILD_ROOT%{_javadir}
  60. ln -s %{name}-%{version}.jar %{name}.jar
  61. ln -s %{name}-%{version}.jar eclipse-%{name}-%{version}.jar
  62. ln -s eclipse-%{name}-%{version}.jar eclipse-%{name}.jar
  63. ln -s %{name}-%{version}.jar jdtcore.jar
  64. popd
  65. # Install the ecj wrapper script
  66. install -p -D -m0755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/ecj
  67. sed --in-place "s:@JAVADIR@:%{_javadir}:" $RPM_BUILD_ROOT%{_bindir}/ecj
  68. aot-compile-rpm
  69. %clean
  70. rm -rf $RPM_BUILD_ROOT
  71. %post
  72. if [ -x %{_bindir}/rebuild-gcj-db ]
  73. then
  74. %{_bindir}/rebuild-gcj-db
  75. fi
  76. %postun
  77. if [ -x %{_bindir}/rebuild-gcj-db ]
  78. then
  79. %{_bindir}/rebuild-gcj-db
  80. fi
  81. %files
  82. %defattr(-,root,root,-)
  83. %{_bindir}/%{name}
  84. %{_javadir}/%{name}*.jar
  85. %{_javadir}/eclipse-%{name}*.jar
  86. %{_javadir}/jdtcore.jar
  87. %{_libdir}/gcj/%{name}
  88. %changelog
  89. * Tue Aug 24 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.6.0-1
  90. - new upstream release
  91. - enabled AOT compile
  92. * Mon Apr 19 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.5.1-1
  93. - initial build for Vine Linux