]> git.pld-linux.org Git - packages/python-click.git/blob - python-click.spec
- rebuild with python 3.8
[packages/python-click.git] / python-click.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_without  tests   # py.test tests
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
10 Summary(pl.UTF-8):      Proste obudowanie optparse do tworzenia potężnych narzędzi linii poleceń
11 Name:           python-%{module}
12 Version:        7.0
13 Release:        3
14 License:        BSD
15 Group:          Libraries/Python
16 #Source0Download: https://github.com/pallets/click/releases
17 # TODO: use:
18 #Source0:       https://github.com/pallets/click/archive/%{version}/click-%{version}.tar.gz
19 Source0:        https://github.com/pallets/click/archive/%{version}.tar.gz
20 # Source0-md5:  1c000f4357bd04e49af568b51bc03c6a
21 URL:            http://click.pocoo.org/
22 %if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?)
23 BuildRequires:  glibc-localedb-all
24 %endif
25 %if %{with python2}
26 BuildRequires:  python-modules >= 2
27 BuildRequires:  python-pytest
28 BuildRequires:  python-setuptools
29 %{?with_doc:BuildRequires:      python-pallets-sphinx-themes}
30 %endif
31 %if %{with python3}
32 BuildRequires:  python3-modules >= 1:3.2
33 BuildRequires:  python3-pytest
34 BuildRequires:  python3-setuptools
35 %{?with_doc:BuildRequires:      python3-pallets-sphinx-themes}
36 %endif
37 BuildRequires:  rpm-pythonprov
38 BuildRequires:  rpmbuild(macros) >= 1.714
39 %if %{with doc}
40 BuildRequires:  sphinx-pdg-2
41 %endif
42 Requires:       python-modules >= 2
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
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
59 %package -n python3-%{module}
60 Summary:        A simple wrapper around optparse for powerful command line utilities
61 Summary(pl.UTF-8):      Proste obudowanie optparse do tworzenia potężnych narzędzi linii poleceń
62 Group:          Libraries/Python
63 Requires:       python3-modules >= 1:3.2
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
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
89 %prep
90 %setup -q -n %{module}-%{version}
91
92 %build
93 %if %{with python2}
94 %py_build
95 %if %{with tests}
96 PYTHONPATH=$(pwd) %{__python} -m pytest tests --tb=long --verbose
97 %endif
98 %endif
99
100 %if %{with python3}
101 %py3_build
102 %if %{with tests}
103 LC_ALL=C.UTF-8 PYTHONPATH=$(pwd) %{__python3} -m pytest tests --tb=long --verbose
104 %endif
105 %endif
106
107 %if %{with doc}
108 # click-specific code is not python3 ready
109 PYTHONPATH=$(pwd) \
110 %{__make} -C docs html \
111         SPHINXBUILD=sphinx-build-2
112 %endif
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116
117 %if %{with python2}
118 %py_install
119 %py_postclean
120 %endif
121
122 %if %{with python3}
123 %py3_install
124 %endif
125
126 %clean
127 rm -rf $RPM_BUILD_ROOT
128
129 %if %{with python2}
130 %files
131 %defattr(644,root,root,755)
132 %doc CHANGES.rst LICENSE.rst README.rst
133 %{py_sitescriptdir}/%{module}
134 %{py_sitescriptdir}/Click-%{version}-py*.egg-info
135 %endif
136
137 %if %{with python3}
138 %files -n python3-%{module}
139 %defattr(644,root,root,755)
140 %doc CHANGES.rst LICENSE.rst README.rst
141 %{py3_sitescriptdir}/%{module}
142 %{py3_sitescriptdir}/Click-%{version}-py*.egg-info
143 %endif
144
145 %if %{with doc}
146 %files apidocs
147 %defattr(644,root,root,755)
148 %doc docs/_build/html/{_static,*.html,*.js}
149 %endif
This page took 0.042919 seconds and 3 git commands to generate.