Blob Blame Raw
Epoch:	1
ExclusiveArch: i386 x86_64 ppc

%define pkg_summary     An open, extensible IDE
%define section         free
%define swt_version     3123
%define eclipse_major   3
%define eclipse_minor   1
%define eclipse_majmin  %{eclipse_major}.%{eclipse_minor}
%define eclipse_micro   0
%define eclipse_oldmajminmic  3.0.0
%define libname         libswt3
%define build_id        I20050219-1500

# All arches line up except i386 -> x86
%ifarch %{ix86}
%define eclipse_arch    x86
%else
%define eclipse_arch   %{_arch}
%endif

Summary:        %{pkg_summary}
Name:           eclipse
Version:        %{eclipse_majmin}.%{eclipse_micro}_fc
Release:	0.M5.18
License:        CPL
Group:          Text Editors/Integrated Development Environments (IDE)
URL:            http://www.eclipse.org/
Source0: 	http://download.eclipse.org/eclipse/downloads/drops/S-3.1M5a-200502191500/eclipse-sourceBuild-srcIncluded-3.1M5a.zip
Source1:        %{name}.script
Source2:        %{name}.desktop
Source3:        %{name}-16.gif
Source4:        %{name}-32.gif
Source5:        %{name}-48.png
Source6:        %{name}.conf
Source7:        %{name}-jdt.install
Source8:        %{name}-pde.install     
Source9:        %{name}-platform.install
Source10:       %{libname}-gtk2.install
# this should be replaced with:
# Source11:	%{name}-native-splash-3.1-M.png
# when Eclipse 3.1 comes out.
Source11:	%{name}-native-splash-3.1-M-build.png
Source16:       %{name}-copy-platform.sh

# Build libswt-mozilla
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=71637
Patch0:         %{name}-make-linux.patch
# Work around libgcj #19132
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19132
Patch1:		%{name}-textsearch.patch
# Build JNI libs
# FIXME:  these should be built by upstream build method
# http://people.redhat.com/bkonrath/eclipse/buildable-source-zips.html
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=71637
Patch2:		%{name}-build.patch
Patch4:		%{name}-libupdatebuild.patch
Patch5:		%{name}-libupdatebuild2.patch
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=85915
Patch8:		%{name}-antsecuritymanager.patch
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=86571
Patch9:		%{name}-pdebuildtarargs.patch
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=86848
Patch10:	%{name}-icon.patch
# Use installed mozilla libs and headers
Patch11:	%{name}-libswt-mozilla.patch
# Copy over the source files first
Patch12:	%{name}-libswt-mozilla2.patch
# We can't really commit to doing builds for these arches upstream, but we
# need at least eclipse-ecj to run on them as it's our bytecode compiler for
# Fedora.
Patch13:	%{name}-s390ands390x.patch
# Stupid spaces in directories ...
Patch14:	%{name}-s390ands390x2.patch
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=82916
Patch15:	%{name}-build-activeHelpSample.jar.patch
# Make find work.  See
# https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=111736
Patch16:	%{name}-find.patch
# Bootstrap the build a la https://bugs.eclipse.org/bugs/show_bug.cgi?id=84914
# ... the patch is a bit hacky at the moment
Patch17:	%{name}-bootstrap.patch
# Build swttools.jar
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=90364
Patch18: 	%{name}-swttools.patch
# Add command-line source code formatter
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=75333
Patch19: 	%{name}-efj.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires:  ant
BuildRequires:  perl
BuildRequires:  jpackage-utils >= 0:1.5, make, gcc
BuildRequires:  gnome-vfs2-devel
BuildRequires:  gtk2-devel
BuildRequires:  glib2-devel
BuildRequires:  mozilla >= 1.7.6
BuildRequires:  mozilla-devel >= 1.7.6
BuildRequires:  mozilla-nspr-devel >= 1.7.6
BuildRequires:  xorg-x11-devel
BuildRequires:	gcc-java >= 4.0.0-0.35
BuildRequires:	java-1.4.2-gcj-compat-devel >= 1.4.2.0-40jpp_14rh

BuildRequires: ant-antlr ant-apache-bcel ant-apache-log4j ant-apache-oro ant-apache-regexp ant-apache-resolver ant-commons-logging
#BuildRequires: ant-apache-bsf ant-commons-net ant-jsch lucene 
BuildRequires: ant-jdepend ant-jmf ant-junit ant-nodeps ant-swing ant-trax
BuildRequires: jsch
BuildRequires: jakarta-commons-beanutils jakarta-commons-collections jakarta-commons-digester jakarta-commons-logging jakarta-commons-modeler mx4j
#BuildRequires: servlet lucene-demo jasper4 tomcat4
BuildRequires: regexp junit

%description
The Eclipse Platform is designed for building integrated development
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
Provides:	ecj
Requires:	gcc-java >= 4.0.0-0.35

%description    ecj
Eclipse compiler for Java.

%package        platform
Summary:        Eclipse platform common files
Group:          Text Editors/Integrated Development Environments (IDE)
Provides:       %{name} = %{version}-%{release}
Obsoletes:	%{name}-sdk %{name}-ui %{name}-gtk2 eclipse
Provides:	%{name}-sdk = %{epoch}:%{version}-%{release}
Provides:       %{name}-ui = %{epoch}:%{version}-%{release}
Provides:       %{name}-gtk2 = %{epoch}:%{version}-%{release}
Requires:	java-1.4.2-gcj-compat >= 1.4.2.0-40jpp_14rh
Requires:       /usr/bin/perl
Requires:	gcc-java >= 4.0.0-0.35
Requires:       %{libname}-gtk2 = %{epoch}:%{version}-%{release}
Requires:       /usr/bin/mozilla
PreReq:         gtk2 >= 2.6

Requires: ant-antlr ant-apache-bcel ant-apache-log4j ant-apache-oro ant-apache-regexp ant-apache-resolver ant-commons-logging
#Requires: ant-apache-bsf ant-commons-net ant-jsch lucene 
Requires: ant-jdepend ant-jmf ant-junit ant-nodeps ant-swing ant-trax
Requires: jsch
Requires: jakarta-commons-beanutils jakarta-commons-collections jakarta-commons-digester jakarta-commons-logging jakarta-commons-modeler mx4j
#Requires: servlet lucene-demo jasper4 tomcat4
Requires: regexp junit

%description    platform
Eclipse platform common files.  This package now contains the GTK2 UI (the
former eclipse-gtk2 package).

%package        platform-devel
Summary:        Eclipse platform Source
Group:          Text Editors/Integrated Development Environments (IDE)
Requires:       %{name}-platform = %{epoch}:%{version}-%{release}

%description    platform-devel
Source for Eclipse platform for use within Eclipse.

%package        jdt
Summary:        Eclipse Java development tools
Group:          Text Editors/Integrated Development Environments (IDE)
Requires:       %{name}-platform = %{epoch}:%{version}-%{release}
Requires:       %{name}-ecj = %{epoch}:%{version}-%{release}
Requires:	gcc-java >= 4.0.0-0.35

%description    jdt
Eclipse Java developments tools.

%package        jdt-devel
Summary:        Eclipse JDT Source
Group:          Text Editors/Integrated Development Environments (IDE)
Requires:       %{name}-jdt = %{epoch}:%{version}-%{release}

%description    jdt-devel
Source for JDT for use within Eclipse.

