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