diff --git a/eclipse.spec b/eclipse.spec index e4957f6..45da690 100644 --- a/eclipse.spec +++ b/eclipse.spec @@ -14,6 +14,7 @@ ExclusiveArch: i386 ia64 ppc %define eclipse_majmin %{eclipse_major}.%{eclipse_minor} %define eclipse_micro 1 %define libname libswt3 +%define selfbuild 1 %ifarch %{ix86} %define eclipse_arch x86 @@ -51,7 +52,7 @@ ExclusiveArch: i386 ia64 ppc Summary: %{pkg_summary} Name: eclipse Version: %{eclipse_majmin}.%{eclipse_micro} -Release: 3 +Release: 4 License: CPL Group: Text Editors/Integrated Development Environments (IDE) URL: http://www.eclipse.org/ @@ -88,6 +89,7 @@ Patch21: %{name}-org.eclipse.help.appserver-host.patch Patch22: %{name}-welcome-screen.patch Patch23: %{name}-cvs-permission-bits.patch Patch24: %{name}-cvs-permission-bits2.patch +Patch25: %{name}-webappcpfix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildRequires: ant @@ -102,7 +104,8 @@ BuildRequires: %{_libdir}/pkgconfig/gtk+-2.0.pc # MDK 9.1: libglib2.0_0-devel # RH 8.0, 9, FC 1: glib2-devel BuildRequires: %{_libdir}/pkgconfig/gthread-2.0.pc -BuildRequires: java >= 1.4.2 +BuildRequires: gcc-java >= 3.4.2 +#BuildRequires: java-1.4.2-gcj-compat-bootstrap %description @@ -111,6 +114,22 @@ environments (IDEs) that can be used to create applications as diverse as web sites, embedded Java(tm) programs, C++ programs, and Enterprise JavaBeans(tm). +%package ecj +Summary: Eclipse Compiler for Java +Group: Development/Languages +Obsoletes: ecj + +%description ecj +Eclipse compiler for Java. + +%package ecj-native +Summary: Natively-compiled bits of the Eclipse Compiler for Java +Group: Development/Languages +Requires: %{name}-ecj + +%description ecj-native +Natively-compiled bits of the Eclipse Compiler for Java + %package platform Summary: Eclipse platform common files Group: Text Editors/Integrated Development Environments (IDE) @@ -118,11 +137,12 @@ Provides: %{name} = %{version}-%{release} Obsoletes: %{name}-sdk eclipse Provides: %{name}-sdk Requires: java >= 1.4.2 +Requires: %{name}-gtk2 +Requires: /usr/bin/perl %description platform -Eclipse platform common files. In addition to this, you'll need the -startup scripts and a UI package (GTK2) to be able to -run the IDE. +Eclipse platform common files. In addition to this, you'll need a UI package +(GTK2) to be able to run the IDE. %package gtk2 Summary: GTK2 UI for the Eclipse IDE @@ -140,6 +160,7 @@ GTK2 UI for the Eclipse IDE. Summary: Eclipse Java development tools Group: Text Editors/Integrated Development Environments (IDE) Requires: %{name}-ui = %{version}-%{release} +Requires: %{name}-ecj = %{version}-%{release} %description jdt Eclipse Java developments tools. @@ -160,15 +181,6 @@ Requires: %{name}-source = %{version}-%{release} %description pde Eclipse PDE. -%package scripts -Summary: Eclipse startup scripts -Group: Text Editors/Integrated Development Environments (IDE) -Requires: %{name}-ui = %{version}-%{release} -Requires: /usr/bin/perl - -%description scripts -Eclipse startup scripts. - %package -n %{libname}-gtk2 Summary: SWT Library for GTK2 Group: Text Editors/Integrated Development Environments (IDE) @@ -207,6 +219,11 @@ popd pushd "plugins/org.eclipse.team.cvs.ui" %patch24 -p0 popd +%if %selfbuild +pushd "plugins" +%patch25 -p1 +popd +%endif # Red Hat splash screen. pushd plugins/org.eclipse.platform @@ -253,8 +270,74 @@ fi %build export ANT_OPTS=-Xmx768m -#find -name \*.jar -exec rm -f {} \; +%if %selfbuild +## -------- ecj build -------- +## Build ecj that we can use for the rest of the build +## + +# We're going to muck with this, so let's keep a clean copy +cp -r plugins/org.eclipse.jdt.core plugins/org.eclipse.jdt.core.original + +pushd plugins/org.eclipse.jdt.core +for f in `find batch -name '*.java' -or -name '*.properties'`; do + g=`echo $f | sed 's:^batch/:compiler/:' | xargs dirname` + [ -d $g ] || mkdir -p $g + cp -a $f $g +done +cd compiler +for f in `find -name '*.java' | cut -c 3-`; do + gcj -Wno-deprecated -C $f +done +find -name '*.class' -or -name '*.properties' -or -name '*.rsc' |\ + xargs jar cf ../../../ecj-%{version}.jar + +popd + +# Let's return o.e.jdt.core to its original src state +rm -rf plugins/org.eclipse.jdt.core +mv plugins/org.eclipse.jdt.core.original plugins/org.eclipse.jdt.core + +ln -s ecj-%{version}.jar ecj.jar + +# What we'll do in FC4: +#gcj -fnew-verifier -fPIC -fjni -findirect-dispatch -shared \ +# -o ecj-${version}.so ecj.jar +# +# On FC3 with katana: +#katana ecj.jar # +# ... but katana actually does: + +mkdir -p .katana +mkdir -p .katana/ecj.jar +cd .katana/ecj.jar +jar xf ../../ecj.jar +jar cf ../org.eclipse.jdt.core.compiler-%{version}.jar \ + org/eclipse/jdt/core/compiler +jar cf ../org.eclipse.jdt.internal.compiler-%{version}.jar \ + org/eclipse/jdt/internal/compiler +cd ../.. +rm -rf .katana/ecj.jar +gcj -O2 -g -march=i386 -mcpu=i686 -shared -fPIC \ + .katana/org.eclipse.jdt.core.compiler-%{version}.jar \ + -o lib-org-eclipse-jdt-core-compiler-%{version}.so +ln -sf lib-org-eclipse-jdt-core-compiler-%{version}.so \ + lib-org-eclipse-jdt-core-compiler.so +gcj -O2 -g -march=i386 -mcpu=i686 -shared -fPIC \ + .katana/org.eclipse.jdt.internal.compiler-%{version}.jar \ + -classpath .katana/org.eclipse.jdt.core.compiler-%{version}.jar -L. \ + -l-org-eclipse-jdt-core-compiler-%{version} \ + -o lib-org-eclipse-jdt-internal-compiler-%{version}.so +ln -sf lib-org-eclipse-jdt-internal-compiler-%{version}.so \ + lib-org-eclipse-jdt-internal-compiler.so +cp -a plugins/org.eclipse.jdt.core/compiler/org . +rm -rf .katana + +# Now use this built ecj for the rest of the build +export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH +# -------- ecj build -------- +%endif + pushd plugins/org.eclipse.swt.tools rm -f swttools.jar %{ant} \ @@ -264,6 +347,17 @@ rm -f swttools.jar -Dbootclasspath= popd +%if %selfbuild +# I had to add stuff to the bootclasspath to get this to work with +# java-gcj-compat. --overholt +mkdir -p './JNI Generation/org/eclipse/swt/tools/internal/' +%{ant} -buildfile build.xml \ + -DinstallOs=linux -DinstallWs=gtk -DinstallArch=%{eclipse_arch} \ + -Dbuild.compiler=modern \ + -DjavacVerbose=false -DjavacFailOnError=true \ + -Dbootclasspath=%{_datadir}/java/libgcj-3.4.2.jar:%{_datadir}/java/xml-commons-apis-1.0.jar \ + compile +%else mkdir -p './JNI Generation/org/eclipse/swt/tools/internal/' %{ant} -buildfile build.xml \ -DinstallOs=linux -DinstallWs=gtk -DinstallArch=%{eclipse_arch} \ @@ -271,19 +365,20 @@ mkdir -p './JNI Generation/org/eclipse/swt/tools/internal/' -DjavacVerbose=false -DjavacFailOnError=true \ -Dbootclasspath= \ compile +%endif -# Overwrite eclipse.org documentation with our own and then build the docs -pushd plugins -ln org.eclipse.platform/startup.jar ../. -for buildDoc in `/usr/bin/gzip -dc %{SOURCE20} | tar -vxf - | grep build.xml`; do - pushd `echo $buildDoc | sed -e 's/build.xml//g'` - if [ -e buildDoc.xml ]; then - java -cp ../../startup.jar org.eclipse.core.launcher.Main -application org.eclipse.ant.core.antRunner -v -f buildDoc.xml - fi - popd -done -rm ../startup.jar -popd +## Overwrite eclipse.org documentation with our own and then build the docs +#pushd plugins +#ln org.eclipse.platform/startup.jar ../. +#for buildDoc in `/usr/bin/gzip -dc %{SOURCE20} | tar -vxf - | grep build.xml`; do +# pushd `echo $buildDoc | sed -e 's/build.xml//g'` +# if [ -e buildDoc.xml ]; then +# %{ant} -f buildDoc.xml +# fi +# popd +#done +#rm ../startup.jar +#popd suff= %ifarch alpha ia64 ppc64 sparc64 x86_64 @@ -359,6 +454,17 @@ popd rm -rf $RPM_BUILD_ROOT export ANT_OPTS=-Xmx768m +# I had to add stuff to the bootclasspath to get this to work with +# java-gcj-compat. --overholt +%if %selfbuild +%{ant} \ + -DinstallOs=linux -DinstallWs=gtk -DinstallArch=%{eclipse_arch} \ + -Dbuild.compiler=modern \ + -DjavacVerbose=false -DjavacFailOnError=true \ + -Djavadoc=%{javadoc} \ + -Dbootclasspath=%{_datadir}/java/libgcj-3.4.2.jar:%{_datadir}/java/xml-commons-apis-1.0.jar \ + install +%else %{ant} \ -DinstallOs=linux -DinstallWs=gtk -DinstallArch=%{eclipse_arch} \ -Dbuild.compiler=modern \ @@ -366,6 +472,7 @@ export ANT_OPTS=-Xmx768m -Dbootclasspath= \ -Djavadoc=%{javadoc} \ install +%endif install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name} find result -type f -name "*.zip" -exec unzip -d $RPM_BUILD_ROOT%{_datadir} {} \; @@ -516,16 +623,36 @@ sed -e's/^\(.*\)$/\1 \1/' -e's,^,ln -s $eclipse/,' >> copy-platform mkdir $RPM_BUILD_ROOT%{_datadir}/%{name}/buildscripts cp copy-platform $RPM_BUILD_ROOT%{_datadir}/%{name}/buildscripts +# Need gcc 4.0 for this +## GCJ build +#pwd +#gcj-dbtool -n $RPM_BUILD_ROOT%{_datadir}/%{name}/.eclipse.db 80000 +#for j in `find $RPM_BUILD_ROOT%{_datadir}/%{name} -name \*.jar`; do +# echo $j; +# gcj -fnew-verifier -fPIC -fjni -findirect-dispatch -shared \ +# -o $RPM_BUILD_ROOT%{_libdir}/%{name}/`basename $j .jar`.so $j; +# gcj-dbtool -a $RPM_BUILD_ROOT%{_datadir}/%{name}/.eclipse.db $j \ +# $RPM_BUILD_ROOT%{_libdir}/%{name}/`basename $j .jar`.so; +#done + +# Copy ecj.jar to %{_datadir}/java and put its associated native bits in +# %{_libdir}/%{name} +mkdir -p $RPM_BUILD_ROOT%{_datadir}/java +install -m644 ecj-%{version}.jar $RPM_BUILD_ROOT%{_datadir}/java +ln -s %{_datadir}/java/ecj-%{version}.jar \ + $RPM_BUILD_ROOT%{_datadir}/java/ecj.jar +install -m755 lib-org-eclipse-jdt*.so $RPM_BUILD_ROOT%{_libdir}/%{name} %clean rm -rf $RPM_BUILD_ROOT - %files platform -f %{name}-platform.install %defattr(0644,root,root,0755) %dir %{_datadir}/%{name} %dir %{_libdir}/%{name} +#%{_libdir}/%{name}/*.so %{_datadir}/%{name}/.eclipseproduct +#%{_datadir}/%{name}/.eclipse.db %{_datadir}/%{name}/startup.jar %{_datadir}/%{name}/icon.xpm %attr(0755,root,root) %{_libdir}/%{name}/libcore* @@ -533,6 +660,12 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/%{name}/eclipse %attr(0755,root,root) %{_datadir}/%{name}/buildscripts/copy-platform %attr(0755,root,root) %{_libdir}/%{name}/libcvs.so +# formerly in scripts +%attr(0755,root,root) %{_bindir}/eclipse +%{_datadir}/applications/* +%{_datadir}/pixmaps/* +%{_datadir}/icons/*/*/apps/* +%config(noreplace) %{_sysconfdir}/eclipse.conf %files gtk2 -f %{name}-gtk.install %defattr(0644,root,root,0755) @@ -552,21 +685,26 @@ rm -rf $RPM_BUILD_ROOT %files jdt -f %{name}-jdt.install %defattr(0644,root,root,0755) -%files source -f %{name}-source.install +%files ecj %defattr(0644,root,root,0755) +%{_datadir}/java/ecj*.jar -%files pde -f %{name}-pde.install +%files ecj-native %defattr(0644,root,root,0755) +%{_libdir}/%{name}/lib-org-eclipse-jdt*.so -%files scripts +%files source -f %{name}-source.install +%defattr(0644,root,root,0755) + +%files pde -f %{name}-pde.install %defattr(0644,root,root,0755) -%attr(0755,root,root) %{_bindir}/eclipse -%{_datadir}/applications/* -%{_datadir}/pixmaps/* -%{_datadir}/icons/*/*/apps/* -%config(noreplace) %{_sysconfdir}/eclipse.conf %changelog +* Mon Dec 20 2004 Andrew Overholt 3.0.1-4 +- build ecj first and use it to build the rest +- add %selfbuild to toggle between builds with java-gcj-compat and other JREs +- fold scripts into platform + * Mon Nov 22 2004 Ben Konrath 3.0.1-3 - split cvs-permission-bits.patch in two - bug fix for cvs-permission-bits.patch