%package        pde
Summary:        Eclipse PDE
Group:          Text Editors/Integrated Development Environments (IDE)
Requires:       %{name}-jdt = %{epoch}:%{version}-%{release}
Requires:       %{name}-platform-devel = %{epoch}:%{version}-%{release}
Requires:	gcc-java >= 4.0.0-0.35

%package        pde-devel
Summary:        Eclipse PDE Source
Group:          Text Editors/Integrated Development Environments (IDE)
Requires:       %{name}-pde = %{epoch}:%{version}-%{release}
Requires:       %{name}-jdt-devel = %{epoch}:%{version}-%{release}
Obsoletes:	%{name}-source
Provides:       %{name}-source = %{epoch}:%{version}-%{release}

%description    pde-devel
Source for PDE for use within Eclipse.

%description    pde
Eclipse PDE.

%package     -n %{libname}-gtk2
Summary:        SWT Library for GTK2
Group:          Text Editors/Integrated Development Environments (IDE)

%description -n %{libname}-gtk2
SWT Library for GTK2.

%prep
%setup -q -c

# I hate spaces in paths with patch!
pushd plugins/org.eclipse.swt/Eclipse\ SWT\ PI/gtk/library
%patch0 -p0
%patch11 -p0
%patch14 -p0
popd
%patch1 -p0
%patch2 -p0
%patch4 -p0
%patch5 -p0
%patch8 -p0
%patch9 -p0
%patch10 -p0
%patch12 -p0
%patch13 -p1
pushd plugins/org.eclipse.platform.doc.isv
rm -f activeHelpSample.jar
%patch15 -p0
popd
%patch16 -p0
%patch17 -p1
pushd plugins/org.eclipse.swt.gtk64
%patch18 -p0
popd
pushd plugins/org.eclipse.jdt.core
%patch19 -p0
popd

# Red Hat splash screen.
pushd plugins/org.eclipse.platform
cp %{SOURCE11} splash.bmp
popd

# Remove existing .sos
find -name \*.so -exec rm "-f" "{}" ";"

## Remove these as well
#rm jdtcore.jar jdtCompilerAdapter.jar

# Symlinks

## BEGIN ANT ##
ln -sf %{_javadir}/ant/ant-antlr.jar plugins/org.apache.ant/lib/ant-antlr.jar
ln -sf %{_javadir}/ant/ant-apache-bcel.jar plugins/org.apache.ant/lib/ant-apache-bcel.jar
#ln -sf %{_javadir}/ant/ant-apache-bsf.jar plugins/org.apache.ant/lib/ant-apache-bsf.jar
ln -sf %{_javadir}/ant/ant-apache-log4j.jar plugins/org.apache.ant/lib/ant-apache-log4j.jar
ln -sf %{_javadir}/ant/ant-apache-oro.jar plugins/org.apache.ant/lib/ant-apache-oro.jar
ln -sf %{_javadir}/ant/ant-apache-regexp.jar plugins/org.apache.ant/lib/ant-apache-regexp.jar
ln -sf %{_javadir}/ant/ant-apache-resolver.jar plugins/org.apache.ant/lib/ant-apache-resolver.jar
ln -sf %{_javadir}/ant/ant-commons-logging.jar plugins/org.apache.ant/lib/ant-commons-logging.jar
#ln -sf %{_javadir}/ant/ant-commons-net.jar plugins/org.apache.ant/lib/ant-commons-net.jar
# ------------------------------------------------------------------------
# FIXME:  can we just remove these?
#rm -f plugins/org.apache.ant/lib/ant-icontract.jar
##ln -sf %{_javadir}/ant/ant-icontract.jar plugins/org.apache.ant/lib/ant-icontract.jar
#rm -f plugins/org.apache.ant/lib/ant-jai.jar
##ln -sf %{_javadir}/ant/ant-jai.jar plugins/org.apache.ant/lib/ant-jai.jar
#ln -sf %{_javadir}/ant.jar plugins/org.apache.ant/lib/ant.jar
#rm -f plugins/org.apache.ant/lib/ant-javamail.jar
##ln -sf %{_javadir}/ant/ant-javamail.jar plugins/org.apache.ant/lib/ant-javamail.jar
# ------------------------------------------------------------------------
ln -sf %{_javadir}/ant/ant-jdepend.jar plugins/org.apache.ant/lib/ant-jdepend.jar
ln -sf %{_javadir}/ant/ant-jmf.jar plugins/org.apache.ant/lib/ant-jmf.jar
#ln -sf %{_javadir}/ant/ant-jsch.jar plugins/org.apache.ant/lib/ant-jsch.jar
ln -sf %{_javadir}/ant/ant-junit.jar plugins/org.apache.ant/lib/ant-junit.jar
ln -sf %{_javadir}/ant-launcher.jar plugins/org.apache.ant/lib/ant-launcher.jar
# ------------------------------------------------------------------------
ln -sf %{_javadir}/ant/ant-nodeps.jar plugins/org.apache.ant/lib/ant-nodeps.jar
# ------------------------------------------------------------------------
## FIXME:  can we just remove these?
#rm -f plugins/org.apache.ant/lib/ant-starteam.jar
##ln -sf %{_javadir}/ant/ant-starteam.jar plugins/org.apache.ant/lib/ant-starteam.jar
#rm -f plugins/org.apache.ant/lib/ant-stylebook.jar
##ln -sf %{_javadir}/ant/ant-stylebook.jar plugins/org.apache.ant/lib/ant-stylebook.jar
# ------------------------------------------------------------------------
ln -sf %{_javadir}/ant/ant-swing.jar plugins/org.apache.ant/lib/ant-swing.jar
ln -sf %{_javadir}/ant/ant-trax.jar plugins/org.apache.ant/lib/ant-trax.jar
# ------------------------------------------------------------------------
# FIXME:  can we just remove these?
#rm -f plugins/org.apache.ant/lib/ant-vaj.jar
##ln -sf %{_javadir}/ant/ant-vaj.jar plugins/org.apache.ant/lib/ant-vaj.jar
#rm -f plugins/org.apache.ant/lib/ant-weblogic.jar
##ln -sf %{_javadir}/ant/ant-weblogic.jar plugins/org.apache.ant/lib/ant-weblogic.jar
#rm -f plugins/org.apache.ant/lib/ant-xalan1.jar
##ln -sf %{_javadir}/ant/ant-xalan1.jar plugins/org.apache.ant/lib/ant-xalan1.jar
#rm -f plugins/org.apache.ant/lib/ant-xslp.jar
##ln -sf %{_javadir}/ant/ant-xslp.jar plugins/org.apache.ant/lib/ant-xslp.jar
# ------------------------------------------------------------------------
## END ANT ##
#ln -sf %{_javadir}/lucene.jar plugins/org.apache.lucene/lucene-1.4.3.jar
#ln -sf %{_datadir}/lucene/lucene-demos-1.4.3.jar plugins/org.apache.lucene/parser.jar
# plugins/org.eclipse.core.boot/boot.jar
ln -sf %{_javadir}/ant.jar plugins/org.eclipse.core.resources/lib/ant.jar
# plugins/org.eclipse.core.resources/lib/antsupport.jar
# plugins/org.eclipse.osgi/osgi/collx.jar
# plugins/org.eclipse.osgi/osgi/ee.foundation.jar
# plugins/org.eclipse.osgi/osgi/ee.minimum.jar
# plugins/org.eclipse.osgi/osgi/exceptions.jar
# plugins/org.eclipse.osgi/osgi/osgi-r3-jdk131-notsigned.jar
#ln -sf %{_javadir}/xml-commons-apis.jar plugins/org.eclipse.osgi/osgi/xmlParserAPIs.jar
# plugins/org.eclipse.osgi.services/services.jar
# plugins/org.eclipse.osgi.util/util.jar
ln -sf %{_javadir}/jsch.jar plugins/org.eclipse.team.cvs.ssh2/jsch-0.1.17.jar
# plugins/org.eclipse.text/text.jar
# ------------------------------------------------------------------------
# FIXME:  need tomcat4 rpm
## BEGIN TOMCAT4 ##
#ln -sf %{tomcat4dir}/bin/bootstrap.jar plugins/org.eclipse.tomcat/bootstrap.jar
#ln -sf %{tomcat4dir}/server/lib/catalina.jar plugins/org.eclipse.tomcat/catalina.jar
#ln -sf %{_javadir}/commons-beanutils.jar plugins/org.eclipse.tomcat/commons-beanutils.jar
#ln -sf %{_javadir}/commons-collections.jar plugins/org.eclipse.tomcat/commons-collections.jar
#ln -sf %{_javadir}/commons-digester.jar plugins/org.eclipse.tomcat/commons-digester.jar
#ln -sf %{_javadir}/commons-logging-api.jar plugins/org.eclipse.tomcat/commons-logging-api.jar
#ln -sf %{_javadir}/commons-logging.jar plugins/org.eclipse.tomcat/commons-logging.jar
#ln -sf %{_javadir}/commons-modeler.jar plugins/org.eclipse.tomcat/commons-modeler.jar
#ln -sf %{_javadir}/regexp.jar plugins/org.eclipse.tomcat/jakarta-regexp-1.3.jar
#ln -sf %{_javadir}/jasper4-compiler.jar  plugins/org.eclipse.tomcat/jasper-compiler.jar
#ln -sf %{_javadir}/jasper4-runtime.jar plugins/org.eclipse.tomcat/jasper-runtime.jar
#ln -sf %{_javadir}/mx4j/mx4j-jmx.jar plugins/org.eclipse.tomcat/mx4j-jmx.jar
#ln -sf %{tomcat4dir}/common/lib/naming-common.jar plugins/org.eclipse.tomcat/naming-common.jar
#ln -sf %{tomcat4dir}/common/lib/naming-factory.jar plugins/org.eclipse.tomcat/naming-factory.jar
#ln -sf %{tomcat4dir}/common/lib/naming-resources.jar plugins/org.eclipse.tomcat/naming-resources.jar
#ln -sf %{_javadir}/servlet.jar plugins/org.eclipse.tomcat/servlet.jar
#ln -sf %{tomcat4dir}/server/lib/servlets-common.jar plugins/org.eclipse.tomcat/servlets-common.jar
#ln -sf %{tomcat4dir}/server/lib/servlets-default.jar plugins/org.eclipse.tomcat/servlets-default.jar
#ln -sf %{tomcat4dir}/server/lib/servlets-invoker.jar plugins/org.eclipse.tomcat/servlets-invoker.jar
#ln -sf %{tomcat4dir}/server/lib/servlets-manager.jar plugins/org.eclipse.tomcat/servlets-manager.jar
#ln -sf %{tomcat4dir}/server/lib/tomcat-coyote.jar plugins/org.eclipse.tomcat/tomcat-coyote.jar
#ln -sf %{tomcat4dir}/server/lib/tomcat-http11.jar plugins/org.eclipse.tomcat/tomcat-http11.jar
#ln -sf %{tomcat4dir}/server/lib/tomcat-util.jar plugins/org.eclipse.tomcat/tomcat-util.jar
## END TOMCAT4 ##
# ------------------------------------------------------------------------
ln -sf %{_javadir}/junit.jar plugins/org.junit/junit.jar

