Epoch: 1
%define gcj_support 1
%define version_major 1
%define version_minor 3
%define version_majmin %{version_major}.%{version_minor}
%define version_micro 1
%define eclipse_base %{_datadir}/eclipse
# All arches line up except i386 -> x86
%ifarch %{ix86}
%define eclipse_arch x86
%else
%define eclipse_arch %{_arch}
%endif
Summary: Eclipse Python development plug-in
Name: eclipse-pydev
Version: %{version_majmin}.%{version_micro}
Release: 5%{?dist}
License: Eclipse Public License
URL: http://pydev.sourceforge.net/
Group: Development/Tools
# The upstream PyDev project does not distribute a source drop conveniently.
# Instead, you must build it by hand. Generate the source zip using the
# enclosed script like so:
# ./fetch-eclipse-pydev.sh pydev \
# :pserver:anonymous@sourceware.org/cvs/eclipse pydev_1_3_1 \
# pydev/org.python.pydev.releng
Source0: eclipse-pydev-fetched-src-pydev_%{version_major}_%{version_minor}_%{version_micro}.tar.bz2
Source1: fetch-eclipse-pydev.sh
# Remove references to the retroweaver jar, since we don't use it
Patch1: %{name}-noretroweaver.patch
# Add a TestDependent class which makes the tests compile
Patch2: %{name}-TestDependent.java.patch
%if %{gcj_support}
BuildRequires: gcc-java >= 4.1.2
BuildRequires: java-1.5.0-gcj-devel >= 1.5.0
Requires(post): java-1.5.0-gcj >= 1.5.0
Requires(postun): java-1.5.0-gcj >= 1.5.0
%else
BuildRequires: java-devel >= 1.5.0
%endif
Requires: eclipse-jdt
Requires: python
Requires: commons-codec >= 1.3
Requires: junit >= 3.8.1
Requires: jython >= 2.2
BuildRequires: eclipse-pde
BuildRequires: jpackage-utils >= 0:1.5
BuildRequires: junit >= 3.8.1
BuildRequires: commons-codec >= 1.3
BuildRequires: jython >= 2.2
%if %{gcj_support}
%else
BuildArch: noarch
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
The eclipse-pydev package contains Eclipse plugins for
Python development.
%prep
%setup -q -c
pushd pydev/org.python.pydev.releng/results/
%patch1 -p0
%patch2 -p0
# Replace all references to 0.9.7.1 with the correct version number
for f in `grep -rl '0.9.7.1' *` ; do
if [ -f $f ]; then
sed --in-place "s/0.9.7.1/%{version_majmin}.%{version_micro}/g" $f
fi
done
# Remove the unused retroweaver jar
find . -name retroweaver-rt.jar -exec rm {} \;
# Remove #!'s from the .py files enclosed in org.python.pydev.jython
for f in `find plugins -name '*.py'` ; do
if [ -f $f ]; then
sed --in-place "s/^#!.*$//" $f
fi
done
# Link to system jars
rm -f plugins/org.python.pydev.core/commons-codec.jar
ln -sf %{_datadir}/java/jakarta-commons-codec.jar \
plugins/org.python.pydev.core/commons-codec.jar
rm -f plugins/org.python.pydev.core/lib/junit.jar
ln -sf %{_datadir}/java/junit.jar \
plugins/org.python.pydev.core/junit.jar
rm -f plugins/org.python.pydev.jython/jython.jar
ln -sf %{_datadir}/java/jython.jar \
plugins/org.python.pydev.jython/jython.jar
popd
%build
# Copy the SDK for build
/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)
# build the main pydev feature
eclipse \
-Duser.home=$homedir \
-application org.eclipse.ant.core.antRunner \
-Dtype=feature \
-Did=org.python.pydev.feature \
-DbaseLocation=$SDK \
-DsourceDirectory=$(pwd) \
-DjavacSource=1.5 -DjavacTarget=1.5 \
-DbuildDirectory=$(pwd)/build \
-Dbuilder=%{eclipse_base}/plugins/org.eclipse.pde.build/templates/package-build \
-f %{eclipse_base}/plugins/org.eclipse.pde.build/scripts/build.xml
%install
rm -rf $RPM_BUILD_ROOT
install -d -m755 ${RPM_BUILD_ROOT}/%{eclipse_base}
unzip -q -d $RPM_BUILD_ROOT%{eclipse_base}/.. \
build/rpmBuild/org.python.pydev.feature.zip
pushd $RPM_BUILD_ROOT%{_datadir}/eclipse/plugins
rm -rf \
org.python.pydev.core_%{version_majmin}.%{version_micro}/commons-codec.jar
ln -sf %{_datadir}/java/jakarta-commons-codec.jar \
org.python.pydev.core_%{version_majmin}.%{version_micro}/commons-codec.jar
mkdir org.python.pydev.core_%{version_majmin}.%{version_micro}/lib
ln -sf %{_datadir}/java/junit.jar \
org.python.pydev.core_%{version_majmin}.%{version_micro}/lib/junit.jar
rm -rf \
org.python.pydev.jython_%{version_majmin}.%{version_micro}/jython.jar
ln -sf %{_datadir}/java/jython.jar \
org.python.pydev.jython_%{version_majmin}.%{version_micro}/jython.jar
popd
%if %{gcj_support}
aot-compile-rpm
%endif
%clean
rm -rf ${RPM_BUILD_ROOT}
%if %{gcj_support}
%post -p /usr/bin/rebuild-gcj-db
%postun -p /usr/bin/rebuild-gcj-db
%endif
%files
%defattr(-,root,root,-)
%{eclipse_base}/features/org.python.pydev*
%{eclipse_base}/plugins/org.python.pydev_*
%{eclipse_base}/plugins/org.python.pydev.ast*
%{eclipse_base}/plugins/org.python.pydev.core*
%{eclipse_base}/plugins/org.python.pydev.debug*
%{eclipse_base}/plugins/org.python.pydev.help*
%{eclipse_base}/plugins/org.python.pydev.parser*
%{eclipse_base}/plugins/org.python.pydev.templates*
%{eclipse_base}/plugins/org.python.pydev.jython*
%{eclipse_base}/plugins/org.python.pydev.refactoring*
%if %{gcj_support}
%{_libdir}/gcj/%{name}
%endif
%changelog
* Fri Apr 27 2007 Igor Foox <ifoox@redhat.com> 1:1.3.1-5
- Add runtime dependancy on the JDT.
- Reorganize Requires and BuildRequires.
* Mon Apr 02 2007 Andrew Overholt <overholt@redhat.com> 1:1.3.1-4
- Remove some whitespace, fix lines > 80 characters.
- Remove unnecessary rm of junit.jar.
- pushd to a deeper directory to fix long lines.
- Add missing popd.
- Typo in buildroot.
* Mon Apr 02 2007 Igor Foox <ifoox@redhat.com> 1:1.3.1-3
- Remove ExclusiveArch.
* Sun Apr 01 2007 Igor Foox <ifoox@redhat.com> 1:1.3.1-2
- Add Jython as a BuildRequires and Requires.
- Fix buildroot.
- Add dist tag.
- Remove pkg_summary and eclipse_name macros.
- Remove eclipse-jdt and eclipse-pde from BR as they are required by PDE.
- Fix permissions on defattr.
- Fix long lines.
- Renumber and comment patches.
- Update and simplify source drop generation comment.
* Tue Mar 27 2007 Igor Foox <ifoox@redhat.com> 1:1.3.1-1
- Update to PyDev 1.3.1.
* Mon Mar 26 2007 Igor Foox <ifoox@redhat.com> 1:1.3.0-2
- Add dependency on jython.
* Sun Mar 25 2007 Igor Foox <ifoox@redhat.com> 1:1.3.0-1
- Update to version 1.3.0.
- Update fetch script to include refactoring package.
- Fixeup changelog epochs.
- Remove #! lines from .py files.
* Sat Mar 24 2007 Igor Foox <ifoox@redhat.com> 1:1.2.5-2
- Update to version 1.2.5.
- Include Jython functionality again.
- Fix spacing issues.
- Remove backport to Java 1.4.
- Change build method to package-build.
- Include script to create the tarball.
* Wed Jun 28 2006 Igor Foox <ifoox@redhat.com> 1:1.1.0-1
- Updated to version 1.1.0 (still backported)
- Excluded Jython functionality
- Removed _fc from version
- Indented
* Thu Feb 09 2006 Igor Foox <ifoox@redhat.com> 1:1.0.6_fc-1
- Building backported version.
* Thu Feb 09 2006 Andrew Overholt <overholt@redhat.com> 1:0.9.3_fc-14
- Build against 3.1.2.
* Fri Dec 16 2005 Andrew Overholt <overholt@redhat.com> 1:0.9.3_fc-13
- Build against gcc 4.1.
* Thu Oct 27 2005 Andrew Overholt <overholt@redhat.com> 1:0.9.3_fc-12
- Re-build.
* Tue Aug 02 2005 Jeff Pound <jpound@redhat.com> 1:0.9.3_fc-11
- Add patch to make python 2.4 default (bz#164847).
* Fri Jul 15 2005 Andrew Overholt <overholt@redhat.com> 1:0.9.3_fc-10
- Use gbenson's new aot-compile-rpm.
* Fri Jul 08 2005 Jeff Pound <jpound@redhat.com> 1:0.9.3_fc-9
- Fix eclipse build specification to be arch independant.
- Fix build.properties javacDebugInfo flag (Robin Green bz#161534)
- Add -g compile option (Robin Green bz#161534)
* Tue Jul 05 2005 Jeff Pound <jpound@redhat.com> 1:0.9.3_fc-8
- Apply Robin Greens patch to explicitly specify archive format (bz#162517)
- Fix spec file description.
* Tue Apr 26 2005 Andrew Overholt <overholt@redhat.com> 1:0.9.3_fc-7
- Re-organize and make use of scripts.
- Remove old tarball from sources.
* Tue Apr 26 2005 Jeff Pound <jpound@redhat.com> 1:0.9.3_fc-6
- Swap zip logic for tarball logic.
- Upgrade to 0.9.3.
- Remove 3.1 compat patch (included in 0.9.3).
* Fri Mar 4 2005 Phil Muldoon <pmuldoon@redhat.com> 1:0.9.0-4_fc
- Added x86_64 to ExclusiveArch
* Thu Mar 3 2005 Jeffrey Pound <jpound@redhat.com> 1:0.9.0-3_fc
- Rewrite for native build.
- Change gcc4 to gcc.
- Add python as requirement.
- Remove -g option for gcj.
* Tue Feb 08 2005 Jeff Pound <jpound@redhat.com> 1:0.9.0-1_fc
- Initial version