]>
Commit | Line | Data |
---|---|---|
9cace9fc | 1 | # NOTE: for versions >= 0.5 (for Python 3.5+) see python3-sphinx_gallery.spec |
e8b6716e JB |
2 | # |
3 | # Conditional build: | |
4 | %bcond_with tests # unit tests [testconfs dir is missing in dist tarball] | |
5 | %bcond_without python2 # CPython 2.x module | |
9cace9fc | 6 | %bcond_with python3 # CPython 3.x module (built from python3-sphinx_gallery.spec) |
e8b6716e JB |
7 | |
8 | Summary: Sphinx extension to automatically generate an examples gallery | |
9 | Summary(pl.UTF-8): Rozszerzenie Sphinksa do automatycznego generowania galerii przykładów | |
37f686be JB |
10 | Name: python-sphinx_gallery |
11 | # NOTE: keep 0.4.x here; 0.5+ don't support python 2 | |
e8b6716e | 12 | Version: 0.4.0 |
2dfb7448 | 13 | Release: 6 |
e8b6716e JB |
14 | License: BSD |
15 | Group: Libraries/Python | |
16 | #Source0Download: https://pypi.org/simple/sphinx-gallery/ | |
17 | Source0: https://files.pythonhosted.org/packages/source/s/sphinx-gallery/sphinx-gallery-%{version}.tar.gz | |
18 | # Source0-md5: 1f3e578107ca253a184889733a4fbcea | |
19 | URL: https://github.com/sphinx-gallery/sphinx-gallery | |
20 | %if %{with python2} | |
21 | BuildRequires: python-modules >= 1:2.5 | |
22 | %{?with_tests:BuildRequires: python-pytest} | |
23 | BuildRequires: python-setuptools | |
24 | %endif | |
25 | %if %{with python3} | |
26 | BuildRequires: python3-modules >= 1:3.2 | |
27 | %{?with_tests:BuildRequires: python3-pytest} | |
28 | BuildRequires: python3-setuptools | |
29 | %endif | |
30 | BuildRequires: rpm-pythonprov | |
31 | BuildRequires: rpmbuild(macros) >= 1.714 | |
32 | Requires: python-modules >= 1:2.5 | |
37f686be JB |
33 | Provides: python-sphinx-gallery = %{version}-%{release} |
34 | Obsoletes: python-sphinx-gallery < 0.4.0-5 | |
e8b6716e JB |
35 | BuildArch: noarch |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
38 | %description | |
39 | A Sphinx extension that builds an HTML version of any Python script | |
40 | and puts it into an examples gallery. | |
41 | ||
42 | It is extracted from the scikit-learn project and aims to be an | |
43 | independent general purpose extension. | |
44 | ||
45 | %description -l pl.UTF-8 | |
46 | Rozszerzenie Sphinksa tworzące wersję HTML dowolnego skryptu Pythona i | |
47 | umieszczające go w galerii przykładów. | |
48 | ||
49 | Zostało wyciągnięte z projektu scikit-learn z myślą o używaniu jako | |
50 | niezależne rozszerzenie ogólnego przeznaczenia. | |
51 | ||
37f686be | 52 | %package -n python3-sphinx_gallery |
e8b6716e JB |
53 | Summary: Sphinx extension to automatically generate an examples gallery |
54 | Summary(pl.UTF-8): Rozszerzenie Sphinksa do automatycznego generowania galerii przykładów | |
55 | Group: Libraries/Python | |
56 | Requires: python3-modules >= 1:3.2 | |
37f686be JB |
57 | Provides: python3-sphinx-gallery = %{version}-%{release} |
58 | Obsoletes: python3-sphinx-gallery < 0.4.0-5 | |
e8b6716e | 59 | |
37f686be | 60 | %description -n python3-sphinx_gallery |
e8b6716e JB |
61 | A Sphinx extension that builds an HTML version of any Python script |
62 | and puts it into an examples gallery. | |
63 | ||
64 | It is extracted from the scikit-learn project and aims to be an | |
65 | independent general purpose extension. | |
66 | ||
37f686be | 67 | %description -n python3-sphinx_gallery -l pl.UTF-8 |
e8b6716e JB |
68 | Rozszerzenie Sphinksa tworzące wersję HTML dowolnego skryptu Pythona i |
69 | umieszczające go w galerii przykładów. | |
70 | ||
71 | Zostało wyciągnięte z projektu scikit-learn z myślą o używaniu jako | |
72 | niezależne rozszerzenie ogólnego przeznaczenia. | |
73 | ||
74 | %prep | |
75 | %setup -q -n sphinx-gallery-%{version} | |
76 | ||
77 | %build | |
78 | %if %{with python2} | |
79 | %py_build | |
80 | ||
81 | %if %{with tests} | |
82 | PYTHONPATH=$(pwd)/build-2/lib \ | |
83 | pytest-2 sphinx_gallery/tests | |
84 | %endif | |
85 | %endif | |
86 | ||
87 | %if %{with python3} | |
88 | %py3_build | |
89 | ||
90 | %if %{with tests} | |
91 | PYTHONPATH=$(pwd)/build-3/lib \ | |
92 | pytest-3 sphinx_gallery/tests | |
93 | %endif | |
94 | %endif | |
95 | ||
96 | %install | |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | ||
99 | %if %{with python2} | |
100 | %py_install | |
101 | ||
102 | %py_postclean | |
103 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/sphinx_gallery/tests | |
104 | %endif | |
105 | ||
106 | %if %{with python3} | |
e61c608d JR |
107 | # ensure tools come from python3 package |
108 | %{__rm} -r $RPM_BUILD_ROOT%{_bindir} | |
e8b6716e JB |
109 | %py3_install |
110 | ||
111 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/sphinx_gallery/tests | |
112 | %endif | |
113 | ||
114 | %clean | |
115 | rm -rf $RPM_BUILD_ROOT | |
116 | ||
117 | %if %{with python2} | |
118 | %files | |
119 | %defattr(644,root,root,755) | |
120 | %doc CHANGES.rst LICENSE README.rst | |
e61c608d JR |
121 | %if %{without python3} |
122 | %attr(755,root,root) %{_bindir}/copy_sphinxgallery.sh | |
123 | %attr(755,root,root) %{_bindir}/sphx_glr_python_to_jupyter.py | |
124 | %endif | |
e8b6716e JB |
125 | %{py_sitescriptdir}/sphinx_gallery |
126 | %{py_sitescriptdir}/sphinx_gallery-%{version}-py*.egg-info | |
127 | %endif | |
128 | ||
129 | %if %{with python3} | |
37f686be | 130 | %files -n python3-sphinx_gallery |
e8b6716e JB |
131 | %defattr(644,root,root,755) |
132 | %doc CHANGES.rst LICENSE README.rst | |
133 | %attr(755,root,root) %{_bindir}/copy_sphinxgallery.sh | |
134 | %attr(755,root,root) %{_bindir}/sphx_glr_python_to_jupyter.py | |
135 | %{py3_sitescriptdir}/sphinx_gallery | |
136 | %{py3_sitescriptdir}/sphinx_gallery-%{version}-py*.egg-info | |
137 | %endif |