]>
Commit | Line | Data |
---|---|---|
b3ea5b35 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | %bcond_without doc # Sphinx documentation | |
6 | %bcond_without tests # py.test unit tests | |
bd259503 | 7 | |
b3ea5b35 JB |
8 | Summary: Python 2 module wrapper for os.path |
9 | Summary(pl.UTF-8): Moduł Pythona 2 obudowujący os.path | |
bd259503 | 10 | Name: python-path |
bdd88fba | 11 | Version: 11.0.1 |
d3ee32f5 | 12 | Release: 2 |
b3ea5b35 | 13 | License: MIT |
bd259503 | 14 | Group: Libraries/Python |
bdd88fba JB |
15 | #Source0Download: https://pypi.python.org/simple/path-py/ |
16 | Source0: https://files.pythonhosted.org/packages/source/p/path.py/path.py-%{version}.tar.gz | |
17 | # Source0-md5: de65181c0efc12efc34d1ff1a0b1edfe | |
b3ea5b35 JB |
18 | Patch0: %{name}-sphinx.patch |
19 | URL: https://github.com/jaraco/path.py | |
bdd88fba | 20 | %if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?) |
b3ea5b35 JB |
21 | BuildRequires: glibc-localedb-all |
22 | %endif | |
23 | %if %{with python2} | |
24 | BuildRequires: python >= 1:2.7 | |
25 | BuildRequires: python-modules >= 1:2.7 | |
26 | BuildRequires: python-setuptools | |
27 | BuildRequires: python-setuptools_scm >= 1.15.0 | |
28 | %if %{with tests} | |
29 | BuildRequires: python-appdirs | |
30 | BuildRequires: python-pytest >= 2.8 | |
bdd88fba | 31 | BuildRequires: python-pytest-flake8 |
b3ea5b35 JB |
32 | %endif |
33 | %endif | |
34 | %if %{with python3} | |
bdd88fba JB |
35 | BuildRequires: python3 >= 1:3.4 |
36 | BuildRequires: python3-modules >= 1:3.4 | |
b3ea5b35 JB |
37 | BuildRequires: python3-setuptools |
38 | BuildRequires: python3-setuptools_scm >= 1.15.0 | |
39 | %if %{with tests} | |
40 | BuildRequires: python3-appdirs | |
41 | BuildRequires: python3-pytest >= 2.8 | |
bdd88fba | 42 | BuildRequires: python3-pytest-flake8 |
b3ea5b35 JB |
43 | %endif |
44 | %endif | |
49131dd8 | 45 | BuildRequires: rpm-pythonprov |
b3ea5b35 JB |
46 | BuildRequires: rpmbuild(macros) >= 1.714 |
47 | %if %{with doc} | |
bdd88fba JB |
48 | BuildRequires: sphinx-pdg-3 |
49 | BuildRequires: python3-jaraco.packaging >= 3.2 | |
50 | BuildRequires: python3-rst.linker >= 1.9 | |
b3ea5b35 JB |
51 | %endif |
52 | Requires: python-modules >= 1:2.7 | |
bd259503 | 53 | BuildArch: noarch |
10ccf03a | 54 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
bd259503 JB |
55 | |
56 | %description | |
b3ea5b35 JB |
57 | path.py implements a path objects as first-class entities, allowing |
58 | common operations on files to be invoked on those path objects | |
59 | directly. | |
bd259503 | 60 | |
170d9002 | 61 | %description -l pl.UTF-8 |
b3ea5b35 JB |
62 | path.py implementuje obiekty ścieżek jako instancje pierwszoklasowe, |
63 | pozwalające na wykonywanie ogólnych operacji na plikach bezpośrednio | |
64 | na tych ścieżkach. | |
65 | ||
66 | %package -n python3-path | |
67 | Summary: Python 3 module wrapper for os.path | |
68 | Summary(pl.UTF-8): Moduł Pythona 3 obudowujący os.path | |
69 | Group: Libraries/Python | |
bdd88fba | 70 | Requires: python3-modules >= 1:3.4 |
b3ea5b35 JB |
71 | |
72 | %description -n python3-path | |
73 | path.py implements a path objects as first-class entities, allowing | |
74 | common operations on files to be invoked on those path objects | |
75 | directly. | |
76 | ||
77 | %description -n python3-path -l pl.UTF-8 | |
78 | path.py implementuje obiekty ścieżek jako instancje pierwszoklasowe, | |
79 | pozwalające na wykonywanie ogólnych operacji na plikach bezpośrednio | |
80 | na tych ścieżkach. | |
81 | ||
82 | %package apidocs | |
83 | Summary: Documentation for Python path.py module | |
84 | Summary(pl.UTF-8): Dokumentacja modułu Pythona path.py | |
85 | Group: Documentation | |
86 | ||
87 | %description apidocs | |
88 | Documentation for Python path.py module. | |
89 | ||
90 | %description apidocs -l pl.UTF-8 | |
91 | Dokumentacja modułu Pythona path.py. | |
bd259503 JB |
92 | |
93 | %prep | |
b3ea5b35 JB |
94 | %setup -q -n path.py-%{version} |
95 | %patch0 -p1 | |
96 | ||
97 | %build | |
98 | %if %{with python2} | |
99 | %py_build | |
100 | ||
101 | %if %{with tests} | |
bdd88fba JB |
102 | LC_ALL=C.UTF-8 \ |
103 | %{__python} -m pytest test_path.py | |
b3ea5b35 JB |
104 | %endif |
105 | %endif | |
106 | ||
107 | %if %{with python3} | |
108 | %py3_build | |
109 | ||
110 | %if %{with tests} | |
bdd88fba JB |
111 | LC_ALL=C.UTF-8 \ |
112 | %{__python3} -m pytest test_path.py | |
b3ea5b35 JB |
113 | %endif |
114 | %endif | |
115 | ||
116 | %if %{with doc} | |
69bf8988 JB |
117 | # disable warnings (-W in SPHINXOPTS) to ignore objects.inv fetching error on builders |
118 | %{__make} -C docs html \ | |
bdd88fba | 119 | SPHINXBUILD=sphinx-build-3 \ |
69bf8988 | 120 | SPHINXOPTS= |
b3ea5b35 | 121 | %endif |
bd259503 JB |
122 | |
123 | %install | |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | ||
b3ea5b35 JB |
126 | %if %{with python2} |
127 | %py_install | |
128 | ||
129 | %py_postclean | |
130 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/test_path.py* | |
131 | %endif | |
bd259503 | 132 | |
b3ea5b35 JB |
133 | %if %{with python3} |
134 | %py3_install | |
bd259503 | 135 | |
b3ea5b35 JB |
136 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/test_path.py |
137 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/__pycache__/test_path.* | |
138 | %endif | |
bd259503 JB |
139 | |
140 | %clean | |
141 | rm -rf $RPM_BUILD_ROOT | |
142 | ||
b3ea5b35 | 143 | %if %{with python2} |
bd259503 JB |
144 | %files |
145 | %defattr(644,root,root,755) | |
b3ea5b35 JB |
146 | %doc CHANGES.rst README.rst |
147 | %{py_sitescriptdir}/path.py[co] | |
148 | %{py_sitescriptdir}/path.py-%{version}-py*.egg-info | |
149 | %endif | |
150 | ||
151 | %if %{with python3} | |
152 | %files -n python3-path | |
153 | %defattr(644,root,root,755) | |
154 | %doc CHANGES.rst README.rst | |
155 | %{py3_sitescriptdir}/path.py | |
156 | %{py3_sitescriptdir}/__pycache__/path.cpython-*.py[co] | |
157 | %{py3_sitescriptdir}/path.py-%{version}-py*.egg-info | |
158 | %endif | |
159 | ||
160 | %if %{with doc} | |
161 | %files apidocs | |
162 | %defattr(644,root,root,755) | |
163 | %doc docs/_build/html/{_static,*.html,*.js} | |
164 | %endif |