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