rm -f *.jar
# /usr/lib -> /usr/lib64
pushd plugins/org.eclipse.swt/Eclipse\ SWT\ PI/gtk/library
  perl -pe 's|/usr/lib/|%{_libdir}/|g' \
    build.sh > build.sh.patched
  mv build.sh.patched build.sh
popd

%build
ORIGCLASSPATH=$CLASSPATH

# Bootstrapping is 3 parts:
# 1. Build ecj with gcj -C 
# 2. Build ecj with gcj-built ecj ("javac")
# 3. Re-build ecj with output of 2.

# Keep a backup
cp -r plugins/org.eclipse.jdt.core plugins/org.eclipse.jdt.core.orig

# 1a. Build ecj with gcj -C
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-bootstrap.jar
popd

# Delete our modified jdtcore and restore the backup
rm -rf plugins/org.eclipse.jdt.core
mv plugins/org.eclipse.jdt.core.orig plugins/org.eclipse.jdt.core

## 1b. Natively-compile it
#gcj -fPIC -fjni -findirect-dispatch -shared -Wl,-Bsymbolic \
#  -o ecj-bootstrap.jar.so ecj-bootstrap.jar
#
#gcj-dbtool -n bootstrap.db 30000
#gcj-dbtool -a bootstrap.db ecj-bootstrap.jar{,.so}
#
#export GCJ_PROPERTIES="gnu.gcj.precompiled.db.path=`pwd`/bootstrap.db"

# 2a. Build ecj
export CLASSPATH=ecj-bootstrap.jar:$ORIGCLASSPATH
ant -buildfile jdtcoresrc/compilejdtcorewithjavac.xml

## 2b. Natively-compile ecj
#gcj -fPIC -fjni -findirect-dispatch -shared -Wl,-Bsymbolic \
#  -o jdtcoresrc/ecj.jar.so jdtcoresrc/ecj.jar
#
#gcj-dbtool -n jdtcoresrc/ecj.db 30000
#gcj-dbtool -a jdtcoresrc/ecj.db jdtcoresrc/ecj.jar{,.so}
#export GCJ_PROPERTIES="gnu.gcj.precompiled.db.path=`pwd`/jdtcoresrc/ecj.db"

# Remove our gcj-built ecj
#rm bootstrap.db ecj-bootstrap.jar
rm ecj-bootstrap.jar

# 3. Use this ecj to rebuild itself
export CLASSPATH=`pwd`/jdtcoresrc/ecj.jar:$ORIGCLASSPATH
ant -buildfile jdtcoresrc/compilejdtcore.xml

## Natively-compile it
#gcj -fPIC -fjni -findirect-dispatch -shared -Wl,-Bsymbolic \
#  -o ecj.jar.so ecj.jar
#gcj-dbtool -n ecj.db 30000
#gcj-dbtool -a ecj.db ecj.jar{,.so}

# Remove old native bits
#rm jdtcoresrc/ecj.db jdtcoresrc/ecj.jar.so

# Build the rest of Eclipse
export CLASSPATH=`pwd`/ecj.jar:$ORIGCLASSPATH
#export GCJ_PROPERTIES="gnu.gcj.precompiled.db.path=`pwd`/ecj.db"
ant \
  -Dnobootstrap=true \
  -DinstallOs=linux -DinstallWs=gtk -DinstallArch=%{eclipse_arch} \
  -Dlibsconfig=true

