]> git.pld-linux.org Git - SPECS.git/blob - python-prompt_toolkit.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / python-prompt_toolkit.spec
1 # NOTE: for versions >= 3.0 (for python 3.6.1+) see python3-prompt_toolkit.spec
2 #
3 # Conditional build:
4 %bcond_without  doc     # Sphinx documentation
5 %bcond_without  tests   # unit tests
6 %bcond_without  python2 # CPython 2.x module
7 %bcond_without  python3 # CPython 3.x module
8
9 %define         module  prompt_toolkit
10 Summary:        Library for building powerful interactive command lines in Python
11 Summary(pl.UTF-8):      Biblioteka do budowania interaktywnych wierszy poleceń w Pythonie
12 Name:           python-%{module}
13 # keep 1.x here (2.x is not supported by ipython for python2, 3.x drops python2 support)
14 Version:        1.0.18
15 Release:        3
16 License:        BSD
17 Group:          Libraries/Python
18 #Source0Download: https://github.com/prompt-toolkit/python-prompt-toolkit/releases
19 Source0:        https://github.com/jonathanslenders/python-prompt-toolkit/archive/%{version}/python-prompt-toolkit-%{version}.tar.gz
20 # Source0-md5:  1b800e5f190572d7a13bda45b7de058a
21 URL:            https://github.com/jonathanslenders/python-prompt-toolkit
22 %if %{with python2}
23 BuildRequires:  python-modules >= 1:2.6
24 BuildRequires:  python-setuptools
25 BuildRequires:  python-six >= 1.9.0
26 BuildRequires:  python-wcwidth
27 %if %{with tests}
28 BuildRequires:  python-pytest
29 %endif
30 %endif
31 %if %{with python3}
32 BuildRequires:  python3-modules >= 1:3.3
33 BuildRequires:  python3-setuptools
34 BuildRequires:  python3-six >= 1.9.0
35 BuildRequires:  python3-wcwidth
36 %if %{with tests}
37 BuildRequires:  python3-pytest
38 %endif
39 %endif
40 BuildRequires:  rpm-pythonprov
41 BuildRequires:  rpmbuild(macros) >= 1.714
42 BuildRequires:  sed >= 4.0
43 %if %{with doc}
44 BuildRequires:  sphinx-pdg
45 %endif
46 Requires:       python-modules >= 1:2.6
47 BuildArch:      noarch
48 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49
50 %description
51 prompt_toolkit is a library for building powerful interactive command
52 lines and terminal applications in Python.
53
54 %description -l pl.UTF-8
55 prompt_toolkit to biblioteka do tworzenia interaktywnych wierwszy
56 poleceń i aplikacji terminalowych w Pythonie.
57
58 %package -n python3-%{module}
59 Summary:        Library for building powerful interactive command lines in Python
60 Summary(pl.UTF-8):      Biblioteka do budowania interaktywnych wierszy poleceń w Pythonie
61 Group:          Libraries/Python
62 Requires:       python3-modules >= 1:3.3
63
64 %description -n python3-%{module}
65 prompt_toolkit is a library for building powerful interactive command
66 lines and terminal applications in Python.
67
68 %description -n python3-%{module} -l pl.UTF-8
69 prompt_toolkit to biblioteka do tworzenia interaktywnych wierwszy
70 poleceń i aplikacji terminalowych w Pythonie.
71
72 %package apidocs
73 Summary:        API documentation for prompt_toolkit module
74 Summary(pl.UTF-8):      Dokumentacja API modułu prompt_toolkit
75 Group:          Documentation
76
77 %description apidocs
78 API documentation for prompt_toolkit module.
79
80 %description apidocs -l pl.UTF-8
81 Dokumentacja API modułu prompt_toolkit.
82
83 %prep
84 %setup -q -n python-prompt-toolkit-%{version}
85
86 %build
87 %if %{with python2}
88 %py_build
89
90 %if %{with tests}
91 # tests expect 
92 TERM=xterm \
93 %{__python} -m pytest tests
94 %endif
95 %endif
96
97 %if %{with python3}
98 %py3_build
99
100 %if %{with tests}
101 # test_print_tokens expects sequences emitted for xterm
102 TERM=xterm \
103 %{__python3} -m pytest tests
104 %endif
105 %endif
106
107 %if %{with doc}
108 %{__make} -C docs html
109 %endif
110
111 %install
112 rm -rf $RPM_BUILD_ROOT
113
114 %if %{with python2}
115 %py_install
116
117 %py_postclean
118 %endif
119
120 %if %{with python3}
121 %py3_install
122 %endif
123
124 %if %{with python2}
125 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
126 cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
127 find $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} -name '*.py' \
128         | xargs sed -i '1s|/usr/bin/env python|%{__python}|'
129 %endif
130 %if %{with python3}
131 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
132 cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
133 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
134         | xargs sed -i '1s|/usr/bin/env python|%{__python3}|'
135 %endif
136
137 %clean
138 rm -rf $RPM_BUILD_ROOT
139
140 %if %{with python2}
141 %files
142 %defattr(644,root,root,755)
143 %doc AUTHORS.rst CHANGELOG LICENSE README.rst
144 %{py_sitescriptdir}/prompt_toolkit
145 %{py_sitescriptdir}/prompt_toolkit-%{version}-py*.egg-info
146 %{_examplesdir}/python-%{module}-%{version}
147 %endif
148
149 %if %{with python3}
150 %files -n python3-%{module}
151 %defattr(644,root,root,755)
152 %doc AUTHORS.rst CHANGELOG LICENSE README.rst
153 %{py3_sitescriptdir}/prompt_toolkit
154 %{py3_sitescriptdir}/prompt_toolkit-%{version}-py*.egg-info
155 %{_examplesdir}/python3-%{module}-%{version}
156 %endif
157
158 %if %{with doc}
159 %files apidocs
160 %defattr(644,root,root,755)
161 %doc docs/_build/html/{_images,_static,pages,*.html,*.js}
162 %endif
This page took 1.467977 seconds and 3 git commands to generate.