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