pushd result
# De-compress resulting tarball ... yeah, it's a .zip but actually a .tar.gz
# See https://bugs.eclipse.org/bugs/show_bug.cgi?id=79711
tar zxf org.eclipse.sdk-%{build_id}-linux.gtk.%{eclipse_arch}.zip

pushd eclipse

# Remove the jars that we're using from other packages so that we don't
# natively-compile them again
rm -f plugins/org.apache.ant_1.6.2/lib/ant-antlr.jar
rm -f plugins/org.apache.ant_1.6.2/lib/ant-apache-bcel.jar
rm -f plugins/org.apache.ant_1.6.2/lib/ant-apache-log4j.jar
rm -f plugins/org.apache.ant_1.6.2/lib/ant-apache-oro.jar
rm -f plugins/org.apache.ant_1.6.2/lib/ant-apache-regexp.jar
rm -f plugins/org.apache.ant_1.6.2/lib/ant-apache-resolver.jar
rm -f plugins/org.apache.ant_1.6.2/lib/ant-commons-logging.jar
rm -f plugins/org.apache.ant_1.6.2/lib/ant-jdepend.jar
rm -f plugins/org.apache.ant_1.6.2/lib/ant-jmf.jar
rm -f plugins/org.apache.ant_1.6.2/lib/ant-junit.jar
rm -f plugins/org.apache.ant_1.6.2/lib/ant-launcher.jar
rm -f plugins/org.apache.ant_1.6.2/lib/ant-nodeps.jar
rm -f plugins/org.apache.ant_1.6.2/lib/ant-swing.jar
rm -f plugins/org.apache.ant_1.6.2/lib/ant-trax.jar
rm -f plugins/org.apache.ant_1.6.2/lib/ant.jar
rm -f plugins/org.eclipse.team.cvs.ssh2_3.1.0/jsch-0.1.17.jar
rm -f plugins/org.junit_3.8.1/junit.jar

# Native build -- do -O2 on x86 and ppc only (for now)
# see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20606, for example
%ifarch %{ix86} ppc
  mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}
  for j in `find -name \*.jar`; do
      d=".%{_libdir}/%{name}/`dirname $j | sed 's:\./::'`";
      mkdir -p $d;
      s=`echo $j | sed "s:\./::"`;
      gcj -fPIC -fjni -findirect-dispatch -shared -Wl,-Bsymbolic -O2 \
        -o $d/`basename $j`.so $j;
  done
%else
  mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}
  for j in `find -name \*.jar`; do
      d=".%{_libdir}/%{name}/`dirname $j | sed 's:\./::'`";
      mkdir -p $d;
      s=`echo $j | sed "s:\./::"`;
      gcj -fPIC -fjni -findirect-dispatch -shared -Wl,-Bsymbolic -O1 \
        -o $d/`basename $j`.so $j;
  done
%endif

# FIXME:  temporarily remove eclipseAdaptor.jar
rm \
  .%{_libdir}/%{name}/plugins/org.eclipse.osgi_%{eclipse_majmin}.%{eclipse_micro}/eclipseAdaptor.jar.so

# Tar up the native libs
tar czvf ../%{name}-nativelycompiledjars.tar.gz .%{_libdir}/%{name}

popd

# Remove expanded eclipse build
rm -rf eclipse
ls
popd

%install
rm -rf $RPM_BUILD_ROOT

install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}

# https://bugs.eclipse.org/bugs/show_bug.cgi?id=79711
tar -C $RPM_BUILD_ROOT%{_datadir} -zxf \
  result/org.eclipse.sdk-%{build_id}-linux.gtk.%{eclipse_arch}.zip

# Binaries, libraries, and natively-built shared libraries
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/%{name}

# Natively-compiled jars (shared libraries)
tar -C $RPM_BUILD_ROOT -zxf result/%{name}-nativelycompiledjars.tar.gz

install -d -m 755 $RPM_BUILD_ROOT%{_bindir}

# Directory to hold all the .jar->.so mapping dbs
install -d -m 755 $RPM_BUILD_ROOT`gcj-dbtool -p %{_libdir}`
install -d -m 755 $RPM_BUILD_ROOT`gcj-dbtool -p %{_libdir}`.d

# Eclipse binary
mv $RPM_BUILD_ROOT%{_datadir}/%{name}/eclipse \
  $RPM_BUILD_ROOT%{_libdir}/%{name}/eclipse

pushd $RPM_BUILD_ROOT%{_datadir}/%{name}
ln -sf %{_libdir}/%{name}/eclipse eclipse

# JNI libraries
cp -p plugins/org.eclipse.update.core.linux_%{eclipse_oldmajminmic}/os/linux/%{eclipse_arch}/libupdate.so \
  $RPM_BUILD_ROOT%{_libdir}/%{name}/
cp -p plugins/org.eclipse.core.resources.linux_%{eclipse_oldmajminmic}/os/linux/%{eclipse_arch}/libcore_*.so \
  $RPM_BUILD_ROOT%{_libdir}/%{name}/
suff=
%ifarch alpha ia64 ppc64 sparc64 x86_64
suff=64
%endif
cp -p plugins/org.eclipse.swt.gtk${suff}_%{eclipse_majmin}.%{eclipse_micro}/os/linux/%{eclipse_arch}/libswt*.so \
  $RPM_BUILD_ROOT%{_libdir}/%{name}/
popd

pushd $RPM_BUILD_ROOT%{_libdir}/%{name}
chmod -R 755 eclipse *.so
popd

### begin libswt-gtk2 symlinks
pushd $RPM_BUILD_ROOT%{_libdir}
for base in awt-gtk mozilla-gtk atk-gtk gnome-gtk gtk pi-gtk; do
  ln -sf %{_libdir}/%{name}/libswt-${base}-%{swt_version}.so \
         libswt-${base}-%{swt_version}.so
done
popd

install -d -m 755 $RPM_BUILD_ROOT%{_javadir}

pushd $RPM_BUILD_ROOT%{_javadir}
ln -sf %{_datadir}/%{name}/plugins/org.eclipse.swt.gtk${suff}_%{eclipse_majmin}.%{eclipse_micro}/ws/gtk/swt.jar swt-gtk-%{version}.jar
ln -sf %{_datadir}/%{name}/plugins/org.eclipse.swt.gtk${suff}_%{eclipse_majmin}.%{eclipse_micro}/ws/gtk/swt-pi.jar swt-pi-gtk-%{version}.jar
ln -sf %{_datadir}/%{name}/plugins/org.eclipse.swt.gtk${suff}_%{eclipse_majmin}.%{eclipse_micro}/ws/gtk/swt-mozilla.jar swt-mozilla-%{version}.jar
ln -sf %{_datadir}/%{name}/plugins/org.eclipse.swt.gtk${suff}_%{eclipse_majmin}.%{eclipse_micro}/ws/gtk/swt-cairo.jar swt-cairo-%{version}.jar
popd
### end libswt-gtk2 symlinks

# Launching script
mkdir -p $RPM_BUILD_ROOT%{_bindir}
perl -pe \
  's|/usr/lib/eclipse/|%{_libdir}/%{name}/|g ;
   s|/etc/|%{_sysconfdir}/|g ;
   s|/usr/bin/|%{_bindir}/|g' \
  %{SOURCE1} > $RPM_BUILD_ROOT%{_bindir}/eclipse

