File eclipse.spec of Package eclipse

#
# spec file for package eclipse-archdep (Version 3.3)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild
# icecream 0

# WARNING: After editing this file please call Re or rpmbuild to update spec file:
#%(sh %{_sourcedir}/eclipse-prepare.sh %{_sourcedir} %{name})

%define build_archdep 0

Name:		eclipse
%if %build_archdep
# no versions for s390, s390x and ppc64 available!
# disabled ia64 until 1.5.0 Java on ia64 available
ExclusiveArch:  %{ix86} x86_64 ppc
%else
BuildArch:      noarch
%endif
BuildRequires:  ant-junit ant-nodeps gcc-c++ gnome-vfs2-devel gtk2-devel libgnome-devel libgnomeui-devel pkgconfig unzip update-desktop-files xml-commons-apis java-devel
%if %suse_version > 1020
BuildRequires:	fdupes 
%endif
# Uncomment if you want to test eclipse in the chroot environment:
#BuildRequires:  agfa-fonts ant fontconfig fonts-config gcc-c++ ghostscript-fonts-other ghostscript-fonts-std gnutls-devel jakarta-commons-logging libglade2-devel libgnomeprintui-devel libgnomeui-devel libwnck-devel openmotif regexp servlet23 servletapi5 update-alternatives update-desktop-files xml-commons-apis xorg-x11 xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-fonts-scalable zip
%define pkg_summary     An open extensible IDE
%define section         free
%define swt_version     3063
%define corelib_version 2_1_0b
%define eclipse_major   3
%define eclipse_minor   4
%define eclipse_micro   0
%define eclipse_majmin  %{eclipse_major}.%{eclipse_minor}
%define libname         libswt3
%define orig_name       eclipse
%define eclipsehome     %{_datadir}/%{orig_name}
Summary:        Eclipse Platform and Java IDE
Version:        3.4
Release:        86
License:        Eclipse Public License, see http://www.eclipse.org/legal/
Group:          Development/Tools/IDE
Url:            http://www.eclipse.org
Source0:        eclipse-sourceBuild-srcIncluded-%{version}.tar.bz2
Source1:        %{orig_name}.script
Source3:        icon.xpm
Source4:        %{orig_name}-32.png
Source6:        %{orig_name}.conf
Source15:       %{orig_name}.desktop

Source20:       %{orig_name}.files
Source21:       %{orig_name}.files-jdt
Source22:       %{orig_name}.files-pde
Source23:       %{orig_name}.files-platform
Source24:       %{orig_name}.files-source

Source30:       %{orig_name}-archdep.files-platform
Source31:       %{orig_name}-archdep.files-libswt3-gtk2

Source50:       hardlink_duplicates.sh
Source51:	AnnotationProcessors.java
Nosource:	51
Source52:	README.packager
Nosource:	52
Source53:       eclipse-prepare.sh
Nosource:       53

Patch:          eclipse-%{version}-fix_build.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%if ! %build_archdep
Requires:       java >= 1.6.0
Recommends:	%{orig_name}-jdt = %{version}
Recommends:     %{orig_name}-pde = %{version}
Requires:       %{orig_name}-platform = %{version}
Requires:	%{orig_name}-archdep-platform = %{version}
Requires:	libswt3-gtk2 = %{version}
%endif

%if %build_archdep

%description
The Eclipse Platform is designed for building integrated development
environments (IDEs) that can be extended by custom plug-ins. The base
distribution also contains a full-featured Java development
environment.

NOTE: Although it runs with the open source gcj Java, it is advisable
to install SUN's, IBM's or BEA's Java
(java-1_4_2-sun,java-1_5_0-sun,java-1_4_2-ibm, java-1_5_0-ibm or
java-1_4_2-bea) due to performance reasons.



Authors:
--------
    IBM

