Blob Blame History Raw
Epoch: 1

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

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

Summary: 	%{pkg_summary}
Name: 		%{eclipse_name}-cdt
Version: 	%{majmin}.%{micro}
Release: 	1jpp_5fc
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

# This tarball was generated like this:
# 
# mkdir temp && cd temp
# mkdir home
# cvs -d:pserver:anonymous@dev.eclipse.org:/home/tools co -r CDT_3_1_0 \
#   org.eclipse.cdt-releng/org.eclipse.cdt.releng 
# cd org.eclipse.cdt-releng/org.eclipse.cdt.releng/
# sed --in-place 's/@cdtTag@/CDT_3_1_0/' maps/cdt.map
# java -cp /usr/share/eclipse/startup.jar -Duser.home=../../home \
#   org.eclipse.core.launcher.Main \
#   -application org.eclipse.ant.core.antRunner \
#   -buildfile build.xml -DbaseLocation=/usr/share/eclipse \
#   -Dpde.build.scripts=/usr/share/eclipse/plugins/org.eclipse.pde.build/scripts \
#   -DdontUnzip=true fetch
# cd .. && tar jcf eclipse-cdt-fetched-src-3.1.0.tar.bz2 org.eclipse.cdt.releng
Source0: %{name}-fetched-src-%{version}.tar.bz2
Source1: %{name}-autotools-0.0.2.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}-dynamic-scannerinfo-ext.patch

BuildRequires: eclipse-pde
%if %{gcj_support}
BuildRequires:  gcc-java >= 4.0.2
BuildRequires:  java-gcj-compat-devel >= 1.0.43
Requires(post):   java-gcj-compat >= 1.0.43
Requires(postun): java-gcj-compat >= 1.0.43
%else
BuildRequires:	java-devel >= 1.4.2
%endif

Requires: 	ctags gdb make
Requires: 	eclipse-platform >= 1:3.2.0

%if %{gcj_support}
ExclusiveArch: %{ix86} x86_64 ppc ia64
%else
ExclusiveArch: %{ix86} x86_64 ppc ia64
%endif
BuildRoot: 	%{_tmppath}/%{name}-buildroot

%package sdk
Summary: 	%{pkg_summary} SDK
Group: 		Text Editors/Integrated Development Environments (IDE)
Requires:       %{name} = %{version}-%{release}

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

%description sdk
This is the SDK version of the eclipse-cdt package.

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

# Autotools stuff

mkdir autotools
pushd autotools
tar -xzf %{SOURCE1}
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

homedir=$(cd home > /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 CDT 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} \
     org.eclipse.core.launcher.Main \
    -application org.eclipse.ant.core.antRunner \
    -DjavacFailOnError=true \
    -DdontUnzip=true \
    -DbaseLocation=$SDK \
    -Dpde.build.scripts=%{eclipse_base}/plugins/org.eclipse.pde.build/scripts \
    -DdontFetchAnything=true 

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

# Autotools has dependencies on CDT so we must add these to the SDK directory
for file in $(pwd)/org.eclipse.cdt.releng/results/I.*/*.tar.gz; do
  case $file in
    */org.eclipse.cdt-*-linux.$buildArch.*)
      # The ".." is needed since the zip files contain "eclipse/foo".
      (cd $SDK && tar --strip-components=1 -zxvf $file)
      ;;
  esac
done

# Autotools build
pushd autotools
java -cp %{eclipse_base}/startup.jar                   \
     -Duser.home=$homedir                              \
     org.eclipse.core.launcher.Main                    \
     -application org.eclipse.ant.core.antRunner       \
     -Dtype=feature                                    \
     -Did=com.redhat.eclipse.cdt.autotools.feature         \
     -DsourceDirectory=$(pwd)                          \
     -DbaseLocation=$SDK                               \
     -Dbuilder=%{eclipse_base}/plugins/org.eclipse.pde.build/templates/package-build  \
     -f %{eclipse_base}/plugins/org.eclipse.pde.build/scripts/build.xml

popd

%install
rm -rf ${RPM_BUILD_ROOT}

