6f8291f
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
6f8291f
6f8291f
Name:		python-mpmath
c4c7791
Version:	0.17
1feb842
Release:	5%{?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/
c4c7791
Source0:	http://mpmath.googlecode.com/files/mpmath-all-%{version}.tar.gz
c4c7791
# Patch to fix build, already reported and fixed upstream
c4c7791
Patch0:		python-mpmath-0.17-build.patch
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
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
c4c7791
%setup -q -n mpmath-all-%{version}
c4c7791
%patch0 -p1 -b .buildfix
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}
c4c7791
# Get rid of python 3 version that fails to byte-compile
1feb842
rm %{buildroot}%{python_sitelib}/mpmath/libmp/exec_py3.py*
6f8291f
6f8291f
%check
1feb842
export PYTHONPATH=`pwd`/build/lib
6f8291f
cd build/lib/mpmath/tests/
1feb842
python runtests.py
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
1feb842
* Mon Jul 23 2012 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.17-5
1feb842
- Fix %%check phase.
1feb842
5fbcc56
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17-4
5fbcc56
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
5fbcc56
86eafe7
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17-3
86eafe7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
86eafe7
2fd70f7
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17-2
2fd70f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
2fd70f7
c4c7791
* Sun Feb 06 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.17-1
c4c7791
- Update to 0.17.
c4c7791
0d6bf07
* Sun Sep 26 2010 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.16-1
0d6bf07
- Update to 0.16.
0d6bf07
2a122cd
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.15-2
2a122cd
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
2a122cd
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.