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