]>
Commit | Line | Data |
---|---|---|
d6259285 | 1 | # NOTE: for versions >= 3 (for python 3.6+) see python3-matplotlib.spec |
e1486a8d | 2 | # TODO: system jquery and jquery-ui (when they become up to date) |
e82deedd | 3 | # |
44b7835f | 4 | # Conditional build: |
e82deedd | 5 | %bcond_without python2 # CPython 2.x module |
d6259285 | 6 | %bcond_with python3 # CPython 3.x module |
e82deedd JB |
7 | %bcond_with tests # unit tests [many failures as of 1.5.3] |
8 | ||
0daef324 | 9 | # TODO: |
17a0057e | 10 | # - use system fonts (mpl-data/fonts/ttf/{STIX,cm}*.ttf) and metrics (mpl-data/fonts/{afm,pdfcorefonts}/*.afm) in mpl-data dir? |
44b7835f JK |
11 | # - make sure all dependencies that are available for Python3 are build for Python3 |
12 | # and included in BR when neccessary | |
0daef324 | 13 | %define module matplotlib |
db475c22 | 14 | Summary: Matlab(TM) style Python plotting package |
4ec85bdd | 15 | Summary(pl.UTF-8): Pakiet do rysowania w Pythonie podobny do Matlaba(TM) |
0daef324 | 16 | Name: python-%{module} |
d6259285 | 17 | # keep 2.x here for python2 support |
17a0057e | 18 | Version: 2.2.5 |
41fae1cc | 19 | Release: 3 |
e82deedd | 20 | License: PSF |
0daef324 | 21 | Group: Libraries/Python |
e82deedd | 22 | #Source0Download: https://github.com/matplotlib/matplotlib/releases |
17a0057e JB |
23 | Source0: https://github.com/matplotlib/matplotlib/archive/v%{version}/matplotlib-%{version}.tar.gz |
24 | # Source0-md5: 8c49e6086ec06f3b5e9a1b7ad1ac37ff | |
e1486a8d JB |
25 | Source1: https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip |
26 | # Source1-md5: e0cfea21c9d1acd37fb58592f2c1f50d | |
17a0057e | 27 | Patch0: %{name}-system-qhull.patch |
e82deedd | 28 | URL: https://matplotlib.org/ |
17a0057e JB |
29 | #BuildRequires: agg-devel |
30 | BuildRequires: freetype-devel >= 1:2.6.1 | |
e82deedd JB |
31 | BuildRequires: ghostscript |
32 | BuildRequires: gtk+3 >= 3.0 | |
33 | BuildRequires: libpng-devel >= 1.2 | |
6466a51f | 34 | BuildRequires: libstdc++-devel |
db475c22 | 35 | BuildRequires: ncurses-devel |
e82deedd JB |
36 | BuildRequires: pkgconfig |
37 | # /usr/bin/pdftops | |
38 | BuildRequires: poppler-progs | |
17a0057e | 39 | BuildRequires: qhull-devel >= 2015.2 |
e82deedd JB |
40 | BuildRequires: rpm-pythonprov |
41 | BuildRequires: rpmbuild(macros) >= 1.714 | |
42 | # /usr/bin/dvipng | |
43 | BuildRequires: texlive | |
44 | BuildRequires: tk-devel | |
44b7835f | 45 | %if %{with python2} |
e82deedd | 46 | BuildRequires: gtk+2-devel >= 1:2.0 |
17a0057e | 47 | BuildRequires: python >= 1:2.7 |
fed8a40c | 48 | BuildRequires: python-PyQt4 |
e82deedd | 49 | BuildRequires: python-PyQt5 |
17a0057e JB |
50 | BuildRequires: python-backports.functools_lru_cache |
51 | BuildRequires: python-cycler >= 0.10 | |
52 | BuildRequires: python-dateutil >= 2.1 | |
53 | BuildRequires: python-devel >= 1:2.7 | |
54 | BuildRequires: python-numpy-devel >= 1:1.7.1 | |
e82deedd JB |
55 | # or cairocffi |
56 | BuildRequires: python-pycairo | |
57 | BuildRequires: python-pygobject3-devel >= 3.0 | |
58 | BuildRequires: python-pygtk-devel >= 1:2.2.0 | |
17a0057e | 59 | BuildRequires: python-pyparsing >= 2.1.7 |
6466a51f | 60 | BuildRequires: python-pytz |
e82deedd JB |
61 | BuildRequires: python-setuptools |
62 | # for import pyqtconfig needed by qt detection. | |
ac8f4383 | 63 | BuildRequires: python-sip-devel |
17a0057e JB |
64 | BuildRequires: python-six >= 1.10 |
65 | BuildRequires: python-subprocess32 | |
ac8f4383 | 66 | BuildRequires: python-tkinter |
e82deedd | 67 | BuildRequires: python-tornado |
17a0057e | 68 | BuildRequires: python-wxPython >= 2.9 |
e82deedd | 69 | %if %{with tests} |
17a0057e | 70 | BuildRequires: python-kiwisolver >= 1.0.1 |
e82deedd | 71 | BuildRequires: python-mock |
17a0057e | 72 | BuildRequires: python-pytest >= 3.6 |
e82deedd | 73 | %endif |
44b7835f JK |
74 | %endif |
75 | %if %{with python3} | |
17a0057e | 76 | BuildRequires: python3 >= 1:3.4 |
44b7835f | 77 | BuildRequires: python3-2to3 |
5a05aa50 | 78 | BuildRequires: python3-PyQt4 |
e82deedd | 79 | BuildRequires: python3-PyQt5 |
17a0057e | 80 | BuildRequires: python3-cycler >= 0.10 |
e82deedd | 81 | BuildRequires: python3-dateutil >= 2.2 |
17a0057e JB |
82 | BuildRequires: python3-devel >= 1:3.4 |
83 | BuildRequires: python3-numpy-devel >= 1:1.7.1 | |
e82deedd JB |
84 | # or cairocffi |
85 | BuildRequires: python3-pycairo | |
86 | BuildRequires: python3-pygobject3-devel >= 3.0 | |
17a0057e | 87 | BuildRequires: python3-pyparsing >= 2.1.7 |
44b7835f | 88 | BuildRequires: python3-pytz |
17a0057e | 89 | BuildRequires: python3-six >= 1.10 |
e82deedd JB |
90 | BuildRequires: python3-setuptools |
91 | # for import pyqtconfig needed by qt detection. | |
92 | BuildRequires: python3-sip-devel | |
44b7835f | 93 | BuildRequires: python3-tkinter |
e82deedd | 94 | BuildRequires: python3-tornado |
17a0057e | 95 | #BuildRequires: python3-wxPython >= 2.9 |
e82deedd | 96 | %if %{with tests} |
17a0057e JB |
97 | BuildRequires: python3-kiwisolver >= 1.0.1 |
98 | BuildRequires: python3-pytest >= 3.6 | |
44b7835f | 99 | %endif |
e82deedd | 100 | %endif |
17a0057e JB |
101 | Requires: freetype >= 1:2.6.1 |
102 | Requires: python-modules >= 1:2.7 | |
0daef324 AM |
103 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
104 | ||
105 | %description | |
106 | matplotlib strives to produce publication quality 2D graphics using | |
107 | matlab plotting for inspiration. Although the main lib is object | |
108 | oriented, there is a functional interface "pylab" for people coming | |
109 | from Matlab. | |
110 | ||
617bcdd8 JR |
111 | %description -l pl.UTF-8 |
112 | matplotlib usiłuje tworzyć grafikę 2D o jakości publikacji przy użyciu | |
113 | wykresów matlaba jako inspiracji. Chociaż główna biblioteka jest | |
db475c22 | 114 | zorientowana obiektowo, jest interfejs funkcyjny "pylab" dla ludzi |
617bcdd8 | 115 | przechodzących z Matlaba. |
db475c22 | 116 | |
44b7835f JK |
117 | %package -n python3-%{module} |
118 | Summary: Matlab(TM) style Python 3 plotting package | |
119 | Summary(pl.UTF-8): Pakiet do rysowania w Pythonie 3 podobny do Matlaba(TM) | |
120 | Group: Libraries/Python | |
17a0057e JB |
121 | Requires: freetype >= 1:2.6.1 |
122 | Requires: python3-modules >= 1:3.4 | |
44b7835f JK |
123 | |
124 | %description -n python3-%{module} | |
125 | matplotlib strives to produce publication quality 2D graphics using | |
126 | matlab plotting for inspiration. Although the main lib is object | |
127 | oriented, there is a functional interface "pylab" for people coming | |
128 | from Matlab. | |
129 | ||
130 | %description -n python3-%{module} -l pl.UTF-8 | |
131 | matplotlib usiłuje tworzyć grafikę 2D o jakości publikacji przy użyciu | |
132 | wykresów matlaba jako inspiracji. Chociaż główna biblioteka jest | |
133 | zorientowana obiektowo, jest interfejs funkcyjny "pylab" dla ludzi | |
134 | przechodzących z Matlaba. | |
135 | ||
0daef324 AM |
136 | %prep |
137 | %setup -q -n %{module}-%{version} | |
17b19f40 | 138 | %patch0 -p1 |
07c41b0d | 139 | |
e1486a8d JB |
140 | unzip -q %{SOURCE1} -d lib/matplotlib/backends/web_backend |
141 | ||
0daef324 | 142 | %build |
ac8f4383 | 143 | export CFLAGS="%{rpmcflags}" |
44b7835f JK |
144 | |
145 | %if %{with python2} | |
3a472966 | 146 | %py_build |
e82deedd JB |
147 | |
148 | %if %{with tests} | |
149 | PYTHONPATH=$(readlink -f build-2/lib.*) \ | |
150 | %{__python} tests.py --no-network | |
151 | %endif | |
44b7835f JK |
152 | %endif |
153 | ||
154 | %if %{with python3} | |
3a472966 | 155 | %py3_build |
e82deedd JB |
156 | |
157 | %if %{with tests} | |
158 | PYTHONPATH=$(readlink -f build-2/lib.*) \ | |
159 | %{__python3} tests.py --no-network | |
160 | %endif | |
44b7835f | 161 | %endif |
0daef324 AM |
162 | |
163 | %install | |
164 | rm -rf $RPM_BUILD_ROOT | |
165 | ||
44b7835f | 166 | %if %{with python2} |
3a472966 | 167 | %py_install |
0daef324 | 168 | |
ac8f4383 | 169 | %py_postclean |
0daef324 | 170 | |
3b1e1355 | 171 | # matplotlib can use system fonts, so drop these copies |
17a0057e | 172 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/matplotlib/mpl-data/fonts/ttf/DejaVu*.ttf |
44b7835f JK |
173 | %endif |
174 | ||
175 | %if %{with python3} | |
3a472966 | 176 | %py3_install |
44b7835f | 177 | |
44b7835f | 178 | # matplotlib can use system fonts, so drop these copies |
17a0057e | 179 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/matplotlib/mpl-data/fonts/ttf/DejaVu*.ttf |
44b7835f JK |
180 | %endif |
181 | ||
0daef324 AM |
182 | %clean |
183 | rm -rf $RPM_BUILD_ROOT | |
184 | ||
44b7835f | 185 | %if %{with python2} |
0daef324 AM |
186 | %files |
187 | %defattr(644,root,root,755) | |
17a0057e | 188 | %doc README.rst LICENSE/LICENSE |
b00c5f48 MWP |
189 | %dir %{py_sitedir}/%{module} |
190 | %{py_sitedir}/%{module}/*.py[co] | |
191 | %attr(755,root,root) %{py_sitedir}/%{module}/*.so | |
17a0057e | 192 | %{py_sitedir}/%{module}/axes |
b00c5f48 MWP |
193 | %dir %{py_sitedir}/%{module}/backends |
194 | %{py_sitedir}/%{module}/backends/*.py[co] | |
195 | %attr(755,root,root) %{py_sitedir}/%{module}/backends/*.so | |
1cef0da3 AM |
196 | %dir %{py_sitedir}/%{module}/backends/qt_editor |
197 | %{py_sitedir}/%{module}/backends/qt_editor/*.py[co] | |
1cef0da3 | 198 | %{py_sitedir}/%{module}/backends/web_backend |
17a0057e | 199 | %{py_sitedir}/%{module}/cbook |
1cef0da3 | 200 | %{py_sitedir}/%{module}/compat |
b00c5f48 | 201 | %{py_sitedir}/%{module}/mpl-data |
fa8b7ea5 | 202 | %{py_sitedir}/%{module}/projections |
60d13b2c | 203 | %{py_sitedir}/%{module}/sphinxext |
1cef0da3 | 204 | %{py_sitedir}/%{module}/style |
1b7b491c JR |
205 | %{py_sitedir}/%{module}/testing |
206 | %{py_sitedir}/%{module}/tri | |
fa8b7ea5 MK |
207 | |
208 | %{py_sitedir}/mpl_toolkits | |
6466a51f | 209 | %{py_sitedir}/pylab.py[co] |
17a0057e JB |
210 | %{py_sitedir}/%{module}-%{version}-py*.egg-info |
211 | %{py_sitedir}/%{module}-%{version}-py*-nspkg.pth | |
44b7835f JK |
212 | %endif |
213 | ||
214 | %if %{with python3} | |
215 | %files -n python3-%{module} | |
216 | %defattr(644,root,root,755) | |
17a0057e | 217 | %doc README.rst LICENSE/LICENSE |
44b7835f JK |
218 | %dir %{py3_sitedir}/%{module} |
219 | %{py3_sitedir}/%{module}/*.py | |
220 | %{py3_sitedir}/%{module}/__pycache__ | |
221 | %attr(755,root,root) %{py3_sitedir}/%{module}/*.so | |
17a0057e | 222 | %{py3_sitedir}/%{module}/axes |
44b7835f JK |
223 | %dir %{py3_sitedir}/%{module}/backends |
224 | %{py3_sitedir}/%{module}/backends/*.py | |
225 | %{py3_sitedir}/%{module}/backends/__pycache__ | |
226 | %attr(755,root,root) %{py3_sitedir}/%{module}/backends/*.so | |
1cef0da3 AM |
227 | %dir %{py3_sitedir}/%{module}/backends/qt_editor |
228 | %{py3_sitedir}/%{module}/backends/qt_editor/*.py | |
229 | %{py3_sitedir}/%{module}/backends/qt_editor/__pycache__ | |
1cef0da3 | 230 | %{py3_sitedir}/%{module}/backends/web_backend |
17a0057e | 231 | %{py3_sitedir}/%{module}/cbook |
1cef0da3 | 232 | %{py3_sitedir}/%{module}/compat |
44b7835f JK |
233 | %{py3_sitedir}/%{module}/mpl-data |
234 | %{py3_sitedir}/%{module}/projections | |
235 | %{py3_sitedir}/%{module}/sphinxext | |
1cef0da3 | 236 | %{py3_sitedir}/%{module}/style |
44b7835f JK |
237 | %{py3_sitedir}/%{module}/testing |
238 | %{py3_sitedir}/%{module}/tri | |
239 | %{py3_sitedir}/mpl_toolkits | |
240 | %{py3_sitedir}/pylab.py | |
241 | %{py3_sitedir}/__pycache__ | |
17a0057e JB |
242 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info |
243 | %{py3_sitedir}/%{module}-%{version}-py*-nspkg.pth | |
44b7835f | 244 | %endif |