<?xml version="1.0" encoding="ISO-8859-1"?>
<!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 gparted-download-http
           "&sourceforge-repo;/gparted/gparted-&gparted-version;.tar.bz2">
  <!ENTITY gparted-download-ftp  " ">
  <!ENTITY gparted-md5sum        "c9618b2eba00e3f081d3f40e8a6029e2">
  <!ENTITY gparted-size          "2.0 MB">
  <!ENTITY gparted-buildsize     "93 MB (additional 4 MB, building the optional documentation)">
  <!ENTITY gparted-time          "0.9 SBU (additional 0.1 SBU, building the optional documentation)">
]>

<sect1 id="gparted" xreflabel="Gparted-&gparted-version;">
  <?dbhtml filename="gparted.html"?>

  <sect1info>
    <othername>$LastChangedBy: bdubbs $</othername>
    <date>$Date: 2015-03-02 22:42:44 -0500 (Mon, 02 Mar 2015) $</date>
  </sect1info>

  <title>Gparted-&gparted-version;</title>

  <indexterm zone="gparted">
    <primary sortas="a-Gparted">Gparted</primary>
  </indexterm>

  <sect2 role="package">
    <title>Introduction to Gparted</title>

    <para>
      Gparted is the Gnome Partition Editor, a Gtk 2 GUI for other command line
      tools that can create, reorganise or delete disk partitions.
    </para>

    &lfs77_checked;

    <bridgehead renderas="sect3">Package Information</bridgehead>
    <itemizedlist spacing="compact">
      <listitem>
        <para>
          Download (HTTP): <ulink url="&gparted-download-http;"/>
        </para>
      </listitem>
      <listitem>
        <para>
          Download (FTP): <ulink url="&gparted-download-ftp;"/>
        </para>
      </listitem>
      <listitem>
        <para>
          Download MD5 sum: &gparted-md5sum;
        </para>
      </listitem>
      <listitem>
        <para>
          Download size: &gparted-size;
        </para>
      </listitem>
      <listitem>
        <para>
          Estimated disk space required: &gparted-buildsize;
        </para>
      </listitem>
      <listitem>
        <para>
          Estimated build time: &gparted-time;
        </para>
      </listitem>
    </itemizedlist>

    <bridgehead renderas="sect3">Gparted Dependencies</bridgehead>

    <bridgehead renderas="sect4">Required</bridgehead>
    <para role="required">
      <xref linkend="gtkmm2"/> and
      <xref linkend="parted"/>
    </para>

    <bridgehead renderas="sect4">Optional</bridgehead>
    <para role="optional">
      <ulink url="&gnome-download-http;/gnome-doc-utils/">
      GNOME Doc Utils</ulink> and
      <xref linkend="rarian"/>
    </para>

    <para condition="html" role="usernotes">
      User Notes: <ulink url="&blfs-wiki;/gparted"/>
    </para>
  </sect2>

  <sect2 role="installation">
    <title>Installation of Gparted</title>

    <para>
      Install <application>Gparted</application> by running the following
      commands:
    </para>

<screen><userinput>./configure --prefix=/usr    \
            --disable-doc    \
            --disable-static &amp;&amp;
make</userinput></screen>

    <para>
      This package does not come with a testsuite.
    </para>

    <para>
      Now, as the <systemitem class="username">root</systemitem> user:
    </para>

<screen role="root"><userinput>make install</userinput></screen>

  </sect2>

  <sect2 role="commands">
    <title>Command Explanations</title>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
      href="../../xincludes/static-libraries.xml"/>

    <para>
      <option>--disable-doc</option>: This switch disables building of
      the optional documentation. Remove it if you have installed
      <application>GNOME Doc Utils</application>.
    </para>

  </sect2>

  <sect2 role="using">
    <title>Using Gparted</title>

    <para>
      To manipulate file systems Gparted has a run time dependency on various
      file system tools (you only need to install the tools for file systems you
      actually use):
      e2fsprogs (installed as part of LFS),
      <xref linkend="jfsutils"/>,
      <xref linkend="ntfs-3g"/>,
      <xref linkend="reiserfs"/>,
      <xref linkend="xfsprogs"/>,
      <ulink url="https://btrfs.wiki.kernel.org/index.php/Btrfs_source_repositories">
        btrfs-progs</ulink>,
      <ulink url="http://www.daniel-baumann.ch/software/dosfstools/">dosfstools</ulink>,
      <ulink url="http://ftp.gnu.org/pub/gnu/mtools/">mtools</ulink> (required
      to read and write FAT16/32 volume labels and UUIDs),
      <ulink url="ftp://ftp.mars.org/pub/hfs/">hfsutils</ulink>,
      hfsprogs,
      <ulink url="http://www.nilfs.org/download/">nilfs-utils</ulink> and
      reiser4progs.
    </para>

    <para>
      Root privileges are required to run Gparted. If you wish to run the
      application from the menu, further applications and configurations are
      necessary. Examples of applications that may be used:
      <ulink url="http://people.debian.org/~kov/gksu">gksu</ulink>,
      <ulink url="https://launchpad.net/kdesudo">kdesudo</ulink>, or
      <ulink url="https://github.com/tarakbumba/xdg-su">xdg-su</ulink>.
      Other solution is to use <application>pkexec</application>, from
      <xref linkend="polkit"/>, but some configuration is necessary.
      Another simple solution is <xref linkend="ssh-askpass"/>. Below, we
      describe these two alternatives: "ssh-askpass" and "pkexec".
    </para>

    <sect3 role="ssh-askpass">
      <title>ssh-askpass</title>
        <para>
          To optionally use <xref linkend="ssh-askpass"/> if it is installed in
          your system, run the following commands as the
          <systemitem class="username">root</systemitem> user:
        </para>

