Blob Blame History Raw
%define gcj_support     1

%define eclipse_name    eclipse
%define eclipse_base    %{_datadir}/%{eclipse_name}
%define core_plugin_jar %{eclipse_base}/plugins/org.tigris.subversion.subclipse.core_%{version}.jar
%define core_plugin_dir %{eclipse_base}/plugins/org.tigris.subversion.subclipse.core_%{version}

%define disable_javahl  0
%if 0%{?fedora} == 6
%define disable_javahl  1
%endif
%if 0%{?rhel} == 5
%define disable_javahl  1
%endif

%define javahl_dir      %{_libdir}/svn-javahl
%if 0%{?fedora} >= 8
%define javahl_dir      %{_javadir}
%endif

Name:           eclipse-subclipse
Version:        1.2.4
Release:        8%{?dist}
Summary:        Subversion Eclipse plugin

Group:          Text Editors/Integrated Development Environments (IDE)
License:        EPL
URL:            http://subclipse.tigris.org/
Source0:        subclipse-%{version}.tgz
# Script to fetch the source code
# the new source tarball does not includes the book feature and the layout is
# different than the source repository
Source10:       subclipse-fetch-1.2.4.sh
# Disable javahl support temporaly until apparent classloader problem is fixed
Patch0:         eclipse-subclipse-1.2.2-default-svnkit.patch
Patch1:         eclipse-subclipse-1.2.2-plugin-classpath.patch

BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:          ant
BuildRequires:          jpackage-utils >= 0:1.6
BuildRequires:          coreutils
BuildRequires:          eclipse-pde
%if %{gcj_support}
BuildRequires:          gcc-java >= 4.0.2
BuildRequires:          java-gcj-compat-devel >= 1.0.33
Requires(post):         java-gcj-compat >= 1.0.33
Requires(postun):       java-gcj-compat >= 1.0.33
%else
BuildRequires:          java-devel >= 1.4.2
%endif

%if %{gcj_support}
%else
BuildArch:              noarch
%endif

Requires:               eclipse-platform

BuildRequires:          subversion-javahl >= 1.3.1
Requires:               subversion-javahl >= 1.3.1
BuildRequires:          svnkit >= 1.1.2
Requires:               svnkit >= 1.1.2
BuildRequires:          ganymed-ssh2 >= 209
Requires:               ganymed-ssh2 >= 209

%package book
Summary:        Subversion book
Group:          Development/Tools
Requires:       %{name} = %{version}-%{release}


%description
Subclipse is an Eclipse plugin that adds Subversion integration to the Eclipse
IDE.

%description book
The Subversion book as an Eclipse documentation plugin.


%prep
%setup -q -n subclipse-%{version}
%if 0%{disable_javahl}
%patch -p1
%endif
%patch1 -p1

# delete the jars that are in the archive
rm svnClientAdapter/lib/svnjavahl.jar
ln -sf %{javahl_dir}/svn-javahl.jar svnClientAdapter/lib/svnjavahl.jar
rm -f svnClientAdapter/lib/svnkit.jar
ln -sf %{_javadir}/svnkit.jar svnClientAdapter/lib/svnkit.jar
rm -f svnClientAdapter/lib/ganymed.jar
ln -sf %{_javadir}/ganymed-ssh2.jar svnClientAdapter/lib/ganymed.jar

rm -f subclipse/core/lib/svnjavahl.jar
ln -sf %{javahl_dir}/svn-javahl.jar subclipse/core/lib/svnjavahl.jar
rm -f subclipse/core/lib/svnClientAdapter.jar
# svnClientAdapter.jar is copied after being built
rm -f subclipse/core/lib/svnkit.jar
ln -sf %{_javadir}/svnkit.jar subclipse/core/lib/svnkit.jar
rm -f subclipse/core/lib/ganymed.jar
ln -sf %{_javadir}/ganymed-ssh2.jar subclipse/core/lib/ganymed.jar


%build
# ---------------------------------
# building svnClientAdapter
pushd svnClientAdapter
ant svnClientAdapter.jar
popd

# copying svnClientAdapter inside subclipse module
cp svnClientAdapter/build/lib/svnClientAdapter.jar subclipse/core/lib/svnClientAdapter.jar

