2777248
Epoch: 1
2777248
ExclusiveArch: i386 ppc
2777248
cvsdist 977444b
%ifarch %{ix86}
cvsdist 977444b
%define eclipse_arch    x86
cvsdist 977444b
%endif
2777248
%ifarch x86_64
2777248
%define eclipse_arch	x86_64
cvsdist 977444b
%endif
cvsdist 977444b
%ifarch ia64
cvsdist 977444b
%define eclipse_arch	ia64
cvsdist 977444b
%endif
Ben Konrath 53357d2
%ifarch ppc
2777248
%define eclipse_arch    ppc
Ben Konrath 53357d2
%endif
2777248
%ifarch ppc64
2777248
%define eclipse_arch	ppc64
cvsdist 977444b
%endif
2777248
%ifarch ppc64pseries
2777248
%define eclipse_arch	ppc64
cvsdist 977444b
%endif
cvsdist 977444b
2777248
%define pkg_summary		C/C++ Development Tools (CDT) plugin for Eclipse
2777248
%define eclipse_name		eclipse
2777248
%define major   		2
2777248
%define minor   		0	
2777248
%define majmin  		%{major}.%{minor}
2777248
%define micro   		2
2777248
%define eclipse_base   		%{_datadir}/%{eclipse_name}
2777248
%define eclipse_lib_base 	%{_libdir}/%{eclipse_name}
2777248
2777248
Summary: 	%{pkg_summary}
2777248
Name: 		%{eclipse_name}-cdt
2777248
Version: 	%{majmin}.%{micro}_fc
2777248
Release: 	2
Ben Konrath 53357d2
License:	Eclipse Public License - v 1.0 (EPL) <http://www.eclipse.org/legal/epl-v10.html>
Ben Konrath 53357d2
Group: 		Text Editors/Integrated Development Environments (IDE)
Ben Konrath 53357d2
URL:		http://www.eclipse.org/cdt
2777248
Requires: 	eclipse-ui
2777248
2777248
Source0: %{name}-fetched-src-with-tests-2.0.2.tar.gz
2777248
Source1: %{name}-rhdocs-r20041107.tar.gz
2777248
Patch0: %{name}-build-tests-patch
2777248
#Patch2: %{name}-debug-build-patch
2777248
Patch3: %{name}-ui-libhover-patch
2777248
Patch4: %{name}-no-cvs2-patch
2777248
Ben Konrath 53357d2
Ben Konrath 53357d2
BuildRequires: 	jpackage-utils >= 0:1.5
Ben Konrath 53357d2
BuildRequires: 	gtk2-devel
Ben Konrath 53357d2
BuildRequires: 	glib2-devel
Ben Konrath 53357d2
BuildRequires: 	gnome-vfs2-devel
Ben Konrath 53357d2
BuildRequires: 	desktop-file-utils
Ben Konrath 53357d2
BuildRequires: 	eclipse-platform
Ben Konrath 53357d2
BuildRequires: 	eclipse-jdt
Ben Konrath 53357d2
BuildRequires: 	eclipse-pde
Ben Konrath 53357d2
BuildRequires: 	libswt3-gtk2
Ben Konrath 53357d2
BuildRequires: 	eclipse-gtk2
2777248
BuildRequires:  gcc-java >= 4.0.0-0.30
2777248
BuildRequires:  java-1.4.2-gcj-compat-devel >= 1.4.2.0-40jpp_4rh
Ben Konrath 53357d2
Ben Konrath 53357d2
Requires: 	ctags gdb make eclipse-ui
Ben Konrath 53357d2
Ben Konrath 53357d2
BuildRoot: 	%{_tmppath}/%{name}-buildroot
cvsdist 977444b
cvsdist 977444b
%description
cvsdist 977444b
The eclipse-cdt package contains Eclipse features and plugins that are
cvsdist 977444b
useful for C and C++ development.
cvsdist 977444b
Ben Konrath 53357d2
cvsdist 977444b
%prep
cvsdist 977444b
%setup -q -c 
2777248
pushd "org.eclipse.cdt.releng"
2777248
%patch0 -p0
2777248
#popd
2777248
#%patch2 -p0
2777248
#pushd "org.eclipse.cdt.releng"
2777248
%patch3 -p0
2777248
%patch4 -p0
cvsdist 977444b
popd
cvsdist 977444b
2777248
# Upstream CVS includes random .so files.  Let's remove them now.
2777248
# We actually remove the entire "os" directory since otherwise
2777248
# we wind up with some empty directories that we don't want.
2777248
rm -r org.eclipse.cdt.releng/results/plugins/org.eclipse.cdt.core.linux/os
2777248
2777248
# Overwrite eclipse.org documentation with our own
2777248
pushd org.eclipse.cdt.releng/results/plugins
2777248
/usr/bin/gzip -dc %{SOURCE1} | tar -xf -
cvsdist 977444b
popd
cvsdist 977444b
cvsdist 977444b
%build
cvsdist 977444b
export JAVA_HOME=%{java_home}
cvsdist 977444b
export PATH=%{java_bin}:/usr/bin:$PATH
cvsdist 977444b
cvsdist 977444b
# See comments in the script to understand this.
cvsdist 977444b
/bin/sh -x %{eclipse_base}/buildscripts/copy-platform SDK %{eclipse_base}
cvsdist 977444b
SDK=$(cd SDK >/dev/null && pwd)
cvsdist 977444b
cvsdist b43ade5
# Eclipse may try to write to the home directory.
cvsdist 977444b
mkdir home
2777248
mkdir native
2777248
cvsdist 977444b
homedir=$(cd home > /dev/null && pwd)
2777248
nativehome=$(cd native > /dev/null && pwd)
2777248
2777248
pushd `pwd`
2777248
cd org.eclipse.cdt.releng
cvsdist 977444b
2777248
pushd results/plugins/org.eclipse.cdt.core.linux/library
2777248
make JAVA_HOME="%{java_home}" ARCH=%{eclipse_arch} CC='gcc -D_GNU_SOURCE'
cvsdist 977444b
popd
cvsdist 977444b
2777248
# Call eclipse headless to process changelong releng build scripts
2777248
# need -Dosgi.install.area for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20198
2777248
java -cp  $SDK/startup.jar \
2777248
    -Duser.home=$homedir \