%package        platform
Summary:        Eclipse platform common files
Group:          Development/Tools/IDE
Requires:       ant, regexp >= 1.2
Requires:       jakarta-commons-logging
Requires:       servlet23
Requires:	%{orig_name} = %{version}

%description    platform
The Eclipse Platform is designed for building integrated development
environments (IDEs) which can be extended by custom plugins.

This package contains the 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.



Authors:
--------
    IBM

%package     -n libswt3-gtk2
Summary:        SWT Library for GTK2
Group:          Development/Tools/IDE
Requires:	%{orig_name} = %{version}

%description -n libswt3-gtk2
SWT is the software component that delivers native widget functionality
for the Eclipse platform in an operating system independent manner.  It
is analogous to AWT/Swing in Java with a difference - SWT uses a rich
set of native widgets.



Authors:
--------
    IBM

%else

%description
The Eclipse Platform is designed for building integrated development
environments (IDEs) that can be extended by custom plug-ins. The base
distribution also contains a full-featured Java development
environment.

NOTE: Although it runs with the open source gcj Java, it is advisable
to install SUN's, IBM's or BEA's Java
(java-1_4_2-sun,java-1_5_0-sun,java-1_4_2-ibm, java-1_5_0-ibm or
java-1_4_2-bea) due to performance reasons.



Authors:
--------
    IBM

%package        platform
Summary:        Eclipse platform common files
Group:          Development/Tools/IDE
Requires:       ant, regexp >= 1.2
Requires:       jakarta-commons-logging
Requires:       servlet23
Provides:       eclipse:/opt/eclipse/eclipse
Obsoletes:      %{name}-sdk
Provides:       %{name}-sdk
Requires:	%{orig_name} = %{version}

%description    platform
The Eclipse Platform is designed for building integrated development
environments (IDEs) which can be extended by custom plugins.

This package contains the 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.



Authors:
--------
    IBM

%package        jdt
Summary:        Eclipse Java development tools
Group:          Development/Tools/IDE
Requires:       junit
Requires:	%{orig_name} = %{version}

%description    jdt
The Eclipse Platform is designed for building integrated development
environments (IDEs) which can be extended by custom plugins.

This package contains the Eclipse Java development tools, a
full-featured Java development environment.



Authors:
--------
    IBM

%package        source
Summary:        Eclipse Source
Group:          Development/Tools/IDE

%description    source
The Eclipse Platform is designed for building integrated development
environments (IDEs) which can be extended by custom plugins.

This package contains the sources for the Eclipse Platform and Java
IDE.



Authors:
--------
    IBM

%package        pde
Summary:        Eclipse Plugin Development Environment
Group:          Development/Tools/IDE
Requires:	%{orig_name} = %{version}
Requires:	%{orig_name}-jdt = %{version}

%description    pde
The Eclipse Platform is designed for building integrated development
environments (IDEs) which can be extended by custom plugins.

This package contains the Eclipse Plugin Development Environment.



Authors:
--------
    IBM

%endif

%prep
%setup -q -c
%patch
# create files.exclude list
for file in %{SOURCE20} %{SOURCE21} %{SOURCE22} %{SOURCE23} %{SOURCE24}; do
        sed 's/^/%exclude /' $file > $file.exclude
        cat $file.exclude >> files-noarch.exclude
done
for file in %{SOURCE30} %{SOURCE31}; do
        sed 's/^/%exclude /' $file > $file.exclude
        cat $file.exclude >> files-archdep.exclude
done
# add the files.exclude list to the list of files
cat %{SOURCE20} files-archdep.exclude > source20+archdep-exclude.files
cat %{SOURCE30} files-noarch.exclude  > source30+noarch-exclude.files

%build
export CLASSPATH=$CLASSPATH:$(build-classpath ant ant-launcher glibj)
# temporary fix
export CLASSPATH='/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar'
# find out current arch, substitute i386 -> x86
ECLIPSE_ARCH=`uname -i`
ECLIPSE_ARCH=${ECLIPSE_ARCH/i386/x86}
sh build -os linux -ws gtk -arch ${ECLIPSE_ARCH} %{_libdir}/jvm/java -compilelibs 
pushd result
tar xvzf linux-gtk-${ECLIPSE_ARCH}-sdk.tar.gz
popd