# ---------------------------------
# building subclipse
pushd subclipse
# See comments in the script to understand this.
# RHEL eclipse has a different instalation root
%if 0%{?rhel} == 5
/bin/sh -x %{_libdir}/%{eclipse_name}/buildscripts/copy-platform SDK %{eclipse_base}
%else
/bin/sh -x %{eclipse_base}/buildscripts/copy-platform SDK %{eclipse_base}
%endif
SDK=$(cd SDK > /dev/null && pwd)

# Eclipse may try to write to the home directory.
mkdir home
homedir=$(cd home > /dev/null && pwd)

# build the main subclipse feature
eclipse \
     -application org.eclipse.ant.core.antRunner       \
     -Duser.home=$homedir                              \
     -Dtype=feature                                    \
     -Did=org.tigris.subversion.subclipse              \
     -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
#java -cp %{eclipse_base}/startup.jar                   \
#     -Duser.home=$homedir                              \
#     org.eclipse.core.launcher.Main                    \
#     -application org.eclipse.ant.core.antRunner       \
#     -Dtype=feature                                    \
#     -Did=org.tigris.subversion.subclipse              \
#     -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

# build the subclipse book feature
eclipse \
     -application org.eclipse.ant.core.antRunner       \
     -Duser.home=$homedir                              \
     -Dtype=feature                                    \
     -Did=org.tigris.subversion.book                   \
     -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
#java -cp %{eclipse_base}/startup.jar                   \
#     -Duser.home=$homedir                              \
#     org.eclipse.core.launcher.Main                    \
#     -application org.eclipse.ant.core.antRunner       \
#     -Dtype=feature                                    \
#     -Did=org.tigris.subversion.book                   \
#     -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

# returning to base build directory
popd

# Link source files to fix -debuginfo generation.
rm -rf subclipse/org
mkdir -p subclipse/org/tigris/subversion
ln -s $(pwd)/svnClientAdapter/src/main/org/tigris/subversion/svnclientadapter subclipse/org/tigris/subversion
mkdir -p subclipse/org/tigris/subversion/subclipse
ln -s $(pwd)/subclipse/core/src/org/tigris/subversion/subclipse/core subclipse/org/tigris/subversion/subclipse
ln -s $(pwd)/subclipse/ui/src/org/tigris/subversion/subclipse/ui subclipse/org/tigris/subversion/subclipse


%install
rm -rf $RPM_BUILD_ROOT
install -d -m 755 $RPM_BUILD_ROOT%{eclipse_base}

pushd subclipse
unzip -q -d $RPM_BUILD_ROOT%{eclipse_base}/.. build/rpmBuild/org.tigris.subversion.subclipse.zip
unzip -q -d $RPM_BUILD_ROOT%{eclipse_base}/.. build/rpmBuild/org.tigris.subversion.book.zip

# repacking core plugin as a directory based plugin, needed in order to replace some jars with symlinks
mkdir $RPM_BUILD_ROOT%{core_plugin_dir}
unzip -q -d $RPM_BUILD_ROOT%{core_plugin_dir} $RPM_BUILD_ROOT%{core_plugin_jar}
rm $RPM_BUILD_ROOT%{core_plugin_jar}
# packaging .class files as a jar file
jar -cf $RPM_BUILD_ROOT%{core_plugin_dir}/lib/subclipse-core.jar -C $RPM_BUILD_ROOT%{core_plugin_dir} org
rm -rf $RPM_BUILD_ROOT%{core_plugin_dir}/org

# removing core plugin internal jars
rm -f $RPM_BUILD_ROOT%{core_plugin_dir}/lib/svnjavahl.jar
rm -f $RPM_BUILD_ROOT%{core_plugin_dir}/lib/svnkit.jar
rm -f $RPM_BUILD_ROOT%{core_plugin_dir}/lib/ganymed.jar

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

# We need to setup the symlink because the ant copy task doesn't preserve symlinks
# TODO file a bug about this
ln -s %{javahl_dir}/svn-javahl.jar $RPM_BUILD_ROOT%{core_plugin_dir}/lib/svnjavahl.jar
ln -s %{_javadir}/svnkit.jar $RPM_BUILD_ROOT%{core_plugin_dir}/lib/svnkit.jar
ln -s %{_javadir}/ganymed-ssh2.jar $RPM_BUILD_ROOT%{core_plugin_dir}/lib/ganymed.jar


%clean
rm -rf $RPM_BUILD_ROOT

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