<screen role="root"><userinput>cp -v /usr/share/applications/gparted.desktop /usr/share/applications/gparted.desktop.back &amp;&amp;
sed -i 's/Exec=/Exec=sudo -A /'               /usr/share/applications/gparted.desktop      &amp;&amp;</userinput></screen>

        <para>
         Now, clicking in the menu item for Gparted, a dialog appears in the
         screen, asking for the administrator password.</para>

    </sect3>

    <sect3 role="pkexec">
      <title>pkexec</title>
        <para>
          To optionally use <application>pkexec</application>, you need <xref
          linkend="polkit-gnome"/><!-- or <xref linkend="lxpolkit"/>-->, and
          <xref linkend="consolekit"/> installed with support to <xref
          linkend="linux-pam"/> and <xref linkend="polkit"/>. As the
          <systemitem class="username">root</systemitem> user, configure <xref
          linkend="gparted"/> and <xref linkend="polkit"/> with the following
          commands:
        </para>

<screen role="root"><userinput>cp -v /usr/share/applications/gparted.desktop \
                                     /usr/share/applications/gparted.desktop.back &amp;&amp;
sed -i 's:/usr/sbin/gparted:/usr/sbin/gparted_polkit:' \
                                     /usr/share/applications/gparted.desktop      &amp;&amp;

cat &gt; /usr/sbin/gparted_polkit &lt;&lt; "EOF" &amp;&amp;
<literal>#!/bin/bash

pkexec /usr/sbin/gparted $@</literal>
EOF
chmod -v 0755 /usr/sbin/gparted_polkit</userinput></screen>

        <para>
          Still as the <systemitem class="username">root</systemitem> user,
          configure <xref linkend="polkit"/> and <xref linkend="gparted"/> to
          use <application>pkexec</application>:
        </para>

<screen role="root"><userinput>cat &gt; /usr/share/polkit-1/actions/org.gnome.gparted.policy &lt;&lt; "EOF"
<literal>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd"&gt;
&lt;policyconfig&gt;

  &lt;action id="org.freedesktop.policykit.pkexec.run-gparted"&gt;
    &lt;description&gt;Run GParted&lt;/description&gt;
    &lt;message&gt;Authentication is required to run GParted&lt;/message&gt;
    &lt;defaults&gt;
      &lt;allow_any&gt;no&lt;/allow_any&gt;
      &lt;allow_inactive&gt;no&lt;/allow_inactive&gt;
      &lt;allow_active&gt;auth_admin_keep&lt;/allow_active&gt;
    &lt;/defaults&gt;
    &lt;annotate key="org.freedesktop.policykit.exec.path"&gt;/usr/sbin/gparted&lt;/annotate&gt;
    &lt;annotate key="org.freedesktop.policykit.exec.allow_gui"&gt;true&lt;/annotate&gt;
  &lt;/action&gt;

&lt;/policyconfig&gt;</literal>
EOF
chmod -v 0644 /usr/share/polkit-1/actions/org.gnome.gparted.policy</userinput></screen>

        <para>
         Now, clicking in the menu item for Gparted, a dialog appears in the
         screen, asking for the administrator password.</para>

    </sect3>

  </sect2>

  <sect2 role="content">
    <title>Contents</title>

    <segmentedlist>
      <segtitle>Installed Programs</segtitle>
      <segtitle>Installed Libraries</segtitle>
      <segtitle>Installed Directories</segtitle>

      <seglistitem>
        <seg>
          gparted, gpartedbin and gparted_polkit (optional)
        </seg>
        <seg>
          None
        </seg>
        <seg>
          /usr/share/gnome/help/gparted and
          /usr/share/omf/gparted
        </seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="gparted-prog">
        <term><command>gparted</command></term>
        <listitem>
          <para>
            is a shell script which sets up the environment before calling
            <command>gpartedbin</command>.
          </para>
          <indexterm zone="gparted gparted-prog">
            <primary sortas="b-gparted">gparted</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="gpartedbin">
        <term><command>gpartedbin</command></term>
        <listitem>
          <para>
            is the Gparted binary.
          </para>
          <indexterm zone="gparted gpartedbin">
            <primary sortas="b-gpartedbin">gpartedbin</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="gparted_polkit">
        <term><command>gparted_polkit</command></term>
        <listitem>
          <para>
            is an optional script which can be used to run gparted with polkit,
            from a menu.
          </para>
          <indexterm zone="gparted gparted_polkit">
            <primary sortas="b-gparted_polkit">gparted_polkit</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
