Package init
This commit is contained in:
parent
e6b9194bf7
commit
30e5e5de2d
12
python-mpmath-1.0.0-sphinx.patch
Normal file
12
python-mpmath-1.0.0-sphinx.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -up mpmath-1.0.0/doc/source/conf.py.sphinx mpmath-1.0.0/doc/source/conf.py
|
||||
--- mpmath-1.0.0/doc/source/conf.py.sphinx 2017-09-27 16:59:02.000000000 +0200
|
||||
+++ mpmath-1.0.0/doc/source/conf.py 2018-05-05 12:03:22.313112845 +0200
|
||||
@@ -76,7 +76,7 @@ pygments_style = 'sphinx'
|
||||
# -----------------------
|
||||
|
||||
# The "theme" that the HTML output should use.
|
||||
-html_theme = 'classic'
|
||||
+html_theme = 'traditional'
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
BIN
python-mpmath-1.2.0.tar.gz
Normal file
BIN
python-mpmath-1.2.0.tar.gz
Normal file
Binary file not shown.
104
python-mpmath.spec
Normal file
104
python-mpmath.spec
Normal file
@ -0,0 +1,104 @@
|
||||
Name: python-mpmath
|
||||
Version: 1.2.0
|
||||
Release: 1
|
||||
Summary: A pure Python library for multiprecision floating-point arithmetic
|
||||
License: BSD
|
||||
URL: https://mpmath.org
|
||||
# Source code
|
||||
Source0: https://github.com/fredrik-johansson/mpmath/archive/%{version}/%{name}-%{version}.tar.gz
|
||||
|
||||
# Switch to 'traditional' theme in RHEL since 'classic' isn't available
|
||||
Patch0: python-mpmath-1.0.0-sphinx.patch
|
||||
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-pip
|
||||
BuildRequires: python3-setuptools
|
||||
BuildRequires: python3-setuptools_scm
|
||||
BuildRequires: python3-pytest
|
||||
BuildRequires: python3-sphinx
|
||||
BuildRequires: xorg-x11-server-Xvfb
|
||||
|
||||
# For building documentation
|
||||
BuildRequires: dvipng
|
||||
BuildRequires: tex(latex)
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
%global _description %{expand:
|
||||
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.}
|
||||
|
||||
%description %_description
|
||||
|
||||
%package -n python3-mpmath
|
||||
Summary: A pure Python library for multiprecision floating-point arithmetic
|
||||
Recommends: python3-matplotlib
|
||||
%{?python_provide:%python_provide python3-mpmath}
|
||||
|
||||
%description -n python3-mpmath %_description
|
||||
|
||||
If you require plotting capabilities in mpmath, install python3-matplotlib.
|
||||
|
||||
|
||||
%package doc
|
||||
Summary: HTML documentation for %{name}
|
||||
Requires: python3-mpmath = %{version}-%{release}
|
||||
|
||||
%description doc
|
||||
This package contains the HTML documentation for %{name}.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -n mpmath-%{version}
|
||||
|
||||
# Convert line encodings
|
||||
for doc in CHANGES LICENSE README.rst TODO mpmath/tests/runtests.py; do
|
||||
sed "s|\r||g" $doc > $doc.new && \
|
||||
touch -r $doc $doc.new && \
|
||||
mv $doc.new $doc
|
||||
done
|
||||
find doc -name *.txt -exec sed -i "s|\r||g" {} \;
|
||||
|
||||
shebangs="mpmath/matrices/eigen.py mpmath/matrices/eigen_symmetric.py mpmath/tests/runtests.py mpmath/tests/test_eigen.py mpmath/tests/test_eigen_symmetric.py mpmath/tests/test_levin.py"
|
||||
# Get rid of unnecessary shebangs
|
||||
for lib in $shebangs; do
|
||||
sed '/^#!.*/d; 1q' $lib > $lib.new && \
|
||||
touch -r $lib $lib.new && \
|
||||
mv $lib.new $lib
|
||||
done
|
||||
|
||||
sed -i -r 's/use_scm_version=True/version="%{version}"/' setup.py
|
||||
|
||||
%build
|
||||
%py3_build
|
||||
|
||||
# Build documentation
|
||||
cd doc
|
||||
%{__python3} build.py
|
||||
|
||||
%install
|
||||
%py3_install
|
||||
|
||||
%check
|
||||
cd build/lib/mpmath/tests/
|
||||
xvfb-run -a pytest-3 -v
|
||||
|
||||
%files -n python3-mpmath
|
||||
%license LICENSE
|
||||
%doc CHANGES README.rst TODO
|
||||
%{python3_sitelib}/mpmath/
|
||||
%{python3_sitelib}/mpmath-%{version}-*.egg-info
|
||||
|
||||
%files doc
|
||||
%doc doc/build/*
|
||||
|
||||
%changelog
|
||||
* Wed Jul 08 2021 liuliang <liuliang1@kylinos.cn> - 1.2.0-1
|
||||
- Package init
|
||||
Loading…
x
Reference in New Issue
Block a user