]> git.pld-linux.org Git - packages/python-sympy.git/blame - python-sympy.spec
- doc requires matplotlib
[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
b336f80a
JR
5%bcond_without python2 # CPython 2.x module
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
cd938da9 11Version: 1.4
afb29cf8 12Release: 1
b336f80a
JR
13License: BSD
14Group: Libraries/Python
cd938da9 15#Source0Download: https://github.com/sympy/sympy/releases
b336f80a 16Source0: https://github.com/sympy/sympy/releases/download/sympy-%{version}/sympy-%{version}.tar.gz
cd938da9
JB
17# Source0-md5: 478072d75b564c9356990e3027d464e6
18Patch0: %{name}-nodisplay.patch
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}
cd938da9
JB
34BuildRequires: python3-devel >= 1:3.4
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}
9f977fe2 43BuildRequires: pydoc3
13fba096
JB
44BuildRequires: python3-matplotlib
45BuildRequires: sphinx-pdg-3
8a467d57 46BuildRequires: texlive-format-pdflatex
b336f80a
JR
47BuildRequires: texlive-latex
48BuildRequires: texlive-latex-pgf
cd938da9 49%endif
b336f80a 50Requires: python-matplotlib
cd938da9 51Requires: python-modules >= 1:2.7
b336f80a
JR
52Requires: python-mpmath
53Requires: python-pyglet
54BuildArch: noarch
55BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
57%description
58SymPy aims to become a full-featured computer algebra system (CAS)
59while keeping the code as simple as possible in order to be
60comprehensible and easily extensible. SymPy is written entirely in
61Python and does not require any external libraries.
62
cd938da9
JB
63%description -l pl.UTF-8
64SymPy ma być w pełni funkcjonalnym systemem algebry komputerowej
65(CAS), a jednocześnie mieć jak najprostszy, czytelny i łatwo
66rozszerzalny kod. Jest pisany całkowicie w Pythonie i nie wymaga
67żadnych zewnętrznych bibliotek.
68
b336f80a 69%package -n python3-sympy
cd938da9
JB
70Summary: Python 3 library for symbolic mathematics
71Summary(pl.UTF-8): Biblioteka Pythona 3 do matematyki symbolicznej
b336f80a
JR
72Group: Libraries/Python
73Requires: python3-matplotlib
cd938da9 74Requires: python3-modules >= 1:3.4
b336f80a
JR
75Requires: python3-mpmath
76Requires: python3-pyglet
77
78%description -n python3-sympy
79SymPy aims to become a full-featured computer algebra system (CAS)
80while keeping the code as simple as possible in order to be
81comprehensible and easily extensible. SymPy is written entirely in
82Python and does not require any external libraries.
83
cd938da9
JB
84%description -n python3-sympy -l pl.UTF-8
85SymPy ma być w pełni funkcjonalnym systemem algebry komputerowej
86(CAS), a jednocześnie mieć jak najprostszy, czytelny i łatwo
87rozszerzalny kod. Jest pisany całkowicie w Pythonie i nie wymaga
88żadnych zewnętrznych bibliotek.
89
b336f80a 90%package doc
cd938da9
JB
91Summary: Documentation for SymPy module
92Summary(pl.UTF-8): Dokumentacja do SymPy
93Group: Documentation
b336f80a
JR
94
95%description doc
cd938da9
JB
96HTML documentation for SymPy.
97
98%description doc -l pl.UTF-8
99Dokumentacja do SymPy w formacie HTML.
b336f80a
JR
100
101%prep
102%setup -q -n sympy-%{version}
e7d4bee6 103%patch0 -p1
b336f80a
JR
104
105%build
106%if %{with python2}
2ac80b5d 107%py_build %{?with_tests:test}
b336f80a
JR
108%endif
109
110%if %{with python3}
2ac80b5d 111%py3_build %{?with_tests:test}
b336f80a
JR
112%endif
113
cd938da9 114%if %{with doc}
b336f80a 115cd doc
13fba096
JB
116%{__make} html \
117 SPHINXBUILD=sphinx-build-3
b336f80a 118%{__make} cheatsheet
cd938da9 119%endif
b336f80a
JR
120
121%install
122rm -rf $RPM_BUILD_ROOT
123
124%if %{with python3}
2ac80b5d 125%py3_install
b336f80a
JR
126
127%{__mv} $RPM_BUILD_ROOT%{_bindir}/isympy{,3}
128
129install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-sympy-%{version}
130cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-sympy-%{version}
131find $RPM_BUILD_ROOT%{_examplesdir}/python3-sympy-%{version} -name '*.py' \
132 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
133%endif
134
135%if %{with python2}
2ac80b5d 136%py_install
b336f80a
JR
137
138%py_postclean
139
140install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
141cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
cd938da9
JB
142find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name '*.py' \
143 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
b336f80a
JR
144%endif
145
146%clean
147rm -rf $RPM_BUILD_ROOT
148
cd938da9 149%if %{with python2}
b336f80a
JR
150%files
151%defattr(644,root,root,755)
cd938da9 152%doc AUTHORS LICENSE README.rst
b336f80a 153%attr(755,root,root) %{_bindir}/isympy
cd938da9 154%{py_sitescriptdir}/isympy.py[co]
b336f80a
JR
155%{py_sitescriptdir}/sympy
156%{py_sitescriptdir}/sympy-%{version}-*.egg-info
157%{_mandir}/man1/isympy.1*
158%{_examplesdir}/%{name}-%{version}
cd938da9 159%endif
b336f80a 160
cd938da9 161%if %{with python3}
b336f80a
JR
162%files -n python3-sympy
163%defattr(644,root,root,755)
cd938da9 164%doc AUTHORS LICENSE README.rst
b336f80a 165%attr(755,root,root) %{_bindir}/isympy3
cd938da9
JB
166%{py3_sitescriptdir}/isympy.py
167%{py3_sitescriptdir}/__pycache__/isympy.cpython-*.py[co]
b336f80a
JR
168%{py3_sitescriptdir}/sympy
169%{py3_sitescriptdir}/sympy-%{version}-*.egg-info
170%{_examplesdir}/python3-sympy-%{version}
cd938da9 171%endif
b336f80a 172
cd938da9 173%if %{with doc}
b336f80a
JR
174%files doc
175%defattr(644,root,root,755)
cd938da9
JB
176%doc doc/_build/html/* doc/_build/cheatsheet/cheatsheet.pdf
177%endif
This page took 0.1566 seconds and 4 git commands to generate.