# Default config
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
perl -pe 's|/usr/lib/eclipse/|%{_datadir}/%{name}/|g' \
  %{SOURCE6} > $RPM_BUILD_ROOT%{_sysconfdir}/eclipse.conf

# rh/freedesktop.org icons
install -p -D -m0644 %{SOURCE5} \
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
install -p -D -m0644 %{SOURCE4} \
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
install -p -D -m0644 %{SOURCE3} \
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
install -d -m0755 $RPM_BUILD_ROOT%{_datadir}/pixmaps
ln -s ../icons/hicolor/48x48/apps/%{name}.png \
  $RPM_BUILD_ROOT%{_datadir}/pixmaps

# A sanity check.
desktop-file-validate %{SOURCE2}

# freedesktop.org menu entry
install -p -D -m0644 %{SOURCE2} \
  $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop

cat %{SOURCE7} > %{name}-jdt.install
cat %{SOURCE8} > %{name}-pde.install
cat %{SOURCE9} > %{name}-platform.install
cat %{SOURCE10} > %{libname}-gtk2.install

cat >> $RPM_BUILD_ROOT%{_datadir}/%{name}/.eclipseproduct << EOF
name=Eclipse Platform
id=org.eclipse.platform
version=%{eclipse_majmin}.%{eclipse_micro}
EOF

