6f8291f
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
6f8291f
6f8291f
Name:		python-mpmath
fc29877
Version:	0.15
629a7eb
Release:	1%{?dist}
6f8291f
Summary:	A pure Python library for multiprecision floating-point arithmetic
6f8291f
Group:		Applications/Engineering
6f8291f
License:	BSD
6f8291f
URL:		http://code.google.com/p/mpmath/
6f8291f
Source0:	http://mpmath.googlecode.com/files/mpmath-%{version}.tar.gz
6f8291f
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
6f8291f
BuildArch:	noarch
6f8291f
6f8291f
BuildRequires:	python-devel
6f8291f
# For building documentation
6f8291f
BuildRequires:	dvipng
6f8291f
BuildRequires:	python-sphinx
6f8291f
BuildRequires:	tex(latex)
6f8291f
# For running test
6f8291f
BuildRequires:	python-py
6f8291f
6f8291f
6f8291f
%description
6f8291f
Mpmath is a pure-Python library for multiprecision floating-point arithmetic.
6f8291f
It provides an extensive set of transcendental functions, unlimited exponent
6f8291f
sizes, complex numbers, interval arithmetic, numerical integration and
6f8291f
differentiation, root-finding, linear algebra, and much more. Almost any
6f8291f
calculation can be performed just as well at 10-digit or 1000-digit precision,
6f8291f
and in many cases mpmath implements asymptotically fast algorithms that scale
6f8291f
well for extremely high precision work. If available, mpmath will (optionally)
6f8291f
use gmpy to speed up high precision operations.
6f8291f
6f8291f
If you require plotting capabilities in mpmath, install python-matplotlib.
6f8291f
6f8291f
%package doc
6f8291f
Summary:	HTML documentation for %{name}
6f8291f
Group:		Documentation
6f8291f
Requires:	%{name} = %{version}-%{release}
6f8291f
6f8291f
%description doc
6f8291f
This package contains the HTML documentation for %{name}.
6f8291f
6f8291f
6f8291f
%prep
6f8291f
%setup -q -n mpmath-%{version}
6f8291f
# Convert line encodings 
6f8291f
for doc in LICENSE CHANGES PKG-INFO README mpmath/tests/runtests.py; do
6f8291f
 sed "s|\r||g" $doc > $doc.new && \
6f8291f
 touch -r $doc $doc.new && \
6f8291f
 mv $doc.new $doc
6f8291f
done
6f8291f
find doc -name *.txt -exec sed -i "s|\r||g" {} \;
6f8291f
6f8291f
# Get rid of unnecessary shebangs
6f8291f
for lib in mpmath/elliptic.py mpmath/tests/runtests.py; do
6f8291f
 sed '/#!\/usr\/bin\/env/d' $lib > $lib.new && \
6f8291f
 touch -r $lib $lib.new && \
6f8291f
 mv $lib.new $lib
6f8291f
done
6f8291f
6f8291f
%build
6f8291f
python setup.py build
6f8291f
# Build documentation
6f8291f
cd doc
6f8291f
python build.py 
6f8291f
6f8291f
%install
6f8291f
rm -rf %{buildroot}
6f8291f
python setup.py install -O1 --skip-build --root %{buildroot}
6f8291f
6f8291f
%check
6f8291f
cd build/lib/mpmath/tests/
6f8291f
py.test
6f8291f
6f8291f
%clean
6f8291f
rm -rf %{buildroot}
6f8291f
6f8291f
%files
6f8291f
%defattr(-,root,root,-)
6f8291f
%doc CHANGES LICENSE PKG-INFO README
6f8291f
%{python_sitelib}/mpmath/
6f8291f
%{python_sitelib}/mpmath-%{version}-*.egg-info
6f8291f
6f8291f
%files doc
6f8291f
%defattr(-,root,root,-)
6f8291f
%doc doc/build/*
6f8291f
6f8291f
%changelog
fc29877
* Mon Jun 07 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.15-1
fc29877
- Update to 0.15.
fc29877
629a7eb
* Tue Apr 27 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.14-1
629a7eb
- Update to 0.14.
629a7eb
6f8291f
* Tue Oct 06 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.13-5
6f8291f
- Removed BR: python-matplotlib, since it didn't actually help in the missing
6f8291f
  image problem.
6f8291f
- Added versioned require in -doc.
6f8291f
6f8291f
* Tue Oct 06 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.13-4
6f8291f
- Replaced R: python-matplotlib with a comment in %%description.
6f8291f
- Added missing BR: python-matplotlib.
6f8291f
6f8291f
* Tue Oct 06 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.13-3
6f8291f
- Added missing BR: dvipng.
6f8291f
- Added %%check phase.
6f8291f
6f8291f
* Wed Sep 23 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.13-2
6f8291f
- Add missing BR: tex(latex).
6f8291f
6f8291f
* Wed Sep 23 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.13-1
6f8291f
- First release.