]>
Commit | Line | Data |
---|---|---|
3588c653 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
636b1ea3 | 4 | %bcond_with tests # unit tests [require ptys support, so not on builders] |
3588c653 JB |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | Summary: Run a subprocess in a pseudo terminal | |
9 | Summary(pl.UTF-8): Uruchamianie podprocesu w pseudoterminalu | |
10 | Name: python-ptyprocess | |
2f2f805b | 11 | Version: 0.7.0 |
2da88e82 | 12 | Release: 4 |
3588c653 JB |
13 | License: ISC |
14 | Group: Libraries/Python | |
de132d64 JB |
15 | #Source0Download: https://pypi.org/simple/ptyprocess/ |
16 | Source0: https://files.pythonhosted.org/packages/source/p/ptyprocess/ptyprocess-%{version}.tar.gz | |
2f2f805b | 17 | # Source0-md5: 9da200c397cb1752209a6b718b6cfc68 |
3588c653 JB |
18 | URL: https://github.com/pexpect/ptyprocess |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules >= 1:2.7 | |
21 | %endif | |
22 | %if %{with python3} | |
23 | BuildRequires: python3-modules >= 1:3.2 | |
24 | %endif | |
25 | %{?with_doc:BuildRequires: sphinx-pdg} | |
26 | BuildRequires: rpm-pythonprov | |
27 | BuildRequires: rpmbuild(macros) >= 1.714 | |
28 | Requires: python-modules >= 1:2.7 | |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | Python 2 module to launch a subprocess in a pseudo terminal (pty), and | |
34 | interact with both the process and its pty. | |
35 | ||
36 | Sometimes, piping stdin and stdout is not enough. There might be a | |
37 | password prompt that doesn't read from stdin, output that changes when | |
38 | it's going to a pipe rather than a terminal, or curses-style | |
39 | interfaces that rely on a terminal. If you need to automate these | |
40 | things, running the process in a pseudo terminal (pty) is the answer. | |
41 | ||
42 | %description -l pl.UTF-8 | |
43 | Moduł Pythona 2 do uruchamiania podprocesu w pseudoterminalu (pty) i | |
44 | interakcji zarówno z procesem, jak i jego terminalem. | |
45 | ||
46 | Czasem przekazywanie stdin i stdout przez potoki nie wystarcza. Może | |
47 | tak być w przypadku zapytania o hasło nie czytającego ze standardowego | |
48 | wejścia, a i wyjście czasem się zmienia, jeśli jest potokiem, a nie | |
49 | terminalem, lub interfejsem w stylu curses zależnym od terminala. | |
50 | Aby zautomatyzować takie sytuacje, rozwiązaniem jest uruchomienie | |
51 | procesu w pseudoterminalu (pty). | |
52 | ||
53 | %package -n python3-ptyprocess | |
54 | Summary: Run a subprocess in a pseudo terminal | |
55 | Summary(pl.UTF-8): Uruchamianie podprocesu w pseudoterminalu | |
56 | Group: Libraries/Python | |
57 | Requires: python3-modules >= 1:3.2 | |
58 | ||
59 | %description -n python3-ptyprocess | |
60 | Python 3 module to launch a subprocess in a pseudo terminal (pty), and | |
61 | interact with both the process and its pty. | |
62 | ||
63 | Sometimes, piping stdin and stdout is not enough. There might be a | |
64 | password prompt that doesn't read from stdin, output that changes when | |
65 | it's going to a pipe rather than a terminal, or curses-style | |
66 | interfaces that rely on a terminal. If you need to automate these | |
67 | things, running the process in a pseudo terminal (pty) is the answer. | |
68 | ||
69 | %description -n python3-ptyprocess -l pl.UTF-8 | |
70 | Moduł Pythona 3 do uruchamiania podprocesu w pseudoterminalu (pty) i | |
71 | interakcji zarówno z procesem, jak i jego terminalem. | |
72 | ||
73 | Czasem przekazywanie stdin i stdout przez potoki nie wystarcza. Może | |
74 | tak być w przypadku zapytania o hasło nie czytającego ze standardowego | |
75 | wejścia, a i wyjście czasem się zmienia, jeśli jest potokiem, a nie | |
76 | terminalem, lub interfejsem w stylu curses zależnym od terminala. | |
77 | Aby zautomatyzować takie sytuacje, rozwiązaniem jest uruchomienie | |
78 | procesu w pseudoterminalu (pty). | |
79 | ||
80 | %package apidocs | |
81 | Summary: ptyprocess API documentation | |
82 | Summary(pl.UTF-8): Dokumentacja API ptyprocess | |
83 | Group: Documentation | |
84 | ||
85 | %description apidocs | |
86 | API documentation for ptyprocess. | |
87 | ||
88 | %description apidocs -l pl.UTF-8 | |
89 | Dokumentacja API ptyprocess. | |
90 | ||
91 | %prep | |
92 | %setup -q -n ptyprocess-%{version} | |
93 | ||
94 | %build | |
95 | %if %{with python2} | |
96 | %py_build | |
97 | ||
98 | %{?with_tests:%{__python} -m unittest discover -s tests} | |
99 | %endif | |
100 | ||
101 | %if %{with python3} | |
102 | %py3_build | |
103 | ||
104 | %{?with_tests:%{__python3} -m unittest discover -s tests} | |
105 | %endif | |
106 | ||
107 | %if %{with doc} | |
108 | PYTHONPATH=$(pwd) \ | |
109 | %{__make} -C docs html | |
110 | %endif | |
111 | ||
112 | %install | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | ||
115 | %if %{with python2} | |
116 | %py_install | |
117 | ||
118 | %py_postclean | |
119 | %endif | |
120 | ||
121 | %if %{with python3} | |
122 | %py3_install | |
123 | %endif | |
124 | ||
125 | %clean | |
126 | rm -rf $RPM_BUILD_ROOT | |
127 | ||
128 | %if %{with python2} | |
129 | %files | |
130 | %defattr(644,root,root,755) | |
131 | %doc LICENSE README.rst | |
132 | %{py_sitescriptdir}/ptyprocess | |
133 | %{py_sitescriptdir}/ptyprocess-%{version}-py*.egg-info | |
134 | %endif | |
135 | ||
136 | %if %{with python3} | |
137 | %files -n python3-ptyprocess | |
138 | %defattr(644,root,root,755) | |
139 | %doc LICENSE README.rst | |
140 | %{py3_sitescriptdir}/ptyprocess | |
141 | %{py3_sitescriptdir}/ptyprocess-%{version}-py*.egg-info | |
142 | %endif | |
143 | ||
144 | %if %{with doc} | |
145 | %files apidocs | |
146 | %defattr(644,root,root,755) | |
147 | %doc docs/_build/html/{_images,_static,*.html,*.js} | |
148 | %endif |