# Create a script that can be used to make a symlink tree of the
# eclipse platform.
cp %{SOURCE16} copy-platform
(
  cd $RPM_BUILD_ROOT%{_datadir}/%{name}
  ls -d * | egrep -v '^(plugins|features)$'
  ls -d plugins/* features/*
) |
sed -e's/^\(.*\)$/\1 \1/' -e's,^,ln -s $eclipse/,' >> copy-platform

mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/buildscripts
cp copy-platform $RPM_BUILD_ROOT%{_datadir}/%{name}/buildscripts

pushd $RPM_BUILD_ROOT%{_datadir}/%{name}
## BEGIN ANT ##
ln -sf %{_javadir}/ant/ant-antlr.jar plugins/org.apache.ant_*/lib/ant-antlr.jar
ln -sf %{_javadir}/ant/ant-apache-bcel.jar plugins/org.apache.ant_*/lib/ant-apache-bcel.jar
#ln -sf %{_javadir}/ant/ant-apache-bsf.jar plugins/org.apache.ant_*/lib/ant-apache-bsf.jar
ln -sf %{_javadir}/ant/ant-apache-log4j.jar plugins/org.apache.ant_*/lib/ant-apache-log4j.jar
ln -sf %{_javadir}/ant/ant-apache-oro.jar plugins/org.apache.ant_*/lib/ant-apache-oro.jar
ln -sf %{_javadir}/ant/ant-apache-regexp.jar plugins/org.apache.ant_*/lib/ant-apache-regexp.jar
ln -sf %{_javadir}/ant/ant-apache-resolver.jar plugins/org.apache.ant_*/lib/ant-apache-resolver.jar
ln -sf %{_javadir}/ant/ant-commons-logging.jar plugins/org.apache.ant_*/lib/ant-commons-logging.jar
#ln -sf %{_javadir}/ant/ant-commons-net.jar plugins/org.apache.ant_*/lib/ant-commons-net.jar
#ln -sf %{_javadir}/ant/ant-icontract.jar plugins/org.apache.ant_*/lib/ant-icontract.jar
#ln -sf %{_javadir}/ant/ant-jai.jar plugins/org.apache.ant_*/lib/ant-jai.jar
ln -sf %{_javadir}/ant.jar plugins/org.apache.ant_*/lib/ant.jar
#ln -sf %{_javadir}/ant/ant-javamail.jar plugins/org.apache.ant_*/lib/ant-javamail.jar
ln -sf %{_javadir}/ant/ant-jdepend.jar plugins/org.apache.ant_*/lib/ant-jdepend.jar
ln -sf %{_javadir}/ant/ant-jmf.jar plugins/org.apache.ant_*/lib/ant-jmf.jar
#ln -sf %{_javadir}/ant/ant-jsch.jar plugins/org.apache.ant_*/lib/ant-jsch.jar
ln -sf %{_javadir}/ant/ant-junit.jar plugins/org.apache.ant_*/lib/ant-junit.jar
ln -sf %{_javadir}/ant-launcher.jar plugins/org.apache.ant_*/lib/ant-launcher.jar
ln -sf %{_javadir}/ant/ant-nodeps.jar plugins/org.apache.ant_*/lib/ant-nodeps.jar
#ln -sf %{_javadir}/ant/ant-starteam.jar plugins/org.apache.ant_*/lib/ant-starteam.jar
#ln -sf %{_javadir}/ant/ant-stylebook.jar plugins/org.apache.ant_*/lib/ant-stylebook.jar
ln -sf %{_javadir}/ant/ant-swing.jar plugins/org.apache.ant_*/lib/ant-swing.jar
ln -sf %{_javadir}/ant/ant-trax.jar plugins/org.apache.ant_*/lib/ant-trax.jar
#ln -sf %{_javadir}/ant/ant-vaj.jar plugins/org.apache.ant_*/lib/ant-vaj.jar
#ln -sf %{_javadir}/ant/ant-weblogic.jar plugins/org.apache.ant_*/lib/ant-weblogic.jar
#ln -sf %{_javadir}/ant/ant-xalan1.jar plugins/org.apache.ant_*/lib/ant-xalan1.jar
#ln -sf %{_javadir}/ant/ant-xslp.jar plugins/org.apache.ant_*/lib/ant-xslp.jar
## END ANT ##
#ln -sf %{_javadir}/lucene.jar plugins/org.apache.lucene_*/lucene-1.4.3.jar
#ln -sf %{_datadir}/lucene/lucene-demos-1.4.3.jar plugins/org.apache.lucene_*/parser.jar
# plugins/org.eclipse.core.boot_*/boot.jar
###ln -sf %{_javadir}/ant.jar plugins/org.eclipse.core.resources_*/lib/ant.jar
# plugins/org.eclipse.core.resources_*/lib/antsupport.jar
# plugins/org.eclipse.osgi_*/osgi/collx.jar
# plugins/org.eclipse.osgi_*/osgi/ee.foundation.jar
# plugins/org.eclipse.osgi_*/osgi/ee.minimum.jar
# plugins/org.eclipse.osgi_*/osgi/exceptions.jar
# plugins/org.eclipse.osgi_*/osgi/osgi-r3-jdk131-notsigned.jar
###ln -sf %{_javadir}/xml-commons-apis.jar plugins/org.eclipse.osgi_*/osgi/xmlParserAPIs.jar
# plugins/org.eclipse.osgi.services_*/services.jar
# plugins/org.eclipse.osgi.util_*/util.jar
ln -sf %{_javadir}/jsch.jar plugins/org.eclipse.team.cvs.ssh2_*/jsch-0.1.17.jar
# plugins/org.eclipse.text/text_*.jar
## BEGIN TOMCAT4 ##
##ln -sf %{tomcat4dir}/bin/bootstrap.jar plugins/org.eclipse.tomcat_*/bootstrap.jar
#ln -sf %{tomcat4dir}/server/lib/catalina.jar plugins/org.eclipse.tomcat_*/catalina.jar
#ln -sf %{_javadir}/commons-beanutils.jar plugins/org.eclipse.tomcat_*/commons-beanutils.jar
#ln -sf %{_javadir}/commons-collections.jar plugins/org.eclipse.tomcat_*/commons-collections.jar
#ln -sf %{_javadir}/commons-digester.jar plugins/org.eclipse.tomcat_*/commons-digester.jar
#ln -sf %{_javadir}/commons-logging-api.jar plugins/org.eclipse.tomcat_*/commons-logging-api.jar
#ln -sf %{_javadir}/commons-logging.jar plugins/org.eclipse.tomcat_*/commons-logging.jar
#ln -sf %{_javadir}/commons-modeler.jar plugins/org.eclipse.tomcat_*/commons-modeler.jar
#ln -sf %{_javadir}/regexp.jar plugins/org.eclipse.tomcat_*/jakarta-regexp-1.3.jar
#ln -sf %{_javadir}/jasper4-compiler.jar  plugins/org.eclipse.tomcat_*/jasper-compiler.jar
#ln -sf %{_javadir}/jasper4-runtime.jar plugins/org.eclipse.tomcat_*/jasper-runtime.jar
#ln -sf %{_javadir}/mx4j/mx4j-jmx.jar plugins/org.eclipse.tomcat_*/mx4j-jmx.jar
#ln -sf %{tomcat4dir}/common/lib/naming-common.jar plugins/org.eclipse.tomcat_*/naming-common.jar
#ln -sf %{tomcat4dir}/common/lib/naming-factory.jar plugins/org.eclipse.tomcat_*/naming-factory.jar
#ln -sf %{tomcat4dir}/common/lib/naming-resources.jar plugins/org.eclipse.tomcat_*/naming-resources.jar
#ln -sf %{_javadir}/servlet.jar plugins/org.eclipse.tomcat_*/servlet.jar
#ln -sf %{tomcat4dir}/server/lib/servlets-common.jar plugins/org.eclipse.tomcat_*/servlets-common.jar
#ln -sf %{tomcat4dir}/server/lib/servlets-default.jar plugins/org.eclipse.tomcat_*/servlets-default.jar
#ln -sf %{tomcat4dir}/server/lib/servlets-invoker.jar plugins/org.eclipse.tomcat_*/servlets-invoker.jar
#ln -sf %{tomcat4dir}/server/lib/servlets-manager.jar plugins/org.eclipse.tomcat_*/servlets-manager.jar
#ln -sf %{tomcat4dir}/server/lib/tomcat-coyote.jar plugins/org.eclipse.tomcat_*/tomcat-coyote.jar
#ln -sf %{tomcat4dir}/server/lib/tomcat-http11.jar plugins/org.eclipse.tomcat_*/tomcat-http11.jar
#ln -sf %{tomcat4dir}/server/lib/tomcat-util.jar plugins/org.eclipse.tomcat_*/tomcat-util.jar
## END TOMCAT4 ##
ln -sf %{_javadir}/junit.jar plugins/org.junit_*/junit.jar

# Copy jdtcore.jar to %{_datadir}/java for eclipse-ecj
mkdir -p $RPM_BUILD_ROOT%{_datadir}/java
ln -s %{_datadir}/%{name}/plugins/org.eclipse.jdt.core_%{eclipse_majmin}.%{eclipse_micro}/jdtcore.jar \
  $RPM_BUILD_ROOT%{_datadir}/java/jdtcore.jar

# Create the gcj dbs for libswt, ecj, platform, jdt, and pde
gcjdbdir=$RPM_BUILD_ROOT`gcj-dbtool -p %{_libdir}`.d
mkdir -p $gcjdbdir
gcj-dbtool -n $gcjdbdir/%{name}-ecj.db 80000
gcj-dbtool -n $gcjdbdir/libswt3-gtk2.db 80000
gcj-dbtool -n $gcjdbdir/%{name}-platform.db 80000
gcj-dbtool -n $gcjdbdir/%{name}-jdt.db 80000
gcj-dbtool -n $gcjdbdir/%{name}-pde.db 80000

# ecj db
gcj-dbtool -f $gcjdbdir/%{name}-ecj.db \
  $RPM_BUILD_ROOT%{_datadir}/%{name}/plugins/org.eclipse.jdt.core_%{eclipse_majmin}.%{eclipse_micro}/jdtcore.jar \
  %{_libdir}/%{name}/plugins/org.eclipse.jdt.core_%{eclipse_majmin}.%{eclipse_micro}/jdtcore.jar.so
gcj-dbtool -f $gcjdbdir/%{name}-ecj.db \
  $RPM_BUILD_ROOT%{_datadir}/%{name}/plugins/org.eclipse.jdt.core_%{eclipse_majmin}.%{eclipse_micro}/jdtCompilerAdapter.jar \
  %{_libdir}/%{name}/plugins/org.eclipse.jdt.core_%{eclipse_majmin}.%{eclipse_micro}/jdtCompilerAdapter.jar.so

# jdt db
for dir in `cat %{SOURCE7}`; do
    for j in `find $RPM_BUILD_ROOT/$dir -name \*.jar`; do
	lib=`echo $j | sed "s:%{_datadir}:%{_libdir}:"`.so;
	if [ -f $lib ]; then
	  gcj-dbtool -f $gcjdbdir/%{name}-jdt.db \
	    $j `echo $lib | sed "s:$RPM_BUILD_ROOT/::"`;
	fi;
    done;
done

# pde db
for dir in `cat %{SOURCE8}`; do
    for j in `find $RPM_BUILD_ROOT/$dir -name \*.jar`; do
	lib=`echo $j | sed "s:%{_datadir}:%{_libdir}:"`.so;
	if [ -f $lib ]; then
	  gcj-dbtool -f $gcjdbdir/%{name}-pde.db \
	    $j `echo $lib | sed "s:$RPM_BUILD_ROOT/::"`;
	fi;
    done;
done

# platform db
for dir in `cat %{SOURCE9}`; do
    for j in `find $RPM_BUILD_ROOT/$dir -name \*.jar`; do
	lib=`echo $j | sed "s:%{_datadir}:%{_libdir}:"`.so;
	if [ -f $lib ]; then
	  gcj-dbtool -f $gcjdbdir/%{name}-platform.db \
	    $j `echo $lib | sed "s:$RPM_BUILD_ROOT/::"`;
	fi;
    done;
done

# swt db
for dir in `cat %{SOURCE10}`; do
    for j in `find $RPM_BUILD_ROOT/$dir -name \*.jar`; do
	lib=`echo $j | sed "s:%{_datadir}:%{_libdir}:"`.so;
	if [ -f $lib ]; then
	  gcj-dbtool -f $gcjdbdir/libswt3-gtk2.db \
	    $j `echo $lib | sed "s:$RPM_BUILD_ROOT/::"`;
	fi;
    done;
done

%clean
rm -rf $RPM_BUILD_ROOT

%post ecj
rebuild-gcj-db %{_libdir}

%post jdt
rebuild-gcj-db %{_libdir}

%post pde
rebuild-gcj-db %{_libdir}

%post platform
rebuild-gcj-db %{_libdir}
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
  gtk-update-icon-cache %{_datadir}/icons/hicolor
fi

%post -n %{libname}-gtk2
rebuild-gcj-db %{_libdir}

%postun ecj
rebuild-gcj-db %{_libdir}

%postun jdt
rebuild-gcj-db %{_libdir}

%postun pde
rebuild-gcj-db %{_libdir}

%postun platform
rebuild-gcj-db %{_libdir}
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
  gtk-update-icon-cache %{_datadir}/icons/hicolor
fi

%postun -n %{libname}-gtk2
rebuild-gcj-db %{_libdir}

# FIXME:  add the native directories to these lists
%files ecj
%defattr(0644,root,root,0755)
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/plugins/org.eclipse.jdt.core_3.*
%{_datadir}/java/jdtcore*.jar
# Native bits
%{_libdir}/gcj-4.0.0/classmap.db.d/%{name}-ecj.db
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.jdt.core_3.1.0/jdtcore.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.jdt.core_3.1.0/jdtCompilerAdapter.jar.so

%files -n %{libname}-gtk2 -f %{libname}-gtk2.install
%defattr(0644,root,root,0755)
%attr(0755,root,root) %{_libdir}/%{name}/libswt-gnome-gtk-*.so
%attr(0755,root,root) %{_libdir}/%{name}/libswt-gtk-*.so
%attr(0755,root,root) %{_libdir}/%{name}/libswt-pi-gtk-*.so
%attr(0755,root,root) %{_libdir}/%{name}/libswt-atk-gtk-*.so
%{_libdir}/%{name}/libswt-awt-gtk-*.so
%{_libdir}/%{name}/libswt-mozilla-gtk-*.so
%{_libdir}/libswt-*.so
%{_javadir}/swt-gtk*.jar
%{_javadir}/swt-pi-gtk*.jar
%{_javadir}/swt-mozilla*.jar
%{_javadir}/swt-cairo*.jar
# Native bits
%{_libdir}/gcj-4.0.0/classmap.db.d/libswt3-gtk2.db
%ifarch alpha ia64 ppc64 sparc64 x86_64
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.swt.gtk64_3.1.0/ws/gtk/swt-pi.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.swt.gtk64_3.1.0/ws/gtk/swt-mozilla.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.swt.gtk64_3.1.0/ws/gtk/swt-cairo.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.swt.gtk64_3.1.0/ws/gtk/swt.jar.so
%else
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.swt.gtk_3.1.0/ws/gtk/swt-pi.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.swt.gtk_3.1.0/ws/gtk/swt-mozilla.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.swt.gtk_3.1.0/ws/gtk/swt-cairo.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.swt.gtk_3.1.0/ws/gtk/swt.jar.so
%endif
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.jface_3.1.0/jface.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.jface.text_3.1.0/jfacetext.jar.so

%files jdt -f %{name}-jdt.install
%defattr(0644,root,root,0755)
# Native bits
%{_libdir}/gcj-4.0.0/classmap.db.d/%{name}-jdt.db
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.jdt.debug.ui_3.1.0/jdiui.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.jdt.debug.ui_3.1.0/snippetsupport.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.jdt.debug_3.1.0/jdimodel.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.jdt.debug_3.1.0/jdi.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.jdt.junit_3.1.0/junitsupport.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.jdt.junit.runtime_3.1.0/junitruntime.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.jdt.launching_3.1.0/launching.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.jdt.launching_3.1.0/lib/launchingsupport.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.jdt.ui_3.1.0/jdt.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.jdt.ui_3.1.0/serialsupport.jar.so

%files jdt-devel
%{_datadir}/%{name}/plugins/org.eclipse.jdt.source_3.*
%{_datadir}/%{name}/features/org.eclipse.jdt.source_3.*

%files pde -f %{name}-pde.install
%defattr(0644,root,root,0755)
# Native bits
%{_libdir}/gcj-4.0.0/classmap.db.d/%{name}-pde.db
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.pde.build_3.1.0/lib/pdebuild-ant.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.pde.build_3.1.0/pdebuild.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.pde.core_3.1.0/pdecore.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.pde.junit.runtime_3.1.0/pdejunit.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.pde.runtime_3.1.0/pdert.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.pde.ui_3.1.0/pdeuiant.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.pde.ui_3.1.0/pdeui.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.pde_3.1.0/pde.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.pde_3.1.0/ant_tasks/pde-ant.jar.so

%files pde-devel
%{_datadir}/%{name}/plugins/org.eclipse.pde.source_3.*
%{_datadir}/%{name}/features/org.eclipse.pde.source_3.*

%files platform -f %{name}-platform.install
%defattr(0644,root,root,0755)
%dir %{_datadir}/%{name}
%dir %{_libdir}/%{name}
%{_datadir}/%{name}/.eclipseproduct
%{_datadir}/%{name}/startup.jar
%{_datadir}/%{name}/icon.xpm
%attr(0755,root,root) %{_datadir}/%{name}/buildscripts/copy-platform
%attr(0755,root,root) %{_libdir}/%{name}/eclipse
%attr(0755,root,root) %{_libdir}/%{name}/libcore*
%attr(0755,root,root) %{_libdir}/%{name}/libupdate*
%{_datadir}/%{name}/eclipse
%attr(0755,root,root) %{_bindir}/eclipse
%{_datadir}/applications/*
%{_datadir}/pixmaps/*
%{_datadir}/icons/*/*/apps/*
%config(noreplace) %{_sysconfdir}/eclipse.conf
# Native bits
%{_libdir}/gcj-4.0.0/classmap.db.d/%{name}-platform.db
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ant.core_3.1.0/antsupport.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.compare_3.1.0/compare.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.core.boot_3.0.0/boot.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.core.expressions_3.1.0/expressions.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.core.filebuffers_3.1.0/filebuffers.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.core.resources_3.1.0/resources.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.core.commands_3.1.0/commands.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.core.resources_3.1.0/ant_tasks/resources-ant.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.core.runtime_3.1.0/runtime.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.core.variables_3.1.0/variables.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.debug.core_3.1.0/dtcore.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.debug.ui_3.1.0/dtui.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.help.base_3.0.0/helpbase.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.help.ui_3.0.0/helpui.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.help.appserver_3.0.0/appserver.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.help_3.0.0/help.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ltk.core.refactoring_3.1.0/refcore.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ltk.ui.refactoring_3.1.0/refui.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.osgi.services_3.0.0/services.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.osgi.util_3.0.0/util.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.platform.doc.isv_3.1.0/activeHelpSample.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.platform_3.1.0/platform.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.search_3.1.0/search.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.team.core_3.1.0/team.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.team.cvs.core_3.1.0/cvs.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.team.cvs.ui_3.1.0/teamcvsui.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.team.cvs.ssh_3.1.0/teamcvsssh.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.team.cvs.ssh2_3.1.0/jsch-0.1.16.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.team.cvs.ssh2_3.1.0/jsch-0.1.18.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.team.ui_3.1.0/teamui.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.text_3.1.0/text.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ui.cheatsheets_3.0.0/cheatsheets.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.osgi_3.1.0/console.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ui.externaltools_3.1.0/externaltools.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ui.forms_3.0.0/forms.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ui.ide_3.1.0/ide.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ui.intro_3.1.0/intro.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ui_3.1.0/ui.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ui.workbench_3.1.0/workbench.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ui.workbench.compatibility_3.1.0/compatibility.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.core.resources.compatibility_3.1.0/compatibility.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.core.runtime.compatibility_3.0.0/compatibility.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ui.workbench.texteditor_3.1.0/texteditor.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ui.editors_3.1.0/editors.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ui.presentations.r21_3.1.0/r21.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ui.views_3.1.0/views.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.update.configurator_3.0.0/configurator.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.update.core_3.0.0/updatecore.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.update.scheduler_3.0.0/scheduler.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.update.ui_3.0.0/updateui.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/startup.jar.so
# FIXME where should these go?
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.lucene_1.4.3/parser.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.lucene_1.4.3/lucene-1.4.3.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ant.ui_3.1.0/antui.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ant.ui_3.1.0/lib/remoteAnt.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ant.ui_3.1.0/lib/antrunner.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ant.core_3.1.0/lib/antsupportlib.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/commons-digester.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/commons-logging.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/jakarta-regexp-1.3.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/tomcat-util.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/servlets-manager.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/naming-common.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/naming-factory.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/commons-beanutils.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/servlets-default.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/commons-modeler.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/tomcat-coyote.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/jasper-compiler.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/catalina.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/jasper-runtime.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/commons-logging-api.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/servlets-invoker.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/tomcatwrapper.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/mx4j-jmx.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/bootstrap.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/servlet.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/commons-collections.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/servlets-common.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/naming-resources.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.tomcat_4.1.30/tomcat-http11.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.osgi_3.1.0/core.jar.so
#%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.osgi_3.1.0/eclipseAdaptor.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.team.cvs.ssh2_3.1.0/cvsssh2.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.ant_1.6.2/lib/ant-stylebook.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.ant_1.6.2/lib/ant-javamail.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.ant_1.6.2/lib/ant-weblogic.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.ant_1.6.2/lib/ant-netrexx.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.ant_1.6.2/lib/ant-commons-net.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.ant_1.6.2/lib/ant-icontract.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.ant_1.6.2/lib/ant-vaj.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.ant_1.6.2/lib/ant-apache-bsf.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.ant_1.6.2/lib/ant-xslp.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.ant_1.6.2/lib/ant-xalan1.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.ant_1.6.2/lib/ant-jai.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.ant_1.6.2/lib/ant-starteam.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.apache.ant_1.6.2/lib/ant-jsch.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.help.webapp_3.0.0/webapp.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.help.webapp_3.0.0/WEB-INF/lib/jsp.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.help.webapp_3.0.0/WEB-INF/lib/servlets.jar.so
%attr(0755,root,root) %{_libdir}/%{name}/plugins/org.eclipse.ui.console_3.1.0/console.jar.so

%files platform-devel
%{_datadir}/%{name}/plugins/org.eclipse.platform.source_3.*
%{_datadir}/%{name}/features/org.eclipse.platform.source_3.*
%{_datadir}/%{name}/plugins/org.eclipse.platform.source.linux.gtk.*_3.1.0

%changelog
* Wed Apr 06 2005 Andrew Overholt <overholt@redhat.com> 3.1.0_fc-0.M5.18
- Fix typo in gcj db building loops.
- Add -O1 to x86_64 jar.so compilation.
- Add EFJ (Eclipse Formatter for Java) patches (bkonrath) (e.o#75333).
- Add patch to build swttools.jar (e.o#90364).

* Mon Apr 04 2005 Andrew Overholt <overholt@redhat.com> 3.1.0_fc-0.M5.17
- Actually insert .jar-.jar.so combinations into sub-dbs.

* Thu Mar 31 2005 Andrew Overholt <overholt@redhat.com> 3.1.0_fc-0.M5.16
- Fix eclipse.script to not leave a sh process around (Joe Orton)
- Use proper sub-dbs.
- Don't compile jars that are symlinked from elsewhere.
- Add jar-so combinations to .db based on .jar.so existence (not .jar).
- Rename sub-dbs to be eclipse-*.db.
- Use rebuild-gcj-db script.

* Mon Mar 28 2005 Christopher Aillon <caillon@redhat.com>
- rebuilt

* Fri Mar 25 2005 Christopher Aillon <caillon@redhat.com> 3.1.0_fc-0.M5.14
- Update the GTK+ theme icon cache on (un)install

* Fri Mar 18 2005 Andrew Overholt <overholt@redhat.com> 3.1.0_fc-0.M5.13
- Re-add compilation of resources.jar.
- Backport bootstrapping patch.
- Add Requires: java-1.4.2-gcj-compat.
- Modified find patch courtesy Ziga Mahkovec (RH#149927#).
- Compile with -O2 on ppc as well.
- Add jsch, jakarta-commons-modeler, and mx4j symlinking.
- Make use of gcj-dbtool -f to create databases in install.
- Use system-wide classmap.db.
- Remove *.jarswithnativelibs from files sections.
- Update mozilla dependency.

* Mon Mar 07 2005 Ben Konrath <bkonrath@redhat.com> 3.1.0_fc-0.M5.12
- Add activeHelpSample.jar patch.
- Change to Fedora M-build splash screen.
- Add find patch courtesy Ziga Mahkovec (RH#149927#)
- Build native stuff with -O2 on i386.

* Mon Mar 07 2005 Andrew Overholt <overholt@redhat.com> 3.1.0_fc-0.M5.11
- Add s390 and s390x patches.
- Don't build for them, though, due to gcc bug and Eclipse building issue.
- Add xorg-x11-devel BuildRequires.

* Fri Mar 04 2005 Andrew Overholt <overholt@redhat.com> 3.1.0_fc-0.M5.10
- Add proper mozilla version.
- Don't build eclipseAdaptor.jar.so in order to work around plugin building
  problems.

* Thu Mar 03 2005 Andrew Overholt <overholt@redhat.com> 3.1.0_fc-0.M5.9
- Add patch to build libswt-mozilla.
- Build libswt-awt.
- Add 64-bit swt lib list.

* Tue Mar 01 2005 Andrew Overholt <overholt@redhat.com> 3.1.0_fc-0.M5.8
- Add ppc.
- Add patch to copy over icon for unsupported (upstream) platforms but don't
  include the source for the launcher.
- gcc4 -> gcc changes.
- Add swt-cairo to 64-bit platforms' %files.

* Fri Feb 25 2005 Andrew Overholt <overholt@redhat.com> 3.1.0_fc-0.M5.7
- Add tar args patch (e.o #86571).
- New build bootstrapping patches.

* Fri Feb 25 2005 Andrew Overholt <overholt@redhat.com> 3.1.0_fc-0.M5.6
- Re-work how we do the gcj-dbtool magic.
- Don't remove ant-netrexx (need to find an RPM if we can).

* Sun Feb 20 2005 Andrew Overholt <overholt@redhat.com> 1:3.1_fc-0.M5.5
- Build for just i386 and x86_64 for now due to upstream gcc bugs.

* Sun Feb 20 2005 Andrew Overholt <overholt@redhat.com> 1:3.1_fc-0.M5.1
- New 3.1M5a build using upstream build method.
- Re-organize sub-packages (ecj, platform, platform-devel, jdt, jdt-devel, pde,
  pde-devel, fold gtk2 package into platform).
- Move jface and org.eclipse.text into libswt3-gtk2.
- Bring in JPackage symlinks for packages we have in Fedora (David Walluck) and
  put in %%prep.
- Work around x86_64 filename differences.
- Remove xerces, xalan, and xml-commons-apis requirement (and LD_PRELOAD from
  script).
- Bootstrap build.