%install
export NO_BRP_CHECK_BYTECODE_VERSION="true"
install -d $RPM_BUILD_ROOT/%{eclipsehome}
install -d $RPM_BUILD_ROOT/usr/bin
cp -a result/eclipse/features $RPM_BUILD_ROOT/%{eclipsehome}/features
cp -a result/eclipse/plugins $RPM_BUILD_ROOT/%{eclipsehome}/plugins
cp -a result/eclipse/configuration $RPM_BUILD_ROOT/%{eclipsehome}/configuration
for file in eclipse eclipse.ini .eclipseproduct
do
  install result/eclipse/$file $RPM_BUILD_ROOT/%{eclipsehome}
done
install %{SOURCE3} $RPM_BUILD_ROOT/%{eclipsehome}
install -d $RPM_BUILD_ROOT/%{_defaultdocdir}/%{orig_name}
cp -a result/eclipse/readme $RPM_BUILD_ROOT/%{_defaultdocdir}/%{orig_name}
install -m644 result/eclipse/epl-v10.html $RPM_BUILD_ROOT/%{_defaultdocdir}/%{orig_name}
install -m644 result/eclipse/notice.html $RPM_BUILD_ROOT/%{_defaultdocdir}/%{orig_name}
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/usr/bin/eclipse
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
perl -pe 's|/usr/lib/eclipse/|%{_datadir}/%{orig_name}/|g' \
  %{SOURCE6} > $RPM_BUILD_ROOT%{_sysconfdir}/eclipse.conf
# swt libraries
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
pushd $RPM_BUILD_ROOT%{_javadir}
# find out current arch, substitute i386 -> x86
ECLIPSE_ARCH=`uname -i`
ECLIPSE_ARCH=${ECLIPSE_ARCH/i386/x86}
SWTGTK_JAR=`cd $RPM_BUILD_ROOT/%{_datadir}/%{orig_name}/plugins && find . -name org.eclipse.swt.gtk.linux.${ECLIPSE_ARCH}_%{eclipse_major}*.jar`
ln -sf %{_datadir}/%{orig_name}/plugins/$SWTGTK_JAR swt-gtk-%{version}.jar
popd
# icon and menu entry
mkdir -p $RPM_BUILD_ROOT/usr/share/applications
mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT/usr/share/pixmaps/eclipse.png
%suse_update_desktop_file -i eclipse Development IDE
cat >> $RPM_BUILD_ROOT%{_datadir}/%{orig_name}/.eclipseproduct << EOF
name=Eclipse Platform
id=org.eclipse.platform
version=%{eclipse_majmin}.%{eclipse_micro}
EOF
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/%{orig_name}/plugins
cd $RPM_BUILD_ROOT/%{eclipsehome}
# move arch-dependent files to %_libdir
for file in $(ls -d plugins/org.eclipse.equinox.launcher.gtk.* plugins/org.eclipse.swt.gtk*_3.* plugins/org.eclipse.*.source.linux.gtk.*_3.* plugins/org.eclipse.core.filesystem.linux*.jar plugins/org.eclipse.update.core.linux*.jar eclipse)
do 
  mv $file $RPM_BUILD_ROOT/%{_libdir}/%{orig_name}/$file; 
  ln -sf   %{_libdir}/%{orig_name}/$file $file