2777248
    -Dosgi.install.area=%{eclipse_base} \
2777248
    -Dorg.eclipse.core.runtime.ignoreLockFile=true \
2777248
    -Dgnu.gcj.runtime.VMClassLoader.library_control=never \
2777248
    -Dgnu.gcj.precompiled.db.path=%{eclipse_lib_base}/eclipse.db \
2777248
     org.eclipse.core.launcher.Main \
2777248
    -application org.eclipse.ant.core.antRunner \
2777248
    -DjavacFailOnError=true \
2777248
    -DdontUnzip=true \
2777248
    -DbaseLocation=$SDK \
2777248
    -Dpde.build.scripts=$SDK/plugins/org.eclipse.pde.build_3.1.0/scripts \
2777248
    -DdontFetchAnything=true
2777248
2777248
# Build the tests.  Note that we don't install them later.
2777248
#java -cp  $SDK/startup.jar \
2777248
#    -Duser.home=$homedir \
2777248
#    -Dosgi.install.area=%{eclipse_base} \
2777248
#    -Dorg.eclipse.core.runtime.ignoreLockFile=true \
2777248
#    -Dgnu.gcj.runtime.VMClassLoader.library_control=never \
2777248
#    -Dgnu.gcj.precompiled.db.path=%{eclipse_lib_base}/eclipse.db \
2777248
#     org.eclipse.core.launcher.Main \
2777248
#    -application org.eclipse.ant.core.antRunner test \
2777248
#    -DjavacFailOnError=true \
2777248
#    -DdontUnzip=true \
2777248
#    -DbaseLocation=$SDK \
2777248
#    -Dpde.build.scripts=$SDK/plugins/org.eclipse.pde.build_3.1.0/scripts \
2777248
#    -DdontFetchAnything=true
2777248
2777248
# Build the each .jar to .so. We have to extract them from the tar file
2777248
# that the releng build produces
2777248
popd
2777248
for file in $(pwd)/org.eclipse.cdt.releng/results/I.*/*.zip; do
2777248
  case $file in
2777248
     *-linux.*)
2777248
	 # Silly Eclipse build bug. Calls the result zip but really a tar.gz
2777248
	 # https://bugs.eclipse.org/bugs/show_bug.cgi?id=79711
2777248
	 tar -zxv -C $nativehome -f $file *.jar
2777248
	 cd $nativehome/eclipse/plugins
2777248
	 for jarname in `find . -type f -name "*.jar"`; do
2777248
		jarname=`echo $jarname | cut -c3-`
2777248
		gcj -fPIC -fjni -findirect-dispatch -shared -Wl,-Bsymbolic  -o $jarname.so $jarname
2777248
2777248
		# Once compiled, we don't care about the jar (it's still in the original tar)
2777248
		rm $jarname
2777248
2777248
		# Create a text mapping of the jar <-->so mapping for later use.
2777248
		echo %{eclipse_base}/plugins/$jarname::%{eclipse_lib_base}/plugins/$jarname.so >> %{name}.jarswithnativelibs
2777248
	 done 
2777248
   ;;
2777248
  esac
Ben Konrath 53357d2
done
cvsdist 977444b
cvsdist 977444b
%install
2777248
nativehome=$(cd native > /dev/null && pwd)
cvsdist 977444b
rm -rf ${RPM_BUILD_ROOT}
cvsdist 977444b
mkdir -p ${RPM_BUILD_ROOT}/%{eclipse_base}
cvsdist 977444b
2777248
for file in $(pwd)/org.eclipse.cdt.releng/results/I.*/*.zip; do
2777248
  case $file in
