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