done 
# eclipse wrapper script
mv eclipse eclipse.bin
STARTUP_JAR=$( find . -name 'org.eclipse.equinox.launcher_*.jar' )
cat >>eclipse<<EOF
#!/bin/bash
STARTUP_JAR="%{eclipsehome}/$STARTUP_JAR"
%{eclipsehome}/eclipse.bin -startup \$STARTUP_JAR "\$@"
EOF
# source hardlink_duplicates code
. %{SOURCE50}
find $RPM_BUILD_ROOT \( -name "*.jar" -a -type f -a ! -empty \) -exec jar -i {} \;
cd $RPM_BUILD_ROOT
IGNORE_FILENAMES=""
hardlink_duplicates
# delete windows *.bat and *.cmd files
find $RPM_BUILD_ROOT \( -name "*.bat" -o -name "*.cmd" \) -exec rm -rf {} +

%clean
rm -rf $RPM_BUILD_ROOT


%if %build_archdep

%files platform -f source30+noarch-exclude.files

%files -n %{libname}-gtk2 -f %{SOURCE31} 

%else

%files -f source20+archdep-exclude.files

%files jdt -f %{SOURCE21}

%files pde -f %{SOURCE22}

%files platform -f %{SOURCE23}

%files source -f %{SOURCE24}

%endif