install -d -m755 ${RPM_BUILD_ROOT}/%{eclipse_base}

if ! [ -e $(pwd)/org.eclipse.cdt.releng/results/plugins/org.eclipse.cdt.core.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.*)
      # The ".." is needed since the zip files contain "eclipse/foo".
      (cd $RPM_BUILD_ROOT/%{eclipse_base}/.. && tar zxvf $file)
      ;;
    */org.eclipse.cdt.sdk-*-linux.$buildArch.*)
      # The ".." is needed since the zip files contain "eclipse/foo".
      (cd $RPM_BUILD_ROOT/%{eclipse_base}/.. && tar zxvf $file)
      ;;
  esac
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,')
  echo $newname
  mkdir -p ./$(dirname "$newname")
  mv $sofile ./$newname
  ln -s $newname $sofile
done
)

# These are in the SDK packages
#rm $RPM_BUILD_ROOT/%{eclipse_base}/epl-v10.html
#rm $RPM_BUILD_ROOT/%{eclipse_base}/notice.html

# Autotools install
pushd autotools
unzip -q -d $RPM_BUILD_ROOT%{eclipse_base}/.. build/rpmBuild/com.redhat.eclipse.cdt.autotools.feature.zip
popd

%if %{gcj_support}
aot-compile-rpm
%endif

%clean 
rm -rf ${RPM_BUILD_ROOT}

%if %{gcj_support}
%post
%{_bindir}/rebuild-gcj-db

%postun
%{_bindir}/rebuild-gcj-db
%endif

%files
%defattr(-,root,root)
%{eclipse_base}/features/org.eclipse.cdt_*
%{eclipse_base}/features/com.redhat.eclipse.cdt*
%{eclipse_base}/plugins/org.eclipse.cdt_*
%{eclipse_base}/plugins/org.eclipse.cdt.core*
%{eclipse_base}/plugins/org.eclipse.cdt.debug*
%{eclipse_base}/plugins/org.eclipse.cdt.doc*
%{eclipse_base}/plugins/org.eclipse.cdt.launch*
%{eclipse_base}/plugins/org.eclipse.cdt.make*
%{eclipse_base}/plugins/org.eclipse.cdt.managedbuilder*
%{eclipse_base}/plugins/org.eclipse.cdt.refactoring*
%{eclipse_base}/plugins/org.eclipse.cdt.ui*
%{eclipse_base}/plugins/com.redhat.eclipse.cdt*
%{_libdir}/eclipse/plugins/org.eclipse.cdt.core.linux*
%if %{gcj_support}
%{_libdir}/gcj/%{name}
%endif

%files sdk
%defattr(-,root,root)
%{eclipse_base}/features/org.eclipse.cdt*
%{eclipse_base}/features/com.redhat.eclipse.cdt*
%{eclipse_base}/plugins/org.eclipse.cdt*
%{eclipse_base}/plugins/com.redhat.eclipse.cdt*
%{eclipse_base}/epl-v10.html
%{eclipse_base}/notice.html
%{_libdir}/eclipse/plugins/org.eclipse.cdt.core.linux*
%if %{gcj_support}
%{_libdir}/gcj/%{name}
%endif

%changelog
* Thu Jul 20 2006 Jeff Johnston  <jjohnstn@redhat.com> 3.1.0-1jpp_5fc
- Split into main package and sdk sub-package.

* Thu Jul 20 2006 Jeff Johnston  <jjohnstn@redhat.com> 3.1.0-1jpp_4fc
- Add Autotools plug-ins via additional source tarball.

* Wed Jul 19 2006 Igor Foox  <ifoox@redhat.com> 3.1.0-1jpp_3fc
- Rebuild.

* Wed Jul 12 2006 Jeff Johnston  <jjohnstn@redhat.com> 3.1.0-1jpp_2fc
- Add dynamic scannerinfo extension used by Autotools plug-in.

* Mon Jul 10 2006 Andrew Overholt <overholt@redhat.com> 3.1.0-1jpp_1fc
- 3.1.0.

