LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File python3-mpmath.spec of Package python3-mpmath (Project home:Ledest:bashisms)

#
# spec file for package python3-mpmath
#
# Copyright (c) 2016 SUSE LINUX 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:           python3-mpmath
Version:        0.19
Release:        0
Summary:        Python library for arbitrary-precision floating-point arithmetic
License:        BSD-3-Clause
Group:          Development/Libraries/Python
Url:            http://mpmath.org
# THE *-all TARBALL CONTAINS SOURCE CODE + DOCUMENTATION
Source0:        http://mpmath.org/files/mpmath-all-%{version}.tar.gz
BuildRequires:  python3-devel
BuildRequires:  python3-gmpy  >= 1.03
BuildRequires:  python3-nose
BuildRequires:  python3-six
Requires:       python3-gmpy  >= 1.03
Requires:       python3-six
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
Mpmath is a pure-Python library for multiprecision floating-point 
arithmetic. It provides an extensive set of transcendental functions, 
unlimited exponent sizes, complex numbers, interval arithmetic,
numerical integration and differentiation, root-finding, linear 
algebra, and much more. Almost any calculation can be performed just 
as well at 10-digit or 1000-digit precision, and in many cases mpmath
implements asymptotically fast algorithms that scale well for
extremely high precision work. If available, mpmath will (optionally) 
use gmpy to speed up high precision operations.

%prep
%setup -q -n mpmath-all-%{version}
sed -i 's/\r//' mpmath/tests/runtests.py  # fix wrong-script-end-of-line-encoding rpmlint warning
sed -i '1d' mpmath/tests/runtests.py  # fix non-executable-script rpmlint warning

%build
# CLEAN UP SHEBANGS FROM NON-EXEC FILES
for f in eigen eigen_symmetric
do
  sed -i '/\#!\/usr\/bin\/python/ d' mpmath/tests/test_${f}.py
  sed -i '/\#!\/usr\/bin\/python/ d' mpmath/matrices/${f}.py
done
sed -i '/\#!\/usr\/bin\/python/ d' mpmath/tests/test_levin.py
python3 setup.py build

%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}

%check
pushd demo
PYTHONPATH="%{buildroot}%{python3_sitelib}" python3 -B -c "import mpmath;mpmath.runtests()"
popd

%files
%defattr(-,root,root)
%doc CHANGES LICENSE README.rst
%{python3_sitelib}/*

%changelog