%changelog
* Fri Jan 04 2008 - anosek@suse.cz
- really fixed parameters passing issue [#307488]
* Thu Oct 11 2007 - sbrabec@suse.cz
- Removed bogus dependency on mDNSResponder.
* Tue Oct 09 2007 - anosek@suse.cz
- fixed Eclipse fails to start [#328671]
  * added Requires: java >= 1.6.0 to
  eclipse-archdep-platform-commons and eclipse-archdep-platform
* Fri Sep 14 2007 - anosek@suse.cz
- fixed Eclipse does not pass parameters to eclipse.bin [#307488]
* Sat Jul 14 2007 - coolo@suse.de
- add desktop file to the sources to fix build
* Mon Jul 02 2007 - dbornkessel@suse.de
- update to final 3.3 release
- replaced troublesome file src/com/sun/mirror/apt/AnnotationProcessors.java by GPL version (Bug #285156)
* Tue Jun 26 2007 - dbornkessel@suse.de
- update to next milestone 3.3RC4
* Mon Jun 11 2007 - dbornkessel@suse.de
- removed VMARGS from eclipse.conf (Bug #227263 )
* Mon Jun 11 2007 - dbornkessel@suse.de
- update to next milestone m3
* Mon Jun 11 2007 - dbornkessel@suse.de
- update to next milestone m3
* Wed May 30 2007 - dbornkessel@suse.de
- the original eclipse-* package and it's sub-packages are now renamed to eclipse-archdep-*; this is a noarch package now; in order to be complete, it needs the arch-dependent packages:
  - eclipse-archdep-gtk2-<version>-<release>.<arch>.rpm
  - eclipse-archdep-platform-<version>-<release>.<arch>.rpm
  - libswt3-gtk2-<version>-<release>.<arch>.rpm
  it creates the packges:
  - eclipse-<version>-<release>.noarch.rpm
  - eclipse-jdt-<version>-<release>.noarch.rpm
  - eclipse-pde-<version>-<release>.noarch.rpm
  - eclipse-platform-<version>-<release>.noarch.rpm
  - eclipse-scripts-<version>-<release>.noarch.rpm
  - eclipse-source-<version>-<release>.noarch.rpm
* Wed May 30 2007 - dbornkessel@suse.de
- renamed package and sub-packages to eclipse-archdep-*; the eclipse-* packages are now noarch packges
- split eclipse-platform in eclipse-archdep-platform and eclipse-archdep-platform-commons
- moved arch dependent files to %%{_libdir}/eclipse
- update to 3.3RC2 (Europa)
* Tue Nov 21 2006 - dbornkessel@suse.de
- adjusted x86_64 build to function with updated jpackage-utils package
* Wed Nov 15 2006 - dbornkessel@suse.de
- correct wrong file lists (Bug #220245)
* Sat Nov 11 2006 - aj@suse.de
- Fix permissions of doc files.
* Thu Sep 28 2006 - dbornkessel@suse.de
- update to version 3.2.1
- delete redundant BuildRequires
* Mon Sep 18 2006 - dbornkessel@suse.de
- added ecj-bootstrap spec
* Thu Jul 27 2006 - dbornkessel@suse.de
- builds now on i386, ppc, x86_64 and ia64
* Wed Jul 05 2006 - dbornkessel@suse.de
- enabled x86_64 and ia64 builds
* Fri Mar 10 2006 - dbornkessel@suse.de
- enabled ppc build
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Wed Jan 18 2006 - dbornkessel@suse.de
- update to 3.1.1
* Thu Sep 29 2005 - dmueller@suse.de
- add norootforbuild
* Tue Aug 23 2005 - skh@suse.de
- let eclipse require eclipse-gtk2 so that there's never only
  the README installed [#106699]
* Tue Aug 09 2005 - hvogel@suse.de
- make eclipse binary executeable again [Bug #102675]
* Fri Aug 05 2005 - skh@suse.de
- update to 3.1 final
- clean up specfile
* Tue Apr 19 2005 - mmj@suse.de
- NULL terminate functions that are supposed to be NULL terminated
* Mon Feb 21 2005 - skh@suse.de
- update to version 3.0.1
* Tue Sep 28 2004 - skh@suse.de
- Improved Provides: of eclipse-platform to enable update from old
  eclipse package and fix #46308
* Mon Sep 20 2004 - ro@suse.de
- added main package containing only a readme
* Thu Sep 16 2004 - skh@suse.de
- Remove bogus Requires: lucene
* Sat Sep 11 2004 - skh@suse.de
- update to 3.0 (i386 only for now)
- use JPackage package layout, splitting into the following
  subpackages:
  - eclipse-platform
  - eclipse-gtk2
  - eclipse-jdt
  - eclipse-source
  - eclipse-pde
  - eclipse-scripts
  - libswt3-gtk2
* Thu Jul 08 2004 - skh@suse.de
- Remove java2 and add BEAJava2 to neededforbuild to fix build
  (#42849)
- source setJava from eclipse wrapper script if no java in $PATH
* Thu May 13 2004 - skh@suse.de
- update to version 2.1.3
* Fri Apr 23 2004 - skh@suse.de
- Allow SWT to use deprecated gtk functions until a real fix is
  available from the eclipse project.
* Mon Mar 15 2004 - skh@suse.de
- Really fix #34496 (not only create the needed file, but also
  install it...)
- Removed eclipse.desktop file from sources, all done automagically
  now by the %%suse_update_desktop_file macro.
* Tue Feb 17 2004 - skh@suse.de
- use gnome2-devel-packages in neededforbuild
- Replace buggy wrapper script with a better one (#34496)
- Fixed problem with correct generation of local workspace
  configuration ("Completing install..." only once now, not every
  time eclipse is started, #34496)
* Mon Feb 16 2004 - skh@suse.de
- update to version 2.1.2
* Thu Feb 12 2004 - ro@suse.de
- added gconf2 to neededforbuild
* Sat Jan 10 2004 - adrian@suse.de
- build as user
* Thu Oct 16 2003 - skh@suse.de
- fix build (use libbonobo instead of bonobo-activation)
* Tue Sep 02 2003 - skh@suse.de
- fix LD_LIBRARY_PATH in wrapper script
* Mon Sep 01 2003 - adrian@suse.de
- add Categories
* Mon Sep 01 2003 - skh@suse.de
- added .desktop file and icon
* Sat Aug 23 2003 - ro@suse.de
- jakarta-ant was renamed to apache-ant
* Mon Aug 18 2003 - skh@suse.de
- fix build with non-SUN javas
- be a bigpack
* Wed Jul 30 2003 - ro@suse.de
- fix build (help to find glib in /opt/gnome)
* Mon Jul 28 2003 - skh@suse.de
- initial package
openSUSE Build Service is sponsored by