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