Epoch: 1
ExclusiveArch: i386 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 2
%define minor 0
%define majmin %{major}.%{minor}
%define micro 2
%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: 2
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-ui
Source0: %{name}-fetched-src-with-tests-2.0.2.tar.gz
Source1: %{name}-rhdocs-r20041107.tar.gz
Patch0: %{name}-build-tests-patch
#Patch2: %{name}-debug-build-patch
Patch3: %{name}-ui-libhover-patch
Patch4: %{name}-no-cvs2-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.30
BuildRequires: java-1.4.2-gcj-compat-devel >= 1.4.2.0-40jpp_4rh
Requires: ctags gdb make eclipse-ui
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"
%patch0 -p0
#popd
#%patch2 -p0
#pushd "org.eclipse.cdt.releng"
%patch3 -p0
%patch4 -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
# Overwrite eclipse.org documentation with our own
pushd org.eclipse.cdt.releng/results/plugins
/usr/bin/gzip -dc %{SOURCE1} | tar -xf -
popd
%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 \
-Dgnu.gcj.runtime.VMClassLoader.library_control=never \
-Dgnu.gcj.precompiled.db.path=%{eclipse_lib_base}/eclipse.db \
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 tests. Note that we don't install them later.
#java -cp $SDK/startup.jar \
# -Duser.home=$homedir \
# -Dosgi.install.area=%{eclipse_base} \
# -Dorg.eclipse.core.runtime.ignoreLockFile=true \
# -Dgnu.gcj.runtime.VMClassLoader.library_control=never \
# -Dgnu.gcj.precompiled.db.path=%{eclipse_lib_base}/eclipse.db \
# org.eclipse.core.launcher.Main \
# -application org.eclipse.ant.core.antRunner test \
# -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
for file in $(pwd)/org.eclipse.cdt.releng/results/I.*/*.zip; do
case $file in
*-linux.*)
# Silly Eclipse build bug. Calls the result zip but really a tar.gz
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=79711
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 -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
# Create a text mapping of the jar <-->so mapping for later use.
echo %{eclipse_base}/plugins/$jarname::%{eclipse_lib_base}/plugins/$jarname.so >> %{name}.jarswithnativelibs
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.*/*.zip; do
case $file in
*-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 in eclipse lib base
install -d -m755 $RPM_BUILD_ROOT/%{eclipse_lib_base}/mappings
# Create the initial changelog database
gcj-dbtool -n $RPM_BUILD_ROOT/%{eclipse_lib_base}/mappings/cdt.db 8000
# Create plugins directory in eclipse lib base
install -d -m755 $RPM_BUILD_ROOT/%{eclipse_lib_base}/plugins/
cd $nativehome/eclipse/plugins
# Install the text jar <--> so mapping we created when we compiled
install -m644 %{name}.jarswithnativelibs $RPM_BUILD_ROOT/%{eclipse_lib_base}
# 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
# Populate db with mappings
for j in `cat %{eclipse_lib_base}/%{name}.jarswithnativelibs`; do
gcj-dbtool -a %{eclipse_lib_base}/mappings/cdt.db `echo $j | sed "s/::/ /"`
done
# Merge all dbs together after install
if [ -n "`find %{eclipse_lib_base}/mappings -name \*.db`" ]; then
gcj-dbtool -m %{eclipse_lib_base}/eclipse.db `find %{eclipse_lib_base}/mappings -name \*.db`
fi
%postun
# After uninstall has removed our db, again merge the dbs
# to remove our entries
if [ -n "`find %{eclipse_lib_base}/mappings -name \*.db`" ]; then
gcj-dbtool -m %{eclipse_lib_base}/eclipse.db `find %{eclipse_lib_base}/mappings -name \*.db`
fi
%files
%defattr(-,root,root)
%{eclipse_lib_base}/%{name}.jarswithnativelibs
%{eclipse_lib_base}/mappings/cdt.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 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