]>
Commit | Line | Data |
---|---|---|
b336f80a JR |
1 | # |
2 | # Conditional build: | |
cd938da9 JB |
3 | %bcond_without doc # HTML and PDF documentation |
4 | %bcond_without tests # unit tests | |
b336f80a JR |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
cd938da9 JB |
8 | Summary: Python 2 library for symbolic mathematics |
9 | Summary(pl.UTF-8): Biblioteka Pythona 2 do matematyki symbolicznej | |
b336f80a | 10 | Name: python-sympy |
cd938da9 | 11 | Version: 1.4 |
e8e48178 | 12 | Release: 3 |
b336f80a JR |
13 | License: BSD |
14 | Group: Libraries/Python | |
cd938da9 | 15 | #Source0Download: https://github.com/sympy/sympy/releases |
b336f80a | 16 | Source0: https://github.com/sympy/sympy/releases/download/sympy-%{version}/sympy-%{version}.tar.gz |
cd938da9 JB |
17 | # Source0-md5: 478072d75b564c9356990e3027d464e6 |
18 | Patch0: %{name}-nodisplay.patch | |
1457cdc5 JR |
19 | Patch1: 0001-Exception-changed-after-numpy-1.17.patch |
20 | Patch2: 0001-Fix-more-compatibility-issues-with-Python3.8.patch | |
21 | Patch3: 0001-Modify-literal-comparisons-as-per-python3.8-guidelines.patch | |
22 | Patch4: sympy-is.patch | |
cd938da9 | 23 | URL: https://www.sympy.org/ |
b336f80a JR |
24 | BuildRequires: gettext |
25 | BuildRequires: graphviz | |
cd938da9 JB |
26 | BuildRequires: rpmbuild(macros) >= 1.714 |
27 | BuildRequires: sed >= 4.0 | |
b336f80a | 28 | %if %{with python2} |
cd938da9 JB |
29 | BuildRequires: python-devel >= 1:2.7 |
30 | BuildRequires: python-setuptools | |
31 | %if %{with tests} | |
32 | BuildRequires: python-devel-tools | |
33 | BuildRequires: python-mpmath >= 0.19 | |
b336f80a JR |
34 | BuildRequires: python-numpy |
35 | %endif | |
cd938da9 | 36 | %endif |
b336f80a | 37 | %if %{with python3} |
cd938da9 JB |
38 | BuildRequires: python3-devel >= 1:3.4 |
39 | BuildRequires: python3-setuptools | |
40 | %if %{with tests} | |
b336f80a | 41 | BuildRequires: python3-devel-tools |
cd938da9 | 42 | BuildRequires: python3-mpmath >= 0.19 |
b336f80a JR |
43 | BuildRequires: python3-numpy |
44 | %endif | |
cd938da9 JB |
45 | %endif |
46 | %if %{with doc} | |
9f977fe2 | 47 | BuildRequires: pydoc3 |
13fba096 | 48 | BuildRequires: python3-matplotlib |
558a01dc | 49 | BuildRequires: python3-mpmath >= 0.19 |
13fba096 | 50 | BuildRequires: sphinx-pdg-3 |
8a467d57 | 51 | BuildRequires: texlive-format-pdflatex |
b336f80a | 52 | BuildRequires: texlive-latex |
225dae17 | 53 | BuildRequires: texlive-latex-ams |
b336f80a | 54 | BuildRequires: texlive-latex-pgf |
cd938da9 | 55 | %endif |
b336f80a | 56 | Requires: python-matplotlib |
cd938da9 | 57 | Requires: python-modules >= 1:2.7 |
b336f80a JR |
58 | Requires: python-mpmath |
59 | Requires: python-pyglet | |
60 | BuildArch: noarch | |
61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
62 | ||
63 | %description | |
64 | SymPy aims to become a full-featured computer algebra system (CAS) | |
65 | while keeping the code as simple as possible in order to be | |
66 | comprehensible and easily extensible. SymPy is written entirely in | |
67 | Python and does not require any external libraries. | |
68 | ||
cd938da9 JB |
69 | %description -l pl.UTF-8 |
70 | SymPy ma być w pełni funkcjonalnym systemem algebry komputerowej | |
71 | (CAS), a jednocześnie mieć jak najprostszy, czytelny i łatwo | |
72 | rozszerzalny kod. Jest pisany całkowicie w Pythonie i nie wymaga | |
73 | żadnych zewnętrznych bibliotek. | |
74 | ||
b336f80a | 75 | %package -n python3-sympy |
cd938da9 JB |
76 | Summary: Python 3 library for symbolic mathematics |
77 | Summary(pl.UTF-8): Biblioteka Pythona 3 do matematyki symbolicznej | |
b336f80a JR |
78 | Group: Libraries/Python |
79 | Requires: python3-matplotlib | |
cd938da9 | 80 | Requires: python3-modules >= 1:3.4 |
b336f80a JR |
81 | Requires: python3-mpmath |
82 | Requires: python3-pyglet | |
83 | ||
84 | %description -n python3-sympy | |
85 | SymPy aims to become a full-featured computer algebra system (CAS) | |
86 | while keeping the code as simple as possible in order to be | |
87 | comprehensible and easily extensible. SymPy is written entirely in | |
88 | Python and does not require any external libraries. | |
89 | ||
cd938da9 JB |
90 | %description -n python3-sympy -l pl.UTF-8 |
91 | SymPy ma być w pełni funkcjonalnym systemem algebry komputerowej | |
92 | (CAS), a jednocześnie mieć jak najprostszy, czytelny i łatwo | |
93 | rozszerzalny kod. Jest pisany całkowicie w Pythonie i nie wymaga | |
94 | żadnych zewnętrznych bibliotek. | |
95 | ||
b336f80a | 96 | %package doc |
cd938da9 JB |
97 | Summary: Documentation for SymPy module |
98 | Summary(pl.UTF-8): Dokumentacja do SymPy | |
99 | Group: Documentation | |
b336f80a JR |
100 | |
101 | %description doc | |
cd938da9 JB |
102 | HTML documentation for SymPy. |
103 | ||
104 | %description doc -l pl.UTF-8 | |
105 | Dokumentacja do SymPy w formacie HTML. | |
b336f80a JR |
106 | |
107 | %prep | |
108 | %setup -q -n sympy-%{version} | |
e7d4bee6 | 109 | %patch0 -p1 |
1457cdc5 JR |
110 | %patch1 -p1 |
111 | %patch2 -p1 | |
112 | %patch3 -p1 | |
113 | %patch4 -p1 | |
b336f80a JR |
114 | |
115 | %build | |
116 | %if %{with python2} | |
2ac80b5d | 117 | %py_build %{?with_tests:test} |
b336f80a JR |
118 | %endif |
119 | ||
120 | %if %{with python3} | |
2ac80b5d | 121 | %py3_build %{?with_tests:test} |
b336f80a JR |
122 | %endif |
123 | ||
cd938da9 | 124 | %if %{with doc} |
558a01dc | 125 | pydir=$(pwd)/build-3/lib |
b336f80a | 126 | cd doc |
558a01dc | 127 | PYTHONPATH=$pydir \ |
13fba096 JB |
128 | %{__make} html \ |
129 | SPHINXBUILD=sphinx-build-3 | |
b336f80a | 130 | %{__make} cheatsheet |
cd938da9 | 131 | %endif |
b336f80a JR |
132 | |
133 | %install | |
134 | rm -rf $RPM_BUILD_ROOT | |
135 | ||
136 | %if %{with python3} | |
2ac80b5d | 137 | %py3_install |
b336f80a JR |
138 | |
139 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/isympy{,3} | |
140 | ||
141 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-sympy-%{version} | |
142 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-sympy-%{version} | |
143 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-sympy-%{version} -name '*.py' \ | |
144 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' | |
145 | %endif | |
146 | ||
147 | %if %{with python2} | |
2ac80b5d | 148 | %py_install |
b336f80a JR |
149 | |
150 | %py_postclean | |
151 | ||
152 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
153 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
cd938da9 JB |
154 | find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name '*.py' \ |
155 | | xargs sed -i '1s|^#!.*python\b|#!%{__python}|' | |
b336f80a JR |
156 | %endif |
157 | ||
158 | %clean | |
159 | rm -rf $RPM_BUILD_ROOT | |
160 | ||
cd938da9 | 161 | %if %{with python2} |
b336f80a JR |
162 | %files |
163 | %defattr(644,root,root,755) | |
cd938da9 | 164 | %doc AUTHORS LICENSE README.rst |
b336f80a | 165 | %attr(755,root,root) %{_bindir}/isympy |
cd938da9 | 166 | %{py_sitescriptdir}/isympy.py[co] |
b336f80a JR |
167 | %{py_sitescriptdir}/sympy |
168 | %{py_sitescriptdir}/sympy-%{version}-*.egg-info | |
169 | %{_mandir}/man1/isympy.1* | |
170 | %{_examplesdir}/%{name}-%{version} | |
cd938da9 | 171 | %endif |
b336f80a | 172 | |
cd938da9 | 173 | %if %{with python3} |
b336f80a JR |
174 | %files -n python3-sympy |
175 | %defattr(644,root,root,755) | |
cd938da9 | 176 | %doc AUTHORS LICENSE README.rst |
b336f80a | 177 | %attr(755,root,root) %{_bindir}/isympy3 |
cd938da9 JB |
178 | %{py3_sitescriptdir}/isympy.py |
179 | %{py3_sitescriptdir}/__pycache__/isympy.cpython-*.py[co] | |
b336f80a JR |
180 | %{py3_sitescriptdir}/sympy |
181 | %{py3_sitescriptdir}/sympy-%{version}-*.egg-info | |
182 | %{_examplesdir}/python3-sympy-%{version} | |
cd938da9 | 183 | %endif |
b336f80a | 184 | |
cd938da9 | 185 | %if %{with doc} |
b336f80a JR |
186 | %files doc |
187 | %defattr(644,root,root,755) | |
cd938da9 JB |
188 | %doc doc/_build/html/* doc/_build/cheatsheet/cheatsheet.pdf |
189 | %endif |