glfs/postlfs/shells/zsh.xml
Xi Ruoyao abfacaf80e
Remove most references to PCRE1
Some notes:

- proftpd has been supporting PCRE2 since 1.3.8a.
- bluefish actually invokes PCRE via Glib, so since Glib was ported
  from PCRE1 to PCRE2 bluefish has been using PCRE2 in fact.
- zsh and rasqal will support PCRE2 in the next release.  For zsh pcre
  is not used with book instruction anyway, and for rasqal the
  maintainer suggests just relying on Glibc regex.h before the next
  release.
- The other distros (Fedora for eg) are already disabling PCRE for
  slang.
2024-03-05 22:22:51 +08:00

320 lines
10 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY zsh-download-http "https://www.zsh.org/pub/zsh-&zsh-version;.tar.xz">
<!ENTITY zsh-download-ftp " ">
<!ENTITY zsh-md5sum "182e37ca3fe3fa6a44f69ad462c5c30e">
<!ENTITY zsh-size "3.2 MB">
<!ENTITY zsh-buildsize "48 MB (includes documentation and tests)">
<!ENTITY zsh-time "1.6 SBU (Using parallelism=4; includes documentation and tests)">
]>
<sect1 id="zsh" xreflabel="zsh-&zsh-version;">
<?dbhtml filename="zsh.html"?>
<title>zsh-&zsh-version;</title>
<indexterm zone="zsh">
<primary sortas="a-zsh">zsh</primary>
</indexterm>
<sect2 role="package">
<title>Introduction to zsh</title>
<para>
The <application>zsh</application> package contains a command
interpreter (shell) usable as an interactive login shell and as
a shell script command processor. Of the standard shells,
<application>zsh</application> most closely resembles
<application>ksh</application> but includes many enhancements.
</para>
&lfs121_checked;
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>
Download (HTTP): <ulink url="&zsh-download-http;"/>
</para>
</listitem>
<listitem>
<para>
Download (FTP): <ulink url="&zsh-download-ftp;"/>
</para>
</listitem>
<listitem>
<para>
Download MD5 sum: &zsh-md5sum;
</para>
</listitem>
<listitem>
<para>
Download size: &zsh-size;
</para>
</listitem>
<listitem>
<para>
Estimated disk space required: &zsh-buildsize;
</para>
</listitem>
<listitem>
<para>
Estimated build time: &zsh-time;
</para>
</listitem>
</itemizedlist>
<note>
<para>
When there is a new <application>zsh</application> release, the old
files shown above are moved to a new server directory:
<ulink url="https://www.zsh.org/pub/old/"/>.
</para>
</note>
<bridgehead renderas="sect3">zsh Dependencies</bridgehead>
<bridgehead renderas="sect4">Optional</bridgehead>
<para role="optional">
<!-- <xref linkend="pcre2"/>, The next zsh release will support it -->
<xref linkend="valgrind"/> and
<ulink url='https://fbb-git.gitlab.io/yodl/'>yodl</ulink>
</para>
</sect2>
<sect2 role="installation">
<title>Installation of zsh</title>
<para>
Adapt the documentation build system for texinfo-7.0 or later:
</para>
<screen><userinput>sed -e 's/set_from_init_file/texinfo_&amp;/' \
-i Doc/Makefile.in</userinput></screen>
<para>
The documentation files contain references to zsh configuration
files in <filename class='directory'>/etc</filename>, but we'll
use <filename class='directory'>/etc/zsh</filename> to hold these
configuration files instead. The building system will fix up those
references if the <application>yodl</application> package is
available, but it's out of the scope of BLFS. So we need to fix up
the references manually:
</para>
<screen><userinput>sed 's|/etc/z|/etc/zsh/z|g' -i Doc/*.*</userinput></screen>
<!-- <note>
<para>
Using a script to build with "su -c script" may produce a funny
configure error message: "no controlling tty". If this happens, add
the switch -\-with-tcsetpgrp to configure.
</para>
</note>
-->
<para>
Install <application>zsh</application> by running the following
commands:
</para>
<screen><userinput>./configure --prefix=/usr \
--sysconfdir=/etc/zsh \
--enable-etcdir=/etc/zsh \
--enable-cap \
--enable-gdbm &amp;&amp;
make &amp;&amp;
makeinfo Doc/zsh.texi --html -o Doc/html &amp;&amp;
makeinfo Doc/zsh.texi --plaintext -o zsh.txt &amp;&amp;
makeinfo Doc/zsh.texi --html --no-split --no-headers -o zsh.html</userinput></screen>
<para>
If you have <xref linkend="texlive"/>
installed, you can build PDF format of the documentation by issuing
the following command:
</para>
<screen remap="doc"><userinput>texi2pdf Doc/zsh.texi -o Doc/zsh.pdf</userinput></screen>
<para>
To test the results, issue: <command>make check</command>.
</para>
<para>
Now, as the <systemitem class="username">root</systemitem> user:
</para>
<screen role="root"><userinput>make install &amp;&amp;
make infodir=/usr/share/info install.info &amp;&amp;
make htmldir=/usr/share/doc/zsh-&zsh-version;/html install.html &amp;&amp;
install -v -m644 zsh.{html,txt} Etc/FAQ /usr/share/doc/zsh-&zsh-version;</userinput></screen>
<para>
If you built the PDF format of the documentation, install
it by issuing the following command as the
<systemitem class="username">root</systemitem> user:
</para>
<screen role="root"
remap="doc"><userinput>install -v -m644 Doc/zsh.pdf /usr/share/doc/zsh-&zsh-version;</userinput></screen>
</sect2>
<sect2 role="commands">
<title>Command Explanations</title>
<para>
<parameter>--sysconfdir=/etc/zsh</parameter> and
<parameter>--enable-etcdir=/etc/zsh</parameter>: These parameters are
used so that all the <application>zsh</application> configuration files
are consolidated into the <filename class='directory'>/etc/zsh</filename>
directory. Omit these parameters if you wish to retain historical
compatibility by having all the files located in the
<filename class='directory'>/etc</filename> directory.
</para>
<para>
<parameter>--enable-cap</parameter>: This option enables
POSIX capabilities.
</para>
<para>
<parameter>--enable-gdbm</parameter>: This option enables the
use of the <application>GDBM</application> library.
</para>
<!-- the next zsh release will support it
<para>
<option>- -enable-pcre</option>: This option allows zsh to use
the <application>PCRE2</application> regular expression library in shell
builtins.
</para>
-->
</sect2>
<sect2 role="configuration">
<title>Configuring zsh</title>
<sect3 id="zsh-config">
<title>Config Files</title>
<para>
There are a whole host of configuration files for
<application>zsh</application> including
<filename>/etc/zsh/zshenv</filename>,
<filename>/etc/zsh/zprofile</filename>,
<filename>/etc/zsh/zshrc</filename>,
<filename>/etc/zsh/zlogin</filename> and
<filename>/etc/zsh/zlogout</filename>.
You can find more information on these in the
<ulink role='man' url='&man;zsh.1'>zsh(1)</ulink> and related
manual pages.
</para>
<para>
The first time zsh is executed, you will be prompted by messages asking
several questions. The answers will be used to create a
<filename>~/.zshrc</filename> file. If you wish to run these questions
again, run <command>zsh
/usr/share/zsh/&zsh-version;/functions/zsh-newuser-install -f</command>.
</para>
<para>
There are several built-in advanced prompts. In the
<command>zsh</command> shell, start advanced prompt support with
<command>autoload -U promptinit</command>, then
<command>promptinit</command>. Available prompt names are listed with
<command>prompt -l</command>. Select a particular one with
<command>prompt <literal>&lt;prompt-name&gt;</literal></command>.
Display all available
prompts with <command>prompt -p</command>. Except for the list and
display commands above, you can insert the other ones in
<filename>~/.zshrc</filename> to be automatically executed at
shell start, with the prompt you chose.
</para>
<indexterm zone="zsh zsh-config">
<primary sortas="e-etc-zsh-zshenv">/etc/zsh/zshenv</primary>
</indexterm>
<indexterm zone="zsh zsh-config">
<primary sortas="e-etc-zsh-zprofile">/etc/zsh/zprofile</primary>
</indexterm>
<indexterm zone="zsh zsh-config">
<primary sortas="e-etc-zsh-zshrc">/etc/zsh/zshrc</primary>
</indexterm>
<indexterm zone="zsh zsh-config">
<primary sortas="e-etc-zsh-zlogin">/etc/zsh/zlogin</primary>
</indexterm>
<indexterm zone="zsh zsh-config">
<primary sortas="e-etc-zsh-zlogout">/etc/zsh/zlogout</primary>
</indexterm>
</sect3>
<sect3>
<title>Configuration Information</title>
<para>
Update <filename>/etc/shells</filename> to include the
<application>zsh</application> shell program names (as the
<systemitem class="username">root</systemitem> user):
</para>
<screen role="root"><userinput>cat &gt;&gt; /etc/shells &lt;&lt; "EOF"
<literal>/bin/zsh</literal>
EOF</userinput></screen>
</sect3>
</sect2>
<sect2 role="content">
<title>Contents</title>
<segmentedlist>
<segtitle>Installed Programs</segtitle>
<segtitle>Installed Libraries</segtitle>
<segtitle>Installed Directories</segtitle>
<seglistitem>
<seg>zsh and zsh-&zsh-version; (hardlinked to each other)</seg>
<seg>Numerous plugin helper modules under
/usr/lib/zsh/&zsh-version;/</seg>
<seg>/usr/{lib,share}/zsh and /usr/share/doc/zsh-&zsh-version;</seg>
</seglistitem>
</segmentedlist>
<variablelist>
<bridgehead renderas="sect3">Short Description</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<varlistentry id="zsh-prog">
<term><command>zsh</command></term>
<listitem>
<para>
is a shell which has command-line editing, built-in spelling
correction, programmable command completion, shell functions (with
autoloading), a history mechanism, and a host of other features
</para>
<indexterm zone="zsh zsh-prog">
<primary sortas="b-zsh">zsh</primary>
</indexterm>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>