%files
%defattr(-,root,root)
%{eclipse_base}/features/org.tigris.subversion.subclipse_*
%{eclipse_base}/plugins/org.tigris.subversion.subclipse.core_*
%{eclipse_base}/plugins/org.tigris.subversion.subclipse.ui_*
%{eclipse_base}/plugins/org.tigris.subversion.subclipse.doc_*
%doc svnClientAdapter/readme.txt svnClientAdapter/changelog.txt svnClientAdapter/license.txt 

%if %{gcj_support}
%{_libdir}/gcj/%{name}
%endif

%files book
%defattr(-,root,root)
%{eclipse_base}/features/org.tigris.subversion.book_*
%{eclipse_base}/plugins/org.tigris.subversion.book_*

%changelog
* Fri Apr 04 2008 Robert Marcano <robert@marcanoonline.com> 1.2.4-8
- Fix Bug 440818: changed links to svn-javahl.jar

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.2.4-7
- Autorebuild for GCC 4.3

* Mon Nov 12 2007 Robert Marcano <robert@marcanoonline.com> 1.2.4-6
- Build for all supported arquitectures

* Fri Oct 19 2007 Robert Marcano <robert@marcanoonline.com> 1.2.4-3
- Disable ppc64 build for f8, see Bug #298071

* Wed Sep 19 2007 Robert Marcano <robert@marcanoonline.com> 1.2.4-2
- Fix wrong applied classpath patch, fixing error: An error occurred while
automatically activating bundle org.tigris.subversion.subclipse.core

* Mon Sep 10 2007 Robert Marcano <robert@marcanoonline.com> 1.2.4-1
- Update to upstream 1.2.4
- Build for all supported arquitectures

* Sun Sep 09 2007 Robert Marcano <robert@marcanoonline.com> 1.2.2-6
- Change MANIFEST.MF patch to be applied on prep stage

* Wed Aug 29 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 1.2.2-4
- Rebuild for selinux ppc32 issue.

* Wed Jun 20 2007 Robert Marcano <robert@marcanoonline.com> 1.2.2-2
- Update to upstream 1.2.2
- Dependency changed from javasvn to svnkit
- Patch to support EPEL5 sent by Rob Myers

* Thu Dec 21 2006 Robert Marcano <robert@marcanoonline.com> 1.1.9-2
- Update to upstream 1.1.9
- Removed patch that added source attribute to the javac ant task
- Using the "eclipse" launcher

* Wed Nov 08 2006 Robert Marcano <robert@marcanoonline.com> 1.1.8-2
- Update to upstream 1.1.8

* Mon Aug 28 2006 Robert Marcano <robert@marcanoonline.com> 1.1.5-2
- Rebuild

* Mon Aug 21 2006 Robert Marcano <robert@marcanoonline.com> 1.1.5-1
- Update to upstream 1.1.5
- svnClientAdapter documentation files added. Subclipse includes an eclipse
  based documentation for the plugins

* Sat Aug 06 2006 Robert Marcano <robert@marcanoonline.com> 1.1.4-1
- Update to upstream 1.1.4
- License changed to EPL
- svnClientAdapter-1.1.4-javac-target.patch added fix to svnClientAdapter ant
  script

* Tue Jul 04 2006 Andrew Overholt <overholt@redhat.com> 1.0.3-2
- Use versionless pde.build.
- Remove strict SDK version requirement due to above.

* Sun Jul 02 2006 Robert Marcano <robert@marcanoonline.com> 1.0.3-2
- Embeeding the script that fetch the source code

* Sun Jun 25 2006 Robert Marcano <robert@marcanoonline.com> 1.0.3-1
- Update to 1.0.3
- Dependency name changed to ganymed-ssh2

* Sun Jun 11 2006 Robert Marcano <robert@marcanoonline.com> 1.0.1-6
- rpmlint fixes and debuginfo generation workaround

* Thu Jun 01 2006 Robert Marcano <robert@marcanoonline.com> 1.0.1-5
- Use package-build from eclipse SDK
 
* Sun May 28 2006 Robert Marcano <robert@marcanoonline.com> 1.0.1-4
- Integrated svnClientAdapter inside this package

* Tue May 23 2006 Ben Konrath <bkonrath@redhat.com> 1.0.1-3
- Rename package to eclipse-subclipse.
- Use copy-platform script for now.

* Sun May 07 2006 Robert Marcano <robert@marcanoonline.com> 1.0.1-2
- use external libraries from dependent packages

* Wed Apr 26 2006 Ben Konrath <bkonrath@redhat.com> 1.0.1-1
- initial version based on the work of Robert Marcano