]> git.pld-linux.org Git - packages/python-mpmath.git/blame - python-mpmath.spec
- python 3.4
[packages/python-mpmath.git] / python-mpmath.spec
CommitLineData
07be5a78
JR
1#
2# Conditional build:
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
5
6Summary: A pure Python library for multiprecision floating-point arithmetic
7Name: python-mpmath
8Version: 0.18
15e239f0 9Release: 2
07be5a78
JR
10License: BSD
11Group: Libraries/Python
12URL: http://code.google.com/p/mpmath/
13Source0: http://mpmath.googlecode.com/files/mpmath-%{version}.tar.gz
14# Source0-md5: e2e7a7932969f52f25b7e19d8f0438bd
15Source1: http://mpmath.googlecode.com/files/mpmath-docsrc-%{version}.tar.gz
16# Source1-md5: 65286d76dff4f02f41b31f1c3d1810dd
17%if %{with python2}
18BuildRequires: python-devel
19BuildRequires: python-Sphinx
20%endif
21%if %{with python3}
22BuildRequires: python3-devel
23BuildRequires: python-Sphinx
24%endif
25BuildRequires: texlive-latex
26BuildArch: noarch
27BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29%description
30Mpmath is a pure-Python library for multiprecision floating-point
31arithmetic. It provides an extensive set of transcendental functions,
32unlimited exponent sizes, complex numbers, interval arithmetic,
33numerical integration and differentiation, root-finding, linear
34algebra, and much more. Almost any calculation can be performed just
35as well at 10-digit or 1000-digit precision, and in many cases mpmath
36implements asymptotically fast algorithms that scale well for
37extremely high precision work. If available, mpmath will (optionally)
38use gmpy to speed up high precision operations.
39
40If you require plotting capabilities in mpmath, install
41python-matplotlib.
42
43%package -n python3-mpmath
44Summary: A pure Python library for multiprecision floating-point arithmetic
45Group: Libraries/Python
46
47%description -n python3-mpmath
48Mpmath is a pure-Python library for multiprecision floating-point
49arithmetic. It provides an extensive set of transcendental functions,
50unlimited exponent sizes, complex numbers, interval arithmetic,
51numerical integration and differentiation, root-finding, linear
52algebra, and much more. Almost any calculation can be performed just
53as well at 10-digit or 1000-digit precision, and in many cases mpmath
54implements asymptotically fast algorithms that scale well for
55extremely high precision work. If available, mpmath will (optionally)
56use gmpy to speed up high precision operations.
57
58If you require plotting capabilities in mpmath, install
59python3-matplotlib.
60
61%package doc
62Summary: HTML documentation for %{name}
63Group: Documentation
64Requires: %{name} = %{version}-%{release}
65
66%description doc
67This package contains the HTML documentation for %{name}.
68
69%prep
70%setup -q -n mpmath-%{version} -a 1
71# Convert line encodings
72for doc in LICENSE CHANGES PKG-INFO README.rst mpmath/tests/runtests.py; do
73 %{__sed} "s|\r||g" $doc > $doc.new && \
74 touch -r $doc $doc.new && \
75 %{__mv} $doc.new $doc
76done
77find doc -name *.txt -exec sed -i "s|\r||g" {} \;
78
79shebangs="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"
80# Get rid of unnecessary shebangs
81for lib in $shebangs; do
82 %{__sed} '/^#!.*/d; 1q' $lib > $lib.new && \
83 touch -r $lib $lib.new && \
84 %{__mv} $lib.new $lib
85done
86
87%build
88%if %{with python2}
89python setup.py build
90%{__python} setup.py build --build-base build-2
91%endif
92
93%if %{with python3}
94%{__python3} setup.py build --build-base build-3
95%endif
96
97cd doc
98python build.py
99
100%install
101rm -rf $RPM_BUILD_ROOT
102
103%if %{with python2}
104%{__python} setup.py \
105 build --build-base build-2 \
106 install --skip-build \
107 --optimize=2 \
108 --root=$RPM_BUILD_ROOT
109
110%py_postclean
111%endif
112
113%if %{with python3}
114%{__python3} setup.py \
115 build --build-base build-3 \
116 install --skip-build \
117 --optimize=2 \
118 --root=$RPM_BUILD_ROOT
119%endif
120
121%clean
122rm -rf $RPM_BUILD_ROOT
123
124%if %{with python2}
125%files
126%defattr(644,root,root,755)
127%doc CHANGES LICENSE PKG-INFO README.rst
128%{py_sitescriptdir}/mpmath/
129%{py_sitescriptdir}/mpmath-%{version}-*.egg-info
130%endif
131
132%if %{with python3}
133%files -n python3-mpmath
134%defattr(644,root,root,755)
135%doc CHANGES LICENSE PKG-INFO README.rst
136%{py3_sitescriptdir}/mpmath/
137%{py3_sitescriptdir}/mpmath-%{version}-*.egg-info
138%endif
139
140%files doc
141%defattr(644,root,root,755)
142%doc doc/build/*
This page took 0.116659 seconds and 4 git commands to generate.