2777248
    *-linux.*)
2777248
      # The ".." is needed since the zip files contain "eclipse/foo".
2777248
      (cd $RPM_BUILD_ROOT/%{eclipse_base}/.. && tar zxvf $file)
2777248
      ;;
2777248
  esac
2777248
done
cvsdist 977444b
2777248
# Create mappings directory in eclipse lib base 
2777248
install -d -m755 $RPM_BUILD_ROOT/%{eclipse_lib_base}/mappings
cvsdist 977444b
2777248
# Create the initial changelog database
2777248
gcj-dbtool -n $RPM_BUILD_ROOT/%{eclipse_lib_base}/mappings/cdt.db 8000
2777248
2777248
2777248
# Create plugins directory in eclipse lib base
2777248
install -d -m755 $RPM_BUILD_ROOT/%{eclipse_lib_base}/plugins/
2777248
2777248
cd $nativehome/eclipse/plugins
2777248
2777248
# Install the text jar <--> so mapping we created when we compiled
2777248
install -m644 %{name}.jarswithnativelibs $RPM_BUILD_ROOT/%{eclipse_lib_base}
2777248
2777248
# Copy the .so(s) we created earlier into the build root
2777248
for file in `find . -type f -name *.so`; do
2777248
	install -m755 -d $RPM_BUILD_ROOT/%{eclipse_lib_base}/plugins/`dirname $file`
2777248
	install -m644 $file $RPM_BUILD_ROOT/%{eclipse_lib_base}/plugins/`dirname $file`
2777248
done
2777248
2777248
2777248
# We move the libraries to libdir, leaving symlinks behind.  And since
2777248
# zip doesn't preserve file permissions, we must also mark all the .so
2777248
# files as executable.
2777248
(
2777248
cd $RPM_BUILD_ROOT
2777248
find ./%{eclipse_base} -name '*.so' -print |
2777248
while read sofile; do
2777248
  newname=$(echo "$sofile" | sed -e 's,^./%{eclipse_base},%{_libdir}/eclipse,')
2777248
  mkdir -p ./$(dirname "$newname")
2777248
  mv $sofile ./$newname
2777248
  ln -s $newname $sofile
2777248
done
2777248
)
2777248
%post 
2777248
2777248
# Populate db with mappings
2777248
for j in `cat %{eclipse_lib_base}/%{name}.jarswithnativelibs`; do
2777248
  gcj-dbtool -a %{eclipse_lib_base}/mappings/cdt.db `echo $j | sed "s/::/ /"`
2777248
done
2777248
2777248
# Merge all dbs together after install
2777248
if [ -n "`find %{eclipse_lib_base}/mappings -name \*.db`" ]; then
2777248
   gcj-dbtool -m %{eclipse_lib_base}/eclipse.db `find %{eclipse_lib_base}/mappings -name \*.db`
2777248
fi
2777248
2777248
%postun
2777248
2777248
# After uninstall has removed our db, again merge the dbs
2777248
# to remove our entries
2777248
if [ -n "`find %{eclipse_lib_base}/mappings -name \*.db`" ]; then
2777248
   gcj-dbtool -m %{eclipse_lib_base}/eclipse.db `find %{eclipse_lib_base}/mappings -name \*.db`
