]> git.pld-linux.org Git - packages/python-click.git/blob - python-click.spec
f4dddad065c1281ba8277aeb4c91837fcaa26221
[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:        6.7
13 Release:        4
14 License:        BSD
15 Group:          Libraries/Python
16 Source0:        https://github.com/pallets/click/archive/%{version}.tar.gz
17 # Source0-md5:  3cae45d064f341b3f373489d8f7745e9
18 URL:            http://click.pocoo.org/
19 %if %{with tests} && %(locale -a | grep -q '^C\.UTF-8$'; echo $?)
20 BuildRequires:  glibc-localedb-all
21 %endif
22 %if %{with python2}
23 BuildRequires:  python-modules >= 2
24 BuildRequires:  python-pytest
25 BuildRequires:  python-setuptools
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-modules >= 1:3.2
29 BuildRequires:  python3-pytest
30 BuildRequires:  python3-setuptools
31 %endif
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
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
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
54 %package -n python3-%{module}
55 Summary:        A simple wrapper around optparse for powerful command line utilities
56 Summary(pl.UTF-8):      Proste obudowanie optparse do tworzenia potężnych narzędzi linii poleceń
57 Group:          Libraries/Python
58 Requires:       python3-modules >= 1:3.2
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
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
84 %prep
85 %setup -q -n %{module}-%{version}
86
87 %build
88 %if %{with python2}
89 %py_build
90 %if %{with tests}
91 PYTHONPATH=$(pwd) %{__python} -m pytest tests --tb=long --verbose
92 %endif
93 %endif
94
95 %if %{with python3}
96 %py3_build
97 %if %{with tests}
98 LC_ALL=C.UTF-8 PYTHONPATH=$(pwd) %{__python3} -m pytest tests --tb=long --verbose
99 %endif
100 %endif
101
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
108 %install
109 rm -rf $RPM_BUILD_ROOT
110
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)
126 %doc CHANGES LICENSE README
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)
134 %doc CHANGES LICENSE README
135 %{py3_sitescriptdir}/%{module}
136 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
137 %endif
138
139 %if %{with doc}
140 %files apidocs
141 %defattr(644,root,root,755)
142 %doc docs/_build/html/{_static,*.html,*.js}
143 %endif
This page took 0.049712 seconds and 2 git commands to generate.