3 %bcond_without doc # HTML and PDF documentation
4 %bcond_without tests # unit tests
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 Summary: Python 2 library for symbolic mathematics
9 Summary(pl.UTF-8): Biblioteka Pythona 2 do matematyki symbolicznej
14 Group: Libraries/Python
15 #Source0Download: https://pypi.org/simple/sympy/
16 Source0: https://files.pythonhosted.org/packages/source/s/sympy/sympy-%{version}.tar.gz
17 # Source0-md5: b11b310c3e1642bf66e51038cb3c0021
18 Patch0: %{name}-nodisplay.patch
19 URL: https://www.sympy.org/
20 BuildRequires: gettext
21 BuildRequires: graphviz
22 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: sed >= 4.0
25 BuildRequires: python-devel >= 1:2.7
26 BuildRequires: python-setuptools
28 BuildRequires: python-devel-tools
29 BuildRequires: python-mpmath >= 0.19
30 BuildRequires: python-numpy
34 BuildRequires: python3-devel >= 1:3.5
35 BuildRequires: python3-setuptools
37 BuildRequires: python3-devel-tools
38 BuildRequires: python3-mpmath >= 0.19
39 BuildRequires: python3-numpy
44 BuildRequires: python3-matplotlib
45 BuildRequires: python3-mpmath >= 0.19
46 BuildRequires: python3-sphinx_math_dollar
47 BuildRequires: sphinx-pdg-3
48 BuildRequires: texlive-format-pdflatex
49 BuildRequires: texlive-latex
50 BuildRequires: texlive-latex-ams
51 BuildRequires: texlive-latex-pgf
53 Requires: python-matplotlib
54 Requires: python-modules >= 1:2.7
55 Requires: python-pyglet
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60 SymPy aims to become a full-featured computer algebra system (CAS)
61 while keeping the code as simple as possible in order to be
62 comprehensible and easily extensible. SymPy is written entirely in
63 Python and does not require any external libraries.
65 %description -l pl.UTF-8
66 SymPy ma być w pełni funkcjonalnym systemem algebry komputerowej
67 (CAS), a jednocześnie mieć jak najprostszy, czytelny i łatwo
68 rozszerzalny kod. Jest pisany całkowicie w Pythonie i nie wymaga
69 żadnych zewnętrznych bibliotek.
71 %package -n python3-sympy
72 Summary: Python 3 library for symbolic mathematics
73 Summary(pl.UTF-8): Biblioteka Pythona 3 do matematyki symbolicznej
74 Group: Libraries/Python
75 Requires: python3-matplotlib
76 Requires: python3-modules >= 1:3.5
77 Requires: python3-pyglet
79 %description -n python3-sympy
80 SymPy aims to become a full-featured computer algebra system (CAS)
81 while keeping the code as simple as possible in order to be
82 comprehensible and easily extensible. SymPy is written entirely in
83 Python and does not require any external libraries.
85 %description -n python3-sympy -l pl.UTF-8
86 SymPy ma być w pełni funkcjonalnym systemem algebry komputerowej
87 (CAS), a jednocześnie mieć jak najprostszy, czytelny i łatwo
88 rozszerzalny kod. Jest pisany całkowicie w Pythonie i nie wymaga
89 żadnych zewnętrznych bibliotek.
92 Summary: Documentation for SymPy module
93 Summary(pl.UTF-8): Dokumentacja do SymPy
97 HTML documentation for SymPy.
99 %description doc -l pl.UTF-8
100 Dokumentacja do SymPy w formacie HTML.
103 %setup -q -n sympy-%{version}
108 %py_build %{?with_tests:test}
112 %py3_build %{?with_tests:test}
116 pydir=$(pwd)/build-3/lib
120 SPHINXBUILD=sphinx-build-3
125 rm -rf $RPM_BUILD_ROOT
130 %{__mv} $RPM_BUILD_ROOT%{_bindir}/isympy{,3}
132 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-sympy-%{version}
133 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-sympy-%{version}
134 find $RPM_BUILD_ROOT%{_examplesdir}/python3-sympy-%{version} -name '*.py' \
135 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
143 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
144 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
145 find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name '*.py' \
146 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
150 rm -rf $RPM_BUILD_ROOT
154 %defattr(644,root,root,755)
155 %doc AUTHORS LICENSE README.rst
156 %attr(755,root,root) %{_bindir}/isympy
157 %{py_sitescriptdir}/isympy.py[co]
158 %{py_sitescriptdir}/sympy
159 %{py_sitescriptdir}/sympy-%{version}-*.egg-info
160 %{_mandir}/man1/isympy.1*
161 %{_examplesdir}/%{name}-%{version}
165 %files -n python3-sympy
166 %defattr(644,root,root,755)
167 %doc AUTHORS LICENSE README.rst
168 %attr(755,root,root) %{_bindir}/isympy3
169 %{py3_sitescriptdir}/isympy.py
170 %{py3_sitescriptdir}/__pycache__/isympy.cpython-*.py[co]
171 %{py3_sitescriptdir}/sympy
172 %{py3_sitescriptdir}/sympy-%{version}-*.egg-info
173 %{_examplesdir}/python3-sympy-%{version}
178 %defattr(644,root,root,755)
179 %doc doc/_build/html/{_images,_static,modules,pics,special_topics,tutorial,*.html,*.js} doc/_build/cheatsheet/cheatsheet.pdf