]>
Commit | Line | Data |
---|---|---|
70e5f34b ER |
1 | # |
2 | # Conditional build: | |
d18f22df JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # py.test tests | |
70e5f34b ER |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module click | |
9 | Summary: A simple wrapper around optparse for powerful command line utilities | |
d18f22df | 10 | Summary(pl.UTF-8): Proste obudowanie optparse do tworzenia potężnych narzędzi linii poleceń |
70e5f34b | 11 | Name: python-%{module} |
e9802f93 | 12 | # keep 7.x here for python2 support |
d1fab06f | 13 | Version: 7.1.2 |
8e7c3ece | 14 | Release: 5 |
70e5f34b ER |
15 | License: BSD |
16 | Group: Libraries/Python | |
881f79ba | 17 | #Source0Download: https://github.com/pallets/click/releases |
d1fab06f JB |
18 | Source0: https://github.com/pallets/click/archive/%{version}/click-%{version}.tar.gz |
19 | # Source0-md5: 11aa3cff9c99caadb2574fca12aabbdc | |
20 | URL: https://click.palletsprojects.com/ | |
881f79ba | 21 | %if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?) |
d18f22df JB |
22 | BuildRequires: glibc-localedb-all |
23 | %endif | |
70e5f34b | 24 | %if %{with python2} |
a4e91394 | 25 | BuildRequires: python-modules >= 1:2.7 |
70e5f34b ER |
26 | BuildRequires: python-pytest |
27 | BuildRequires: python-setuptools | |
28 | %endif | |
29 | %if %{with python3} | |
a4e91394 | 30 | BuildRequires: python3-modules >= 1:3.5 |
70e5f34b ER |
31 | BuildRequires: python3-pytest |
32 | BuildRequires: python3-setuptools | |
33 | %endif | |
d18f22df JB |
34 | BuildRequires: rpm-pythonprov |
35 | BuildRequires: rpmbuild(macros) >= 1.714 | |
36 | %if %{with doc} | |
e9802f93 JB |
37 | BuildRequires: sphinx-pdg-3 >= 2.4.4 |
38 | BuildRequires: python3-pallets-sphinx-themes >= 1.2.3 | |
39 | BuildRequires: python3-sphinxcontrib-log-cabinet >= 1.0.1 | |
40 | BuildRequires: python3-sphinx_issues >= 1.2.0 | |
d18f22df | 41 | %endif |
a4e91394 | 42 | Requires: python-modules >= 1:2.7 |
70e5f34b ER |
43 | BuildArch: noarch |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %description | |
47 | click is a Python package for creating beautiful command line | |
48 | interfaces in a composable way with as little amount of code as | |
49 | necessary. It's the "Command Line Interface Creation Kit". It's highly | |
50 | configurable but comes with good defaults out of the box. | |
51 | ||
d18f22df JB |
52 | %description -l pl.UTF-8 |
53 | click to pakiet Pythona do tworzenia ładnych interfejsów linii poleceń | |
54 | w uporządkowany sposób, przy użyciu jak najmniejszej ilości kodu. | |
55 | Nazwa "click" pochodzi od "Command Line Interface Creation Kit" | |
56 | (zestaw do tworzenia interfejsu linii poleceń). Jest wysoce | |
57 | konfigurowalny, ale ma dobre ustawienia domyślne. | |
58 | ||
70e5f34b ER |
59 | %package -n python3-%{module} |
60 | Summary: A simple wrapper around optparse for powerful command line utilities | |
d18f22df | 61 | Summary(pl.UTF-8): Proste obudowanie optparse do tworzenia potężnych narzędzi linii poleceń |
70e5f34b | 62 | Group: Libraries/Python |
a4e91394 | 63 | Requires: python3-modules >= 1:3.5 |
70e5f34b ER |
64 | |
65 | %description -n python3-%{module} | |
66 | click is a Python 3 package for creating beautiful command line | |
67 | interfaces in a composable way with as little amount of code as | |
68 | necessary. It's the "Command Line Interface Creation Kit". It's highly | |
69 | configurable but comes with good defaults out of the box. | |
70 | ||
d18f22df JB |
71 | %description -n python3-%{module} -l pl.UTF-8 |
72 | click to pakiet Pythona do tworzenia ładnych interfejsów linii poleceń | |
73 | w uporządkowany sposób, przy użyciu jak najmniejszej ilości kodu. | |
74 | Nazwa "click" pochodzi od "Command Line Interface Creation Kit" | |
75 | (zestaw do tworzenia interfejsu linii poleceń). Jest wysoce | |
76 | konfigurowalny, ale ma dobre ustawienia domyślne. | |
77 | ||
78 | %package apidocs | |
79 | Summary: Documentation for Python click module | |
80 | Summary(pl.UTF-8): Dokumentacja do modułu Pythona click | |
81 | Group: Documentation | |
82 | ||
83 | %description apidocs | |
84 | Documentation for Python click module. | |
85 | ||
86 | %description apidocs -l pl.UTF-8 | |
87 | Dokumentacja do modułu Pythona click. | |
88 | ||
70e5f34b ER |
89 | %prep |
90 | %setup -q -n %{module}-%{version} | |
91 | ||
92 | %build | |
93 | %if %{with python2} | |
94 | %py_build | |
d1fab06f | 95 | |
70e5f34b | 96 | %if %{with tests} |
d1fab06f | 97 | LC_ALL=C.UTF-8 \ |
e9802f93 | 98 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
d1fab06f JB |
99 | PYTHONPATH=$(pwd)/src \ |
100 | %{__python} -m pytest tests --tb=long --verbose | |
70e5f34b ER |
101 | %endif |
102 | %endif | |
103 | ||
104 | %if %{with python3} | |
105 | %py3_build | |
d1fab06f | 106 | |
70e5f34b | 107 | %if %{with tests} |
e9802f93 | 108 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
d1fab06f JB |
109 | PYTHONPATH=$(pwd)/src \ |
110 | %{__python3} -m pytest tests --tb=long --verbose | |
70e5f34b ER |
111 | %endif |
112 | %endif | |
113 | ||
d18f22df | 114 | %if %{with doc} |
d1fab06f | 115 | PYTHONPATH=$(pwd)/src \ |
d18f22df | 116 | %{__make} -C docs html \ |
d1fab06f | 117 | SPHINXBUILD=sphinx-build-3 |
d18f22df JB |
118 | %endif |
119 | ||
70e5f34b ER |
120 | %install |
121 | rm -rf $RPM_BUILD_ROOT | |
d18f22df | 122 | |
70e5f34b ER |
123 | %if %{with python2} |
124 | %py_install | |
d1fab06f | 125 | |
70e5f34b ER |
126 | %py_postclean |
127 | %endif | |
128 | ||
129 | %if %{with python3} | |
130 | %py3_install | |
131 | %endif | |
132 | ||
133 | %clean | |
134 | rm -rf $RPM_BUILD_ROOT | |
135 | ||
136 | %if %{with python2} | |
137 | %files | |
138 | %defattr(644,root,root,755) | |
980d36a0 | 139 | %doc CHANGES.rst LICENSE.rst README.rst |
d1fab06f JB |
140 | %{py_sitescriptdir}/click |
141 | %{py_sitescriptdir}/click-%{version}-py*.egg-info | |
70e5f34b ER |
142 | %endif |
143 | ||
144 | %if %{with python3} | |
145 | %files -n python3-%{module} | |
146 | %defattr(644,root,root,755) | |
980d36a0 | 147 | %doc CHANGES.rst LICENSE.rst README.rst |
d1fab06f JB |
148 | %{py3_sitescriptdir}/click |
149 | %{py3_sitescriptdir}/click-%{version}-py*.egg-info | |
70e5f34b | 150 | %endif |
d18f22df JB |
151 | |
152 | %if %{with doc} | |
153 | %files apidocs | |
154 | %defattr(644,root,root,755) | |
155 | %doc docs/_build/html/{_static,*.html,*.js} | |
156 | %endif |