File spyder.spec of Package spyder
#
# spec file for package spyder
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: spyder
%define modname %{name}lib
Version: 2.1.11
Release: 0
Url: http://spyderlib.googlecode.com
Summary: Scientific PYthon Development EnviRonment
License: MIT
Group: Development/Languages/Python
Source: http://%{modname}.googlecode.com/files/%{name}-%{version}.zip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: IPython
BuildRequires: fdupes
BuildRequires: python-Sphinx >= 0.6.0
BuildRequires: python-devel >= 2.5
BuildRequires: python-matplotlib
BuildRequires: python-numpy
BuildRequires: python-pep8
BuildRequires: python-psutil
BuildRequires: python-pyflakes >= 0.5.0
BuildRequires: python-pylint
BuildRequires: python-qt4 >= 4.4
BuildRequires: python-rope => 0.9.0
BuildRequires: python-scipy
BuildRequires: unzip
%if 0%{?suse_version} <= 1210
BuildRequires: update-desktop-files
%endif
Requires: python-%{modname} = %{version}
%if 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%else
BuildArch: noarch
%endif
%description
A Scientific Python development environment, an alternative to IDLE
with powerful interactive features such as variable explorer (with
GUI-based editors for dictionaries, lists, NumPy arrays, etc.), object
inspector, online help, and a lot more.
%package -n python-%{modname}
Summary: Python GUI components
Group: Development/Languages/Python
Requires: python-Sphinx >= 0.6.0
Requires: python-qt4 >= 4.4
Requires: python(abi) = %{py_ver}
Recommends: IPython
Recommends: python-matplotlib
Recommends: python-numpy
Recommends: python-pep8
Recommends: python-psutil
Recommends: python-pyflakes >= 0.5.0
Recommends: python-pylint
Recommends: python-rope >= 0.9.0
Recommends: python-scipy
%description -n python-%{modname}
The spyderlib module provides powerful console and
editor related widgets to your PyQt4 application.
%package doc
Summary: Documentation for %{name} and %{modname}
Group: Development/Languages/Python
Requires: %{name} = %{version}
Requires: python(abi) = %{py_ver}
%description doc
Documentation and help files for both %{name} and
%{modname}
%lang_package
%prep
%setup -q
# add icon line to the .desktop file
sed -i '9 i Icon=spyder' scripts/spyder.desktop
# fix encoding
sed -i 's/\r//' doc/{console,editor,explorer,findinfiles,historylog,index,inspector,internalconsole,lightmode,onlinehelp,options,overview,projectexplorer,pylint,variableexplorer}.rst
%build
export CFLAGS="%{optflags}"
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
# remove hidden file
rm %{buildroot}%{python_sitelib}/%{modname}/doc/.buildinfo
# fix permission
chmod +x %{buildroot}%{python_sitelib}/%{modname}/utils/external/pickleshare.py
# create missing directories
mkdir -p %{buildroot}%{_datadir}/applications/
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
# install the .desktop file
cp scripts/spyder.desktop %{buildroot}%{_datadir}/applications/
# install the icon
pushd %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
ln -s %{python_sitelib}/%{modname}/images/spyder.svg
popd
%find_lang %{modname}
%if 0%{?suse_version} <= 1210
%suse_update_desktop_file spyder
%endif
%fdupes %{buildroot}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_datadir}/applications/spyder.desktop
%{_datadir}/icons/hicolor/scalable/apps/spyder.svg
%files -n python-%{modname}
%defattr(-,root,root,-)
%{python_sitelib}/%{modname}/
%{python_sitelib}/spyderplugins/
%{python_sitelib}/%{name}-%{version}-py%{py_ver}.egg-info
%exclude %{python_sitelib}/%{modname}/doc
%exclude %{python_sitelib}/%{modname}/locale/
%exclude %{python_sitelib}/spyderplugins/locale/
%files doc
%defattr(-,root,root,-)
%doc README
%doc %{python_sitelib}/%{modname}/doc
%files lang -f %{modname}.lang
%defattr(-,root,root)
%{python_sitelib}/%{modname}/locale
%changelog