Blob Blame History Raw
Epoch: 1
ExclusiveArch: i386 x86_64 ppc

%ifarch %{ix86}
%define eclipse_arch    x86
%endif
%ifarch x86_64
%define eclipse_arch	x86_64
%endif
%ifarch ia64
%define eclipse_arch	ia64
%endif
%ifarch ppc
%define eclipse_arch    ppc
%endif
%ifarch ppc64
%define eclipse_arch	ppc64
%endif
%ifarch ppc64pseries
%define eclipse_arch	ppc64
%endif

%define pkg_summary		C/C++ Development Tools (CDT) plugin for Eclipse
%define eclipse_name		eclipse
%define major   		3
%define minor   		0	
%define majmin  		%{major}.%{minor}
%define micro   		0
%define eclipse_base   		%{_datadir}/%{eclipse_name}
%define eclipse_lib_base 	%{_libdir}/%{eclipse_name}

Summary: 	%{pkg_summary}
Name: 		%{eclipse_name}-cdt
Version: 	%{majmin}.%{micro}_fc
Release: 	0.M6.4
License:	Eclipse Public License - v 1.0 (EPL) <http://www.eclipse.org/legal/epl-v10.html>
Group: 		Text Editors/Integrated Development Environments (IDE)
URL:		http://www.eclipse.org/cdt
Requires:	eclipse-platform
Requires:	gcc-java

Source0: %{name}-fetched-src-3.0M6.tar.gz
Patch1: %{name}-no-cvs2-patch
Patch2: %{name}-platform-build-linux.patch
Patch3: %{name}-sdk-build-linux.patch
Patch4: %{name}-no-tests.patch
Patch5: %{name}-no-sdkbuild.patch
Patch6: %{name}-libhover.patch

BuildRequires: 	jpackage-utils >= 0:1.5
BuildRequires: 	gtk2-devel
BuildRequires: 	glib2-devel
BuildRequires: 	gnome-vfs2-devel
BuildRequires: 	desktop-file-utils
BuildRequires: 	eclipse-platform
BuildRequires: 	eclipse-jdt
BuildRequires: 	eclipse-pde
BuildRequires: 	libswt3-gtk2
BuildRequires: 	eclipse-gtk2
BuildRequires:  gcc-java >= 4.0.0-0.35
BuildRequires:  java-1.4.2-gcj-compat-devel >= 1.4.2.0-40jpp_4rh

Requires: 	ctags gdb make eclipse-platform
Requires:       java-1.4.2-gcj-compat >= 1.4.2.0-40jpp_14rh
Requires:       gcc-java >= 4.0.0-0.35

BuildRoot: 	%{_tmppath}/%{name}-buildroot

%description
The eclipse-cdt package contains Eclipse features and plugins that are
useful for C and C++ development.


%prep
%setup -q -c 
pushd "org.eclipse.cdt.releng"
%patch1 -p0
%patch2 -p0
%patch3 -p0
%patch4 -p0
%patch5 -p0
%patch6 -p0
popd

# Upstream CVS includes random .so files.  Let's remove them now.
# We actually remove the entire "os" directory since otherwise
# we wind up with some empty directories that we don't want.
#rm -r org.eclipse.cdt.releng/results/plugins/org.eclipse.cdt.core.linux/os

%build
export JAVA_HOME=%{java_home}
export PATH=%{java_bin}:/usr/bin:$PATH

# See comments in the script to understand this.
/bin/sh -x %{eclipse_base}/buildscripts/copy-platform SDK %{eclipse_base}
SDK=$(cd SDK >/dev/null && pwd)

# Eclipse may try to write to the home directory.
mkdir home
mkdir native

homedir=$(cd home > /dev/null && pwd)
nativehome=$(cd native > /dev/null && pwd)

pushd `pwd`
cd org.eclipse.cdt.releng

pushd results/plugins/org.eclipse.cdt.core.linux/library
make JAVA_HOME="%{java_home}" ARCH=%{eclipse_arch} CC='gcc -D_GNU_SOURCE'
popd

