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