source: chapter08/expect.xml@ e7eaa1e

xry111/loongarch xry111/loongarch-12.2
Last change on this file since e7eaa1e was 479d3bc, checked in by Xi Ruoyao <xry111@…>, 7 weeks ago

Merge remote-tracking branch 'origin/trunk' into xry111/loongarch

  • Property mode set to 100644
File size: 5.7 KB
RevLine 
[7152faa]1<?xml version="1.0" encoding="UTF-8"?>
[fcc02767]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
[593b439a]8<sect1 id="ch-system-expect" role="wrap">
[fcc02767]9 <?dbhtml filename="expect.html"?>
10
11 <sect1info condition="script">
12 <productname>expect</productname>
13 <productnumber>&expect-version;</productnumber>
14 <address>&expect-url;</address>
15 </sect1info>
16
17 <title>Expect-&expect-version;</title>
18
[593b439a]19 <indexterm zone="ch-system-expect">
[fcc02767]20 <primary sortas="a-Expect">Expect</primary>
21 </indexterm>
22
23 <sect2 role="package">
24 <title/>
25
26 <para>The <application>Expect</application> package contains tools for
27 automating, via scripted dialogues, interactive applications such as
28 <command>telnet</command>, <command>ftp</command>,
29 <command>passwd</command>, <command>fsck</command>,
30 <command>rlogin</command>, and <command>tip</command>.
31 <application>Expect</application> is also useful for testing these same
32 applications as well as easing all sorts of tasks that are prohibitively
33 difficult with anything else. The <application>DejaGnu</application>
34 framework is written in <application>Expect</application>.</para>
35
36 <segmentedlist>
37 <segtitle>&buildtime;</segtitle>
38 <segtitle>&diskspace;</segtitle>
39
40 <seglistitem>
[fb386e0]41 <seg>&expect-tmp-sbu;</seg>
42 <seg>&expect-tmp-du;</seg>
[fcc02767]43 </seglistitem>
44 </segmentedlist>
45
46 </sect2>
47
48 <sect2 role="installation">
49 <title>Installation of Expect</title>
50
[1fde756b]51 <para>Expect needs PTYs to work. Verify that the PTYs are working
52 properly inside the chroot environment by performing a simple
53 test:</para>
54
55<screen><userinput remap="test">python3 -c 'from pty import spawn; spawn(["echo", "ok"])'</userinput></screen>
56
57 <para>This command should output <computeroutput>ok</computeroutput>.
58 If, instead, the output includes <computeroutput>OSError: out of pty
59 devices</computeroutput>, then the environment is not set up for proper
60 PTY operation. You need to exit from the chroot environment, read
61 <xref linkend='ch-tools-kernfs'/> again, and ensure the
62 <systemitem class="filesystem">devpts</systemitem> file system (and
63 other virtual kernel file systems) mounted correctly. Then reenter
64 the chroot environment following <xref linkend='ch-tools-chroot'/>.
65 This issue needs to be resolved before continuing, or the test suites
[e67d996]66 requiring Expect (for example the test suites of Bash, Binutils, GCC,
[1fde756b]67 GDBM, and of course Expect itself) will fail catastrophically, and other
68 subtle breakages may also happen.</para>
69
[f272b23]70 &update-config-text;
71
72<screen><userinput remap="pre">tar -C tclconfig &update-config-arg;</userinput></screen>
73
[340e17a]74 <para>Now, make some changes to allow the package with gcc-14.1 or later:</para>
75
76<screen><userinput remap="pre">patch -Np1 -i ../expect-&expect-version;-gcc14-1.patch</userinput></screen>
77
[fcc02767]78 <para>Prepare Expect for compilation:</para>
79
[595ff03]80<screen><userinput remap="configure">./configure --prefix=/usr \
[fcc02767]81 --with-tcl=/usr/lib \
82 --enable-shared \
[4ef406e2]83 --disable-rpath \
[fcc02767]84 --mandir=/usr/share/man \
85 --with-tclinclude=/usr/include</userinput></screen>
86
87 <variablelist>
88 <title>The meaning of the configure options:</title>
89
90 <varlistentry>
91 <term><parameter>--with-tcl=/usr/lib</parameter></term>
92 <listitem>
[d672ab7]93 <para>This parameter is needed to tell
[fcc02767]94 <command>configure</command> where the
[aefc822]95 <command>tclConfig.sh</command> script is located.</para>
[fcc02767]96 </listitem>
97 </varlistentry>
98
99 <varlistentry>
100 <term><parameter>--with-tclinclude=/usr/include</parameter></term>
101 <listitem>
102 <para>This explicitly tells Expect where to find Tcl's internal
[aefc822]103 headers.</para>
[fcc02767]104 </listitem>
105 </varlistentry>
106
107 </variablelist>
108
109 <para>Build the package:</para>
110
111<screen><userinput remap="make">make</userinput></screen>
112
[28e610db]113 <para>To test the results, issue:</para>
114
115<screen><userinput remap="test">make test</userinput></screen>
116
[fcc02767]117 <para>Install the package:</para>
118
119<screen><userinput remap="install">make install
120ln -svf expect&expect-version;/libexpect&expect-version;.so /usr/lib</userinput></screen>
121
122 </sect2>
123
124 <sect2 id="contents-expect" role="content">
125 <title>Contents of Expect</title>
126
127 <segmentedlist>
128 <segtitle>Installed program</segtitle>
129 <segtitle>Installed library</segtitle>
130
131 <seglistitem>
132 <seg>expect</seg>
[85d9756b]133 <seg>libexpect&expect-version;.so</seg>
[fcc02767]134 </seglistitem>
135 </segmentedlist>
136
137 <variablelist>
138 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
139 <?dbfo list-presentation="list"?>
140 <?dbhtml list-presentation="table"?>
141
142 <varlistentry id="expect">
143 <term><command>expect</command></term>
144 <listitem>
145 <para>Communicates with other interactive programs according
146 to a script</para>
[593b439a]147 <indexterm zone="ch-system-expect expect">
[fcc02767]148 <primary sortas="b-expect">expect</primary>
149 </indexterm>
150 </listitem>
151 </varlistentry>
152
153 <varlistentry id="libexpect">
[85d9756b]154 <term><filename class="libraryfile">libexpect-&expect-version;.so</filename></term>
[fcc02767]155 <listitem>
156 <para>Contains functions that allow Expect to be used as a Tcl
157 extension or to be used directly from C or C++ (without Tcl)</para>
[593b439a]158 <indexterm zone="ch-system-expect libexpect">
[85d9756b]159 <primary sortas="c-libexpect-&expect-version;">libexpect-&expect-version;</primary>
[fcc02767]160 </indexterm>
161 </listitem>
162 </varlistentry>
163
164 </variablelist>
165
166 </sect2>
167
168</sect1>
Note: See TracBrowser for help on using the repository browser.