# Call eclipse headless to process changelong releng build scripts
# need -Dosgi.install.area for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20198
java -cp  $SDK/startup.jar \
    -Duser.home=$homedir \
    -Dosgi.install.area=%{eclipse_base} \
    -Dorg.eclipse.core.runtime.ignoreLockFile=true \
     org.eclipse.core.launcher.Main \
    -application org.eclipse.ant.core.antRunner \
    -DjavacFailOnError=true \
    -DdontUnzip=true \
    -DbaseLocation=$SDK \
    -Dpde.build.scripts=$SDK/plugins/org.eclipse.pde.build_3.1.0/scripts \
    -DdontFetchAnything=true

# Build the each .jar to .so. We have to extract them from the tar file
# that the releng build produces
popd

if ! [ -e $(pwd)/org.eclipse.cdt.releng/results/org.eclipse.cdt.sdk-*-linux.%{eclipse_arch}* ]; then
     buildArch="x86"
else
     buildArch=%{eclipse_arch}
fi

for file in $(pwd)/org.eclipse.cdt.releng/results/I.*/*.tar.gz; do
  case $file in
     */org.eclipse.cdt-*-linux.$buildArch.*)
	 tar -zxv -C $nativehome -f $file *.jar
	 cd $nativehome/eclipse/plugins
	 for jarname in `find . -type f -name "*.jar"`; do
		jarname=`echo $jarname | cut -c3-`
		gcj -fPIC -fjni -O2 -findirect-dispatch -shared -Wl,-Bsymbolic  -o $jarname.so $jarname

		# Once compiled, we don't care about the jar (it's still in the original tar)
		rm $jarname
	 done 
   ;;
  esac
done

%install
nativehome=$(cd native > /dev/null && pwd)
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}/%{eclipse_base}