* Thu Jun 08 2006 Andrew Overholt <overholt@redhat.com> 3.1.0-0jpp_0fc.3.1.0RC2 
- 3.1.0 RC2.
- Remove unused hover patch.
- Use newly-created versionless pde.build symlink.
- Remove no-sdkbuild patch.

* Mon Apr 03 2006 Andrew Overholt <overholt@redhat.com> 3.0.2-1jpp_3fc
- Add ia64.

* Tue Mar 07 2006 Andrew Overholt <overholt@redhat.com> 3.0.2-1jpp_2fc
- Bump release.

* Mon Feb 13 2006 Andrew Overholt <overholt@redhat.com> 3.0.2-1jpp_1fc
- 3.0.2.

* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 1:3.0.1-1jpp_8fc
- bump again for double-long bug on ppc(64)

* Fri Feb 10 2006 Andrew Overholt <overholt@redhat.com> 3.0.1-1jpp_7fc
- Use Epoch in Requires (rh#180915).
- Require >= 3.1.2 but < 3.1.3 to ensure we get 3.1.2.

* Thu Feb 09 2006 Andrew Overholt <overholt@redhat.com> 3.0.1-1jpp_6fc
- Make it Require >= 3.1.2.

* Thu Feb 09 2006 Andrew Overholt <overholt@redhat.com> 3.0.1-1jpp_5fc
- Build against SDK 3.1.2.

* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1:3.0.1-1jpp_5fc
- rebuilt for new gcc4.1 snapshot and glibc changes

* Tue Jan 10 2006 Andrew Overholt <overholt@redhat.com> 3.0.1-1jpp_4fc
- Rebuild against latest gcc.

* Fri Dec 30 2005 Andrew Overholt <overholt@redhat.com> 3.0.1-1jpp_3fc
- Fix %%files section to not be x86-specific.

* Fri Dec 16 2005 Andrew Overholt <overholt@redhat.com> 3.0.1-1jpp_2fc
- Build against gcc 4.1.

* Mon Nov 14 2005 Andrew Overholt <overholt@redhat.com> 3.0.1-1jpp_1fc
- 3.0.1.

* Fri Oct 21 2005 Andrew Overholt <overholt@redhat.com> 3.0.0_fc-2
- Rebuild against gcc 4.0.2

* Tue Aug 23 2005 Andrew Overholt <overholt@redhat.com> 3.0.0_fc-1
- Import new upstream version (3.0).

* Thu Jul 14 2005 Andrew Overholt <overholt@redhat.com> 3.0.0_fc-0.RC2.1
- Import new upstream version (3.0RC2).
- Use gbenson's new aot-compile-rpm and change requirements appropriately.
- Re-enable native compilation - let's see what happens.

* Wed Jun 22 2005 Andrew Overholt <overholt@redhat.com> 3.0.0_fc-0.M7.1
- Import new upstream version (3.0M7).
- Remove refactoring/build.properties patch (now unneeeded).

* Fri Jun 03 2005 Jeff Pound <jpound@redhat.com> 3.0.0_fc-0.M6.8
- Patch refactoring/build.properties to include plugin.properties.
- Temporarily move all *.so's to *.so.bak due to native compilation bug.
- Temporarily remove gcj .jar -> .so db population.

* Mon May 23 2005 Andrew Overholt <overholt@redhat.com> 3.0.0_fc-0.M6.7
- Bring in new I-build to enable jump to Eclipse 3.1M7 and fix some critical
  issues.

* Wed May 11 2005 Ben Konrath <bkonrath@redhat.com> 3.0.0_fc-0.M6.6
- Temporarily disable org.eclipse.cdt.managedbuilder.core_3.0.0/libmngbuildcore.jar.so.

* Wed Apr 27 2005 Phil Muldoon <pmuldoon@redhat.com> 3.0.0_fc-0.M6.5
- Changed to find-and-aot-compile build usage
- Added "if gcj_support" toggle
- Fixed installing all arch fragments (now only installs one (correct) arch)
- Redid BuildRequires and Requires to remove old/unneeded dependencies
- Cleaned %eclipse_arch declares.

* 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