]>
Commit | Line | Data |
---|---|---|
d5c345cb | 1 | # |
e105cc2d | 2 | # Conditional build: |
d5c345cb JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
e105cc2d | 5 | %bcond_without python2 # CPython 2.x module |
f57478b6 | 6 | %bcond_with python3 # CPython 3.x module (built from python3-jaraco.packaging.spec) |
e105cc2d | 7 | |
e105cc2d AM |
8 | %define egg_name jaraco.packaging |
9 | %define pypi_name jaraco.packaging | |
d5c345cb JB |
10 | Summary: Tools to supplement packaging Python releases |
11 | Summary(pl.UTF-8): Narzędzia wspierające pakietowanie wydań modułów Pythona | |
e105cc2d | 12 | Name: python-%{pypi_name} |
c1c0cff9 | 13 | Version: 6.2 |
31fad662 | 14 | Release: 5 |
e105cc2d AM |
15 | License: MIT |
16 | Group: Libraries/Python | |
d5c345cb JB |
17 | #Source0Download: https://pypi.org/simple/jaraco-packaging/ |
18 | Source0: https://files.pythonhosted.org/packages/source/j/jaraco.packaging/%{pypi_name}-%{version}.tar.gz | |
c1c0cff9 | 19 | # Source0-md5: ac36cfb217276af107bcbcb60bced1ec |
d5c345cb | 20 | URL: https://pypi.org/project/jaraco.packaging/ |
e105cc2d AM |
21 | BuildRequires: rpm-pythonprov |
22 | BuildRequires: rpmbuild(macros) >= 1.714 | |
23 | %if %{with python2} | |
d5c345cb | 24 | BuildRequires: python-modules >= 1:2.7 |
32b553e3 | 25 | BuildRequires: python-setuptools >= 1:31.0.1 |
d5c345cb JB |
26 | BuildRequires: python-setuptools_scm >= 1.15 |
27 | %if %{with tests} | |
c1c0cff9 | 28 | BuildRequires: python-importlib_metadata |
d5c345cb | 29 | BuildRequires: python-pytest >= 3.5 |
d5c345cb JB |
30 | BuildRequires: python-six >= 1.4 |
31 | %endif | |
e105cc2d AM |
32 | %endif |
33 | %if %{with python3} | |
c1c0cff9 | 34 | BuildRequires: python3-modules >= 1:3.2 |
32b553e3 | 35 | BuildRequires: python3-setuptools >= 1:31.0.1 |
d5c345cb JB |
36 | BuildRequires: python3-setuptools_scm >= 1.15 |
37 | %if %{with tests} | |
c1c0cff9 JB |
38 | %if "%{py3_ver}" < "3.8" |
39 | BuildRequires: python3-importlib_metadata | |
40 | %endif | |
d5c345cb | 41 | BuildRequires: python3-pytest >= 3.5 |
d5c345cb JB |
42 | BuildRequires: python3-six >= 1.4 |
43 | %endif | |
e105cc2d | 44 | %endif |
d5c345cb | 45 | %if %{with doc} |
f57478b6 JB |
46 | BuildRequires: python-rst.linker >= 1.9 |
47 | BuildRequires: sphinx-pdg-2 | |
d5c345cb JB |
48 | %endif |
49 | Requires: python-jaraco | |
50 | Requires: python-modules >= 1:2.7 | |
e105cc2d AM |
51 | BuildArch: noarch |
52 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
53 | ||
54 | %description | |
d5c345cb JB |
55 | A few tools to supplement packaging Python releases. |
56 | ||
57 | %description -l pl.UTF-8 | |
58 | Kilka narzędzi wspierających pakietowanie wydań modułów Pythona. | |
e105cc2d AM |
59 | |
60 | %package -n python3-%{pypi_name} | |
d5c345cb JB |
61 | Summary: Tools to supplement packaging Python releases |
62 | Summary(pl.UTF-8): Narzędzia wspierające pakietowanie wydań modułów Pythona | |
e105cc2d | 63 | Group: Libraries/Python |
d5c345cb | 64 | Requires: python3-jaraco |
c1c0cff9 | 65 | Requires: python3-modules >= 1:3.2 |
e105cc2d AM |
66 | |
67 | %description -n python3-%{pypi_name} | |
d5c345cb JB |
68 | A few tools to supplement packaging Python releases. |
69 | ||
70 | %description -n python3-%{pypi_name} -l pl.UTF-8 | |
71 | Kilka narzędzi wspierających pakietowanie wydań modułów Pythona. | |
e105cc2d | 72 | |
60ffabb3 JB |
73 | %package apidocs |
74 | Summary: API documentation for Python jaraco.packaging module | |
75 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona jaraco.packaging | |
76 | Group: Documentation | |
77 | ||
78 | %description apidocs | |
79 | API documentation for Python jaraco.packaging module. | |
80 | ||
81 | %description apidocs -l pl.UTF-8 | |
82 | Dokumentacja API modułu Pythona jaraco.packaging. | |
83 | ||
e105cc2d AM |
84 | %prep |
85 | %setup -q -n %{pypi_name}-%{version} | |
86 | ||
87 | %build | |
88 | %if %{with python2} | |
89 | %py_build %{?with_tests:test} | |
90 | %endif | |
91 | ||
92 | %if %{with python3} | |
93 | %py3_build %{?with_tests:test} | |
94 | %endif | |
95 | ||
d5c345cb JB |
96 | %if %{with doc} |
97 | # no Makefile | |
98 | cd docs | |
99 | PYTHONPATH=$(pwd)/.. \ | |
f57478b6 | 100 | sphinx-build-2 -b html . _build/html |
d5c345cb JB |
101 | %endif |
102 | ||
e105cc2d AM |
103 | %install |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
106 | %if %{with python2} | |
107 | %py_install | |
e105cc2d AM |
108 | |
109 | %py_postclean | |
c1c0cff9 JB |
110 | |
111 | # packaged in python-jaraco.spec | |
112 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/jaraco/__init__.py* | |
f57478b6 JB |
113 | |
114 | # packaged in python3 variant only | |
115 | %{__rm} $RPM_BUILD_ROOT%{_bindir}/{dependency-tree,upload-package} | |
e105cc2d AM |
116 | %endif |
117 | ||
118 | %if %{with python3} | |
119 | %py3_install | |
c1c0cff9 JB |
120 | |
121 | # packaged in python-jaraco.spec | |
122 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/jaraco/__init__.py | |
123 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/jaraco/__pycache__/__init__.* | |
e105cc2d AM |
124 | %endif |
125 | ||
126 | %clean | |
127 | rm -rf $RPM_BUILD_ROOT | |
128 | ||
129 | %if %{with python2} | |
130 | %files | |
131 | %defattr(644,root,root,755) | |
d5c345cb JB |
132 | %doc CHANGES.rst LICENSE README.rst |
133 | %{py_sitescriptdir}/jaraco/packaging | |
e105cc2d | 134 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
e105cc2d AM |
135 | %endif |
136 | ||
137 | %if %{with python3} | |
138 | %files -n python3-%{pypi_name} | |
139 | %defattr(644,root,root,755) | |
d5c345cb | 140 | %doc CHANGES.rst LICENSE README.rst |
e105cc2d AM |
141 | %attr(755,root,root) %{_bindir}/dependency-tree |
142 | %attr(755,root,root) %{_bindir}/upload-package | |
d5c345cb | 143 | %{py3_sitescriptdir}/jaraco/packaging |
e105cc2d | 144 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
e105cc2d | 145 | %endif |
60ffabb3 JB |
146 | |
147 | %if %{with doc} | |
148 | %files apidocs | |
149 | %defattr(644,root,root,755) | |
150 | %doc docs/_build/html/{_static,*.html,*.js} | |
151 | %endif |