for file in $(pwd)/org.eclipse.cdt.releng/results/I.*/*.tar.gz; do
  case $file in
    *org.eclipse.cdt-*-linux*)
      # The ".." is needed since the zip files contain "eclipse/foo".
      (cd $RPM_BUILD_ROOT/%{eclipse_base}/.. && tar zxvf $file)
      ;;
  esac
done

# Create mappings directory
install -d -m755 $RPM_BUILD_ROOT/`gcj-dbtool -p %{_libdir}`.d

# Create the initial cdt database
gcjdbdir=$RPM_BUILD_ROOT`gcj-dbtool -p %{_libdir}`.d
gcj-dbtool -n $gcjdbdir/%{name}.db 8000


# Create plugins directory in eclipse lib base
install -d -m755 $RPM_BUILD_ROOT/%{eclipse_lib_base}/plugins/

# Populate db with mappings
for j in `find $RPM_BUILD_ROOT/%{eclipse_base} -name \*.jar`; do
    gcj-dbtool -f $gcjdbdir/%{name}.db \
      $j `echo $j | sed "s:$RPM_BUILD_ROOT/::" | sed "s:%{_datadir}:%{_libdir}:"`.so;
done

cd $nativehome/eclipse/plugins

# Copy the .so(s) we created earlier into the build root
for file in `find . -type f -name *.so`; do
	install -m755 -d $RPM_BUILD_ROOT/%{eclipse_lib_base}/plugins/`dirname $file`
	install -m644 $file $RPM_BUILD_ROOT/%{eclipse_lib_base}/plugins/`dirname $file`
done


# We move the libraries to libdir, leaving symlinks behind.  And since
# zip doesn't preserve file permissions, we must also mark all the .so
# files as executable.
(
cd $RPM_BUILD_ROOT
find ./%{eclipse_base} -name '*.so' -print |
while read sofile; do
  newname=$(echo "$sofile" | sed -e 's,^./%{eclipse_base},%{_libdir}/eclipse,')
  mkdir -p ./$(dirname "$newname")
  mv $sofile ./$newname
  ln -s $newname $sofile
done
)

%post
rebuild-gcj-db %{_libdir}

%postun
rebuild-gcj-db %{_libdir}

%files
%defattr(-,root,root)
%{_libdir}/gcj-4.0.0/classmap.db.d/%{name}.db
%{eclipse_base}/features/org.eclipse.cdt*
%{eclipse_base}/plugins/org.eclipse.cdt*
%{eclipse_lib_base}/plugins/org.eclipse.cdt*

# Cannot get dir name org.eclipse.cdt.source.linux.*.x86_2.0.2 to glob
# properly. Will fix later  
#%{eclipse_base}/features/org.eclipse.cdt.sdk_%{majmin}.%{micro}
#%{eclipse_base}/features/org.eclipse.cdt_%{majmin}.%{micro}
#%{eclipse_base}/features/org.eclipse.cdt.source_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.core_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.core.linux_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.debug.core_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.debug.mi.core_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.debug.mi.ui_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.debug.ui_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.doc.user_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.launch_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.make.core_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.make.ui_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.managedbuilder.core_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.managedbuilder.ui_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.sdk_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.ui_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.source_%{majmin}.%{micro}
#%{eclipse_base}/plugins/org.eclipse.cdt.source.linux*
#%{eclipse_base}/plugins/org.eclipse.cdt.ui.libhover_1.0.0
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.core.linux_%{majmin}.%{micro}
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.core_%{majmin}.%{micro}
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.debug.core_%{majmin}.%{micro}
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.debug.mi.core_%{majmin}.%{micro}
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.debug.mi.ui_%{majmin}.%{micro}
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.debug.ui_%{majmin}.%{micro}
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.launch_%{majmin}.%{micro}
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.make.core_%{majmin}.%{micro}
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.make.ui_%{majmin}.%{micro}
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.managedbuilder.core_%{majmin}.%{micro}
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.managedbuilder.ui_%{majmin}.%{micro}
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.ui.libhover_1.0.0
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.ui_%{majmin}.%{micro}


%changelog
* Thu Apr 21 2005 Phil Muldoon <pmuldoon@redhat.com> 3.0.0_fc-0.M6.4
- Added Chris Moller's libhover patch

* Sat Apr 16 2005 Ben Konrath <bkonrath@redhat.com> 3.0.0_fc-0.M6.3
- Clean up spec file (remove references to old patches and rh docs).

* Fri Apr 15 2005 Phil Muldoon <pmuldoon@redhat.com> 3.0.0_fc-0.M6.2
- Generated tarball from official final tagged M6 build

* Mon Apr 11 2005 Phil Muldoon <pmuldoon@redhat.com> 3.0.0_fc-0.M6.1
- Fixed db path in java -cp
- Regenerated tarball from M6 canditate build
- Reworked patches for M6 canditate Build

* Thu Apr 07 2005 Phil Muldoon <pmuldoon@redhat.com> 3.0.0_fc-0.M5.4
- Changed Requires eclipse-ui to eclipse-platform
- Added Requires java-1.4.2-gcj-compat >= 1.4.2.0-40jpp_14rh
- Added Requires gcc-java >= 4.0.0-0.35

* Mon Apr 04 2005 Phil Muldoon <pmuldoon@redhat.com> 3.0.0_fc-0.M5.3
- Added eclipse-cdt-no-sdkbuild.patch to build for platform only (fc4 space crunch)

* Sun Apr 03 2005 Andrew Overholt <overholt@redhat.com> 3.0.0_fc-0.M5.2
- Make use of rebuild-gcj-db.
- Use system-wide classmap.db.

* Wed Mar 23 2005 Phil Muldoon <pmuldoon@redhat.com> 3.0.0-1
- Updated to upstream CDT 3.0.0 M5 sources
- Removed Source1 (rhdocs) for now
- Removed libhover patch until updated
- Added eclipse-cdt-platform-build-linux.patch
- Added eclipse-cdt-sdk-build-linux.patch
- Stopped tests build for now (Added eclipse-cdt-no-tests.patch)
- Added Requires gcc-java (bz# 151866)
- Added new central db logic

* Fri Mar 4 2005 Phil Muldoon <pmuldoon@redhat.com> 2.0.2-3
- Added x86_64 to ExclusiveArch

* Thu Mar 3 2005 Phil Muldoon <pmuldoon@redhat.com> 2.0.2-2
- Moved upstream sources back to 2.0.2
- Revered back to releng build
- Added native build sections to spec file

* Tue Jan 11 2005 Ben Konrath <bkonrath@redhat.com> 2.1.0-1
- add devel rpm and use the patched sources for it
- update sources to 2.1.0
- new build method that does not require pre-fetched sources

* Sun Nov 07 2004 Ben Konrath <bkonrath@redhat.com> 2.0.2-1
- Update sources to 2.0.2
- Change which files are unzipped in the install phase - this changed in 2.0.2
- Update Red Hat documentation sources
- Remove no-cvs-patch as it is no longer needed (no-cvs2-patch is still needed)
- Update ui-libhover-patch 
- Add how-to document for doc and source tarball generation
- Add fetch-tests-patch for tarball generation

* Mon Jul 26 2004 Jeremy Handcock <handcock@redhat.com> 2.0-11
- Update Red Hat documentation sources

* Fri Jul 23 2004 Tom Tromey <tromey@redhat.com> 2.0-10
- Set user.home on all java invocations

* Fri Jul 23 2004 Tom Tromey <tromey@redhat.com> 2.0-9
- Pass dontFetchAnything to the build

* Fri Jul 23 2004 Tom Tromey <tromey@redhat.com> 2.0-8
- Patch from Phil Muldoon to avoid cvs operations

* Fri Jul 23 2004 Jeremy Handcock <handcock@redhat.com> 2.0-7
- Don't build on ppc64
- Require eclipse-ui, not eclipse-platform

* Fri Jul 23 2004 Tom Tromey <tromey@redhat.com> 2.0-6
- Set user.home when building

* Wed Jul 21 2004 Tom Tromey <tromey@redhat.com> 2.0-5
- Make .so files executable

* Wed Jul 21 2004 Chris Moller <cmoller@redhat.com> 2.0-4
- Add texthover

* Tue Jul 20 2004 Jeremy Handcock <handcock@redhat.com> 2.0-4
- Update Red Hat documentation sources

* Fri Jul 16 2004 Tom Tromey <tromey@redhat.com> 2.0-3
- Make platform symlink tree before building

* Fri Jul 16 2004 Jeremy Handcock <handcock@redhat.com> 2.0-3
- Add Red Hat-specific documentation
- Use `name' macro in source and patch names
- Correct BuildRequires to eclipse-platform

* Tue Jul 13 2004 Jeremy Handcock <handcock@redhat.com> 2.0-2
- Don't require ant
- Prevent possible `build' section overload

* Mon Jul 12 2004 Tom Tromey <tromey@redhat.com> 2.0-2
- Document source fetching process
- Update to CDT 2.0 final
- Set -D_GNU_SOURCE when building

* Fri Jul  9 2004 Tom Tromey <tromey@redhat.com> 2.0-2
- Don't define prefix
- Don't require pango

* Fri Jul  9 2004 Jeremy Handcock <handcock@redhat.com> 2.0-2
- Update sources to include tests from upstream
- Add new build patch for CDT tests
- Build CDT tests, but don't install them

* Thu Jul  8 2004 Tom Tromey <tromey@redhat.com> 2.0-1
- Removed unused patch

* Thu Jul  8 2004 Jeremy Handcock <handcock@redhat.com> 2.0-1
- Revert previous patch; don't unset javacVerbose

* Thu Jul  8 2004 Jeremy Handcock <handcock@redhat.com> 2.0-1
- Unset javacVerbose

* Tue Jun 15 2004 Tom Tromey <tromey@redhat.com> 2.0-1
- Updated to 2.0 M8

* Mon Jan 19 2004 Tom Tromey <tromey@redhat.com> 1.2.1-1
- Initial version