Blob Blame History Raw
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif

Name:		spyder
Version:	2.1.13
Release:	3%{?dist}
Summary:	Scientific Python Development Environment
Source0:	http://spyderlib.googlecode.com/files/%{name}-%{version}.zip
Source1:	%{name}.desktop
License:	MIT
Group:		Development/Tools
URL:		http://spyderlib.googlecode.com
BuildRequires:	python2-devel python-sphinx
BuildRequires:	desktop-file-utils
Requires:	PyQt4
Requires:	pyflakes >= 0.5.0
Requires:	python-rope python-sphinx
Requires:	hicolor-icon-theme
BuildArch:	noarch

# Fix checking PyQt4 version, couldn't find PyQt4 >= 4.10
Patch0: spyder-2.1.13-fix-PyQt-version-check.patch

%description
Spyder is a Python development environment with advanced editing, interactive
testing, debugging and introspection features. It is especially recommended 
for scientific computing thanks to NumPy (linear algebra), SciPy (signal and 
image processing), matplotlib (interactive 2D/3D plotting), MayaVi’s mlab 
(interactive 3D visualization) and -of course- IPython support.

Spyder may also be used as a library providing powerful console-related PyQt4
widgets.

%prep
%setup -q
%patch0 -p1 -b .fix-pyqt-version-check

rm -rf PKG-INFO

# Remove DOS line endings
for file in `find -name "*.rst" -o -name "*.py" -o -name "*.css"` README; do
	sed "s|\r||g" $file > $file.new && \
	touch -r $file $file.new && \
	mv $file.new $file
done

%build
python setup.py build

%install
python setup.py install -O1 --skip-build --root=%{buildroot}
rm -rf %{buildroot}%{python_sitelib}/spyderlib/doc/{.buildinfo,.doctrees}
rm -rf %{buildroot}%{_bindir}/spyder_win_post_install.py

mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
cp -p spyderlib/images/%{name}.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}

%clean
rm -rf %{buildroot}

%post
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%files
%defattr(-, root, root, -)
%doc README
%{python_sitelib}/spyder-*.egg-info
%{python_sitelib}/spyderlib
%{python_sitelib}/spyderplugins
%{_bindir}/spyder
%{_datadir}/applications/*
%{_datadir}/icons/hicolor/*/apps/*

%changelog
* Mon Mar 11 2013 Radek Novacek <rnovacek@redhat.com> 2.1.13-3
- Fix checking PyQt4 version
- Resolves: #919921

* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Thu Jan 10 2013 Radek Novacek <rnovacek@redhat.com> 2.1.13-1
- Update to 2.1.13

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Mon Feb 06 2012 Radek Novacek <rnovacek@redhat.com> 2.1.6-3
- Require pyflakes >= 0.5.0
- Resolves: #786836

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Jan 02 2012 Radek Novacek <rnovacek@redhat.com> 2.1.6-1
- Update to 2.1.6
- Fix crash with ipython 0.12dev
- Resolves: #770161

* Fri Nov 25 2011 Radek Novacek <rnovacek@redhat.com> 2.1.2-1
- Update to 2.1.2

* Mon Nov 07 2011 Radek Novacek <rnovacek@redhat.com> - 2.1.1-1
- Update to 2.1.1

* Thu Jul 14 2011 Radek Novacek <rnovacek@redhat.com> - 2.0.12-1
- Update to 2.0.12

* Sun May 22 2011 Chen Lei <supercyper@163.com> - 2.0.11-1
- Update to 2.0.11

* Sun Dec 19 2010 Chen Lei <supercyper@163.com> - 2.0.5-1
- Update to 2.0.5

* Wed Dec 08 2010 Chen Lei <supercyper@163.com> - 2.0.3-1
- Update to 2.0.3

* Wed Dec 01 2010 Chen Lei <supercyper@163.com> - 2.0.1-1
- Update to 2.0.1

* Tue Nov 30 2010 Chen Lei <supercyper@163.com> - 2.0.0-1
- Update to 2.0.0 final

* Wed Oct 13 2010 Chen Lei <supercyper@163.com> - 2.0.0-0.2.beta5
- Update to 2.0.0beta5

* Wed Sep 15 2010 Chen Lei <supercyper@163.com> - 2.0.0-0.1.beta3
- Initial rpm build