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