<?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;
]>

<sect1 id="ch-system-attr" role="wrap">
  <?dbhtml filename="attr.html"?>

  <sect1info condition="script">
    <productname>attr</productname>
    <productnumber>&attr-version;</productnumber>
    <address>&attr-url;</address>
  </sect1info>

  <title>Attr-&attr-version;</title>

  <indexterm zone="ch-system-attr">
    <primary sortas="a-Attr">Attr</primary>
  </indexterm>

  <sect2 role="package">
    <title/>

    <para>Attr 软件包包含管理文件系统对象扩展属性的工具。</para>

    <segmentedlist>
      <segtitle>&buildtime;</segtitle>
      <segtitle>&diskspace;</segtitle>

      <seglistitem>
        <seg>&attr-ch6-sbu;</seg>
        <seg>&attr-ch6-du;</seg>
      </seglistitem>
    </segmentedlist>

  </sect2>

  <sect2 role="installation">
    <title>安装 Attr</title>

    <para>准备安装 Attr：</para>

<screen revision="sysv"><userinput remap="configure">./configure --prefix=/usr     \
            --bindir=/bin     \
            --disable-static  \
            --sysconfdir=/etc \
            --docdir=/usr/share/doc/attr-&attr-version;</userinput></screen>
 
<screen revision="systemd"><userinput remap="configure">./configure --prefix=/usr     \
            --disable-static  \
            --sysconfdir=/etc \
            --docdir=/usr/share/doc/attr-&attr-version;</userinput></screen>
 
    <para>编译该软件包：</para>

<screen><userinput remap="make">make</userinput></screen>

    <para>测试套件必须在支持扩展属性的文件系统，如 ext2、ext3 或 ext4
		上运行。运行下列命令以测试编译结果：</para>

<screen><userinput remap="test">make check</userinput></screen>

    <para>安装该软件包：</para>

<screen><userinput remap="install">make install</userinput></screen>

    <para>需要将共享库移动到
    <filename class="directory">/lib</filename> 目录，因此
    <filename class="directory">/usr/lib</filename> 中的
    <filename class="extension">.so</filename> 符号链接也需要重新建立：
    </para>

<screen><userinput remap="install">mv -v /usr/lib/libattr.so.* /lib
ln -sfv ../../lib/$(readlink /usr/lib/libattr.so) /usr/lib/libattr.so</userinput></screen>

  </sect2>

  <sect2 id="contents-attr" role="content">
    <title>Attr 的内容</title>

    <segmentedlist>
      <segtitle>安装的程序</segtitle>
      <segtitle>安装的库</segtitle>
      <segtitle>安装的目录</segtitle>

      <seglistitem>
        <seg>attr, getfattr, 以及 setattr</seg>
        <seg>libattr.so</seg>
        <seg>/usr/include/attr 和 /usr/share/doc/attr-&attr-version;</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">简要描述</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="attr">
        <term><command>attr</command></term>
        <listitem>
          <para>在文件系统对象上扩展属性</para>
          <indexterm zone="ch-system-attr attr">
            <primary sortas="b-attr">attr</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="getfattr">
        <term><command>getfattr</command></term>
        <listitem>
          <para>查询文件系统对象的扩展属性</para>
          <indexterm zone="ch-system-attr getfattr">
            <primary sortas="b-getfattr">getfattr</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="setattr">
        <term><command>setattr</command></term>
        <listitem>
          <para>设定文件系统对象的扩展属性</para>
          <indexterm zone="ch-system-attr setattr">
            <primary sortas="b-setattr">setattr</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libattr">
        <term><filename class="libraryfile">libattr</filename></term>
        <listitem>
          <para>包含处理扩展属性的库函数</para>
          <indexterm zone="ch-system-attr libattr">
            <primary sortas="c-libattr">libattr</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
