ecj-vl.spec 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. %define qualifier 201102101200
  2. Summary: Eclipse Compiler for Java
  3. Name: ecj
  4. Version: 3.6.2
  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. %description
  30. ECJ is the Java bytecode compiler of the Eclipse Platform. It is also known as
  31. the JDT Core batch compiler.
  32. %prep
  33. %setup -q -c
  34. # Use ECJ for GCJ's bytecode compiler
  35. tar jxf %{SOURCE2}
  36. mv eclipse-gcj/org/eclipse/jdt/internal/compiler/batch/GCCMain.java \
  37. org/eclipse/jdt/internal/compiler/batch/
  38. cat eclipse-gcj/gcc.properties >> \
  39. org/eclipse/jdt/internal/compiler/batch/messages.properties
  40. rm -rf eclipse-gcj
  41. # Remove bits of JDT Core we don't want to build
  42. rm -r org/eclipse/jdt/internal/compiler/tool
  43. rm -r org/eclipse/jdt/internal/compiler/apt
  44. # JDTCompilerAdapter isn't used by the batch compiler
  45. rm -f org/eclipse/jdt/core/JDTCompilerAdapter.java
  46. %build
  47. for f in `find -name '*.java' | cut -c 3- | LC_ALL=C sort`; do
  48. gcj -Wno-deprecated -C $f
  49. done
  50. find -name '*.class' -or -name '*.properties' -or -name '*.rsc' |\
  51. xargs fastjar cf %{name}-%{version}.jar
  52. %install
  53. rm -rf $RPM_BUILD_ROOT
  54. rm -rf aot-compile-rpm
  55. mkdir -p $RPM_BUILD_ROOT%{_javadir}
  56. #install -m644 %{SOURCE0} $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
  57. install -m644 *.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
  58. pushd $RPM_BUILD_ROOT%{_javadir}
  59. ln -s %{name}-%{version}.jar %{name}.jar
  60. ln -s %{name}-%{version}.jar eclipse-%{name}-%{version}.jar
  61. ln -s eclipse-%{name}-%{version}.jar eclipse-%{name}.jar
  62. ln -s %{name}-%{version}.jar jdtcore.jar
  63. popd
  64. # Install the ecj wrapper script
  65. install -p -D -m0755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/ecj
  66. sed --in-place "s:@JAVADIR@:%{_javadir}:" $RPM_BUILD_ROOT%{_bindir}/ecj
  67. aot-compile-rpm
  68. %clean
  69. rm -rf $RPM_BUILD_ROOT
  70. %post
  71. if [ -x %{_bindir}/rebuild-gcj-db ]
  72. then
  73. %{_bindir}/rebuild-gcj-db
  74. fi
  75. %postun
  76. if [ -x %{_bindir}/rebuild-gcj-db ]
  77. then
  78. %{_bindir}/rebuild-gcj-db
  79. fi
  80. %files
  81. %defattr(-,root,root,-)
  82. %{_bindir}/%{name}
  83. %{_javadir}/%{name}*.jar
  84. %{_javadir}/eclipse-%{name}*.jar
  85. %{_javadir}/jdtcore.jar
  86. %{_libdir}/gcj/%{name}
  87. %changelog
  88. * Sun Mar 20 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.6.2-1
  89. - new upstream release
  90. * Tue Aug 24 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.6.0-1
  91. - new upstream release
  92. - enabled AOT compile
  93. * Mon Apr 19 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.5.1-1
  94. - initial build for Vine Linux