2777248
fi
2777248
 
cvsdist 977444b
cvsdist 977444b
%files
cvsdist 977444b
%defattr(-,root,root)
2777248
%{eclipse_lib_base}/%{name}.jarswithnativelibs
2777248
%{eclipse_lib_base}/mappings/cdt.db
2777248
%{eclipse_base}/features/org.eclipse.cdt*
2777248
%{eclipse_base}/plugins/org.eclipse.cdt*
2777248
%{eclipse_lib_base}/plugins/org.eclipse.cdt*
2777248
2777248
# Cannot get dir name org.eclipse.cdt.source.linux.*.x86_2.0.2 to glob
2777248
# properly. Will fix later  
2777248
#%{eclipse_base}/features/org.eclipse.cdt.sdk_%{majmin}.%{micro}
2777248
#%{eclipse_base}/features/org.eclipse.cdt_%{majmin}.%{micro}
2777248
#%{eclipse_base}/features/org.eclipse.cdt.source_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.core_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.core.linux_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.debug.core_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.debug.mi.core_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.debug.mi.ui_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.debug.ui_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.doc.user_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.launch_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.make.core_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.make.ui_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.managedbuilder.core_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.managedbuilder.ui_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.sdk_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.ui_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.source_%{majmin}.%{micro}
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.source.linux*
2777248
#%{eclipse_base}/plugins/org.eclipse.cdt.ui.libhover_1.0.0
2777248
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.core.linux_%{majmin}.%{micro}
2777248
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.core_%{majmin}.%{micro}
2777248
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.debug.core_%{majmin}.%{micro}
2777248
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.debug.mi.core_%{majmin}.%{micro}
2777248
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.debug.mi.ui_%{majmin}.%{micro}
2777248
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.debug.ui_%{majmin}.%{micro}
2777248
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.launch_%{majmin}.%{micro}
2777248
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.make.core_%{majmin}.%{micro}
2777248
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.make.ui_%{majmin}.%{micro}
2777248
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.managedbuilder.core_%{majmin}.%{micro}
2777248
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.managedbuilder.ui_%{majmin}.%{micro}
2777248
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.ui.libhover_1.0.0
2777248
#%{eclipse_lib_base}/plugins/org.eclipse.cdt.ui_%{majmin}.%{micro}
2777248
cvsdist 977444b
cvsdist 977444b
%changelog
2777248
* Thu Mar 3 2005 Phil Muldoon <pmuldoon@redhat.com> 2.0.2-2
2777248
- Moved upstream sources back to 2.0.2
2777248
- Revered back to releng build
2777248
- Added native build sections to spec file
2777248
Ben Konrath 53357d2
* Tue Jan 11 2005 Ben Konrath <bkonrath@redhat.com> 2.1.0-1
Ben Konrath 53357d2
- add devel rpm and use the patched sources for it
Ben Konrath 53357d2
- update sources to 2.1.0
Ben Konrath 53357d2
- new build method that does not require pre-fetched sources
Ben Konrath 53357d2
Ben Konrath 53357d2
* Sun Nov 07 2004 Ben Konrath <bkonrath@redhat.com> 2.0.2-1
Ben Konrath 53357d2
- Update sources to 2.0.2
Ben Konrath 53357d2
- Change which files are unzipped in the install phase - this changed in 2.0.2
Ben Konrath 53357d2
- Update Red Hat documentation sources
Ben Konrath 53357d2
- Remove no-cvs-patch as it is no longer needed (no-cvs2-patch is still needed)
Ben Konrath 53357d2
- Update ui-libhover-patch 
Ben Konrath 53357d2
- Add how-to document for doc and source tarball generation
Ben Konrath 53357d2
- Add fetch-tests-patch for tarball generation
Ben Konrath 53357d2
cvsdist 7f9bda9
* Mon Jul 26 2004 Jeremy Handcock <handcock@redhat.com> 2.0-11
cvsdist 7f9bda9
- Update Red Hat documentation sources
cvsdist 7f9bda9
cvsdist b43ade5
* Fri Jul 23 2004 Tom Tromey <tromey@redhat.com> 2.0-10
cvsdist b43ade5
- Set user.home on all java invocations
cvsdist b43ade5
cvsdist b43ade5
* Fri Jul 23 2004 Tom Tromey <tromey@redhat.com> 2.0-9
cvsdist b43ade5
- Pass dontFetchAnything to the build
cvsdist b43ade5
cvsdist b43ade5
* Fri Jul 23 2004 Tom Tromey <tromey@redhat.com> 2.0-8
cvsdist b43ade5
- Patch from Phil Muldoon to avoid cvs operations
cvsdist b43ade5
cvsdist b43ade5
* Fri Jul 23 2004 Jeremy Handcock <handcock@redhat.com> 2.0-7
cvsdist b43ade5
- Don't build on ppc64
cvsdist b43ade5
- Require eclipse-ui, not eclipse-platform
cvsdist b43ade5
cvsdist b43ade5
* Fri Jul 23 2004 Tom Tromey <tromey@redhat.com> 2.0-6
cvsdist b43ade5
- Set user.home when building
cvsdist b43ade5
cvsdist 977444b
* Wed Jul 21 2004 Tom Tromey <tromey@redhat.com> 2.0-5
cvsdist 977444b
- Make .so files executable
cvsdist 977444b
cvsdist 977444b
* Wed Jul 21 2004 Chris Moller <cmoller@redhat.com> 2.0-4
cvsdist 977444b
- Add texthover
cvsdist 977444b
cvsdist 977444b
* Tue Jul 20 2004 Jeremy Handcock <handcock@redhat.com> 2.0-4
cvsdist 977444b
- Update Red Hat documentation sources
cvsdist 977444b
cvsdist 977444b
* Fri Jul 16 2004 Tom Tromey <tromey@redhat.com> 2.0-3
cvsdist 977444b
- Make platform symlink tree before building
cvsdist 977444b
cvsdist 977444b
* Fri Jul 16 2004 Jeremy Handcock <handcock@redhat.com> 2.0-3
cvsdist 977444b
- Add Red Hat-specific documentation
cvsdist 977444b
- Use `name' macro in source and patch names
cvsdist 977444b
- Correct BuildRequires to eclipse-platform
cvsdist 977444b
cvsdist 977444b
* Tue Jul 13 2004 Jeremy Handcock <handcock@redhat.com> 2.0-2
cvsdist 977444b
- Don't require ant
cvsdist 977444b
- Prevent possible `build' section overload
cvsdist 977444b
cvsdist 977444b
* Mon Jul 12 2004 Tom Tromey <tromey@redhat.com> 2.0-2
cvsdist 977444b
- Document source fetching process
cvsdist 977444b
- Update to CDT 2.0 final
cvsdist 977444b
- Set -D_GNU_SOURCE when building
cvsdist 977444b
cvsdist 977444b
* Fri Jul  9 2004 Tom Tromey <tromey@redhat.com> 2.0-2
cvsdist 977444b
- Don't define prefix
cvsdist 977444b
- Don't require pango
cvsdist 977444b
cvsdist 977444b
* Fri Jul  9 2004 Jeremy Handcock <handcock@redhat.com> 2.0-2
cvsdist 977444b
- Update sources to include tests from upstream
cvsdist 977444b
- Add new build patch for CDT tests
cvsdist 977444b
- Build CDT tests, but don't install them
cvsdist 977444b
cvsdist 977444b
* Thu Jul  8 2004 Tom Tromey <tromey@redhat.com> 2.0-1
cvsdist 977444b
- Removed unused patch
cvsdist 977444b
cvsdist 977444b
* Thu Jul  8 2004 Jeremy Handcock <handcock@redhat.com> 2.0-1
cvsdist 977444b
- Revert previous patch; don't unset javacVerbose
cvsdist 977444b
cvsdist 977444b
* Thu Jul  8 2004 Jeremy Handcock <handcock@redhat.com> 2.0-1
cvsdist 977444b
- Unset javacVerbose
cvsdist 977444b
cvsdist 977444b
* Tue Jun 15 2004 Tom Tromey <tromey@redhat.com> 2.0-1
cvsdist 977444b
- Updated to 2.0 M8
cvsdist 977444b
cvsdist 977444b
* Mon Jan 19 2004 Tom Tromey <tromey@redhat.com> 1.2.1-1
cvsdist 977444b
- Initial version