]> git.pld-linux.org Git - packages/python-pexpect.git/blob - python-pexpect.spec
rebuild with python 3.10
[packages/python-pexpect.git] / python-pexpect.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_with     tests   # py.test tests [require ptys, so not on builders]
6 %bcond_without  doc     # Sphinx documentation
7
8 %define         module  pexpect
9 Summary:        Pure Python Expect-like module
10 Summary(pl.UTF-8):      Moduł podobny do narzędzia Expect napisany w czystym Pythonie
11 Name:           python-%{module}
12 Version:        4.8.0
13 Release:        4
14 License:        ISC
15 Group:          Development/Languages/Python
16 #Source0Download: https://pypi.org/simple/pexpect/
17 Source0:        https://files.pythonhosted.org/packages/source/p/pexpect/pexpect-%{version}.tar.gz
18 # Source0-md5:  153eb25184249d6a85fde9acf4804085
19 Patch0:         %{name}-use_setuptools.patch
20 Patch1:         sphinx-api.patch
21 URL:            http://pexpect.readthedocs.io/
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-devel >= 1:2.7
27 BuildRequires:  python-modules >= 1:2.7
28 BuildRequires:  python-setuptools
29 %if %{with tests}
30 BuildRequires:  python-ptyprocess >= 0.5
31 BuildRequires:  python-pytest
32 %endif
33 %endif
34 %if %{with python3}
35 BuildRequires:  python3-modules >= 1:3.2
36 BuildRequires:  python3-setuptools
37 %if %{with tests}
38 BuildRequires:  python3-ptyprocess >= 0.5
39 BuildRequires:  python3-pytest
40 %endif
41 %endif
42 BuildRequires:  rpm-pythonprov
43 BuildRequires:  rpmbuild(macros) >= 1.714
44 %if %{with doc}
45 BuildRequires:  sphinx-pdg
46 %endif
47 Requires:       python-modules >= 1:2.7
48 BuildArch:      noarch
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 %description
52 Pexpect is a pure Python module for spawning child applications;
53 controlling them; and responding to expected patterns in their output.
54 Pexpect works like Don Libes' Expect. Pexpect allows your script to
55 spawn a child application and control it as if a human were typing
56 commands.
57
58 %description -l pl.UTF-8
59 Pexpect jest modułem napisanym wyłącznie w Pythonie przeznaczonym do
60 uruchamiania aplikacji i kontroli nad nimi poprzez reagowanie na
61 znalezione wzorce na ich wyjściu. Pexpect działa podobnie do Expecta
62 Dona Libesa - pozwala skryptom z ich poziomu uruchomić inne programy i
63 sprawować nad nimi kontrolę imitując interakcję użytkownika.
64
65 %package -n python3-%{module}
66 Summary:        Pure Python Expect-like module
67 Summary(pl.UTF-8):      Moduł podobny do narzędzia Expect napisany w czystym Pythonie
68 Group:          Development/Languages/Python
69 Requires:       python3-modules >= 1:3.2
70
71 %description -n python3-%{module}
72 Pexpect is a pure Python module for spawning child applications;
73 controlling them; and responding to expected patterns in their output.
74 Pexpect works like Don Libes' Expect. Pexpect allows your script to
75 spawn a child application and control it as if a human were typing
76 commands.
77
78 %description -n python3-%{module} -l pl.UTF-8
79 Pexpect jest modułem napisanym wyłącznie w Pythonie przeznaczonym do
80 uruchamiania aplikacji i kontroli nad nimi poprzez reagowanie na
81 znalezione wzorce na ich wyjściu. Pexpect działa podobnie do Expecta
82 Dona Libesa - pozwala skryptom z ich poziomu uruchomić inne programy i
83 sprawować nad nimi kontrolę imitując interakcję użytkownika.
84
85 %package apidocs
86 Summary:        Documentation for Python pexpect module
87 Summary(pl.UTF-8):      Dokumentacja do modułu Pythona pexpect
88 Group:          Documentation
89
90 %description apidocs
91 Documentation for Python pexpect module.
92
93 %description apidocs -l pl.UTF-8
94 Dokumentacja do modułu Pythona pexpect.
95
96 %prep
97 %setup -q -n %{module}-%{version}
98 %patch0 -p1
99 %patch1 -p1
100
101 %build
102 %if %{with python2}
103 %py_build
104
105 %if %{with tests}
106 # FSM test fails with python 2 because of redirected output(?)
107 LC_ALL=C.UTF-8 \
108 %{__python} -m pytest -k 'not test_run_fsm' tests
109 %endif
110 %endif
111
112 %if %{with python3}
113 %py3_build
114
115 %if %{with tests}
116 LC_ALL=C.UTF-8 \
117 %{__python3} -m pytest tests
118 %endif
119 %endif
120
121 %if %{with doc}
122 %{__make} -C doc html
123 %endif
124
125 %install
126 rm -rf $RPM_BUILD_ROOT
127
128 %if %{with python2}
129 %py_install
130
131 %py_postclean
132
133 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/pexpect/bashrc.sh
134
135 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
136 cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
137 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
138 %{__sed} -i -e '1s,/usr/bin/python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/cgishell.cgi
139 %{__sed} -i -e '2s,/usr/bin/env python,,' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/cgishell.cgi
140 %endif
141
142 %if %{with python3}
143 %py3_install
144
145 %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/pexpect/bashrc.sh
146
147 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
148 cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
149 %{__sed} -i -e '1s,/usr/bin/env python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/*.py
150 %{__sed} -i -e '1s,/usr/bin/python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/cgishell.cgi
151 %{__sed} -i -e '2s,/usr/bin/env python,,' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/cgishell.cgi
152 %endif
153
154 %clean
155 rm -rf $RPM_BUILD_ROOT
156
157 %if %{with python2}
158 %files
159 %defattr(644,root,root,755)
160 %doc LICENSE README.rst
161 %{py_sitescriptdir}/pexpect
162 %{py_sitescriptdir}/pexpect-%{version}-py*.egg-info
163 %{_examplesdir}/%{name}-%{version}
164 %endif
165
166 %if %{with python3}
167 %files -n python3-%{module}
168 %defattr(644,root,root,755)
169 %doc LICENSE README.rst
170 %{py3_sitescriptdir}/pexpect
171 %{py3_sitescriptdir}/pexpect-%{version}-py*.egg-info
172 %{_examplesdir}/python3-%{module}-%{version}
173 %endif
174
175 %if %{with doc}
176 %files apidocs
177 %defattr(644,root,root,755)
178 %doc doc/_build/html/{_static,api,*.html,*.js}
179 %endif
This page took 0.061663 seconds and 3 git commands to generate.