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