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