glfs/general/genlib/libusb.xml
Dan Nichilson 3e50349d7c Update libusb usb_device rule for linux-2.6.22
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@6999 af4574ff-66df-0310-9fd7-8a98e5e911e0
2007-08-02 13:18:31 +00:00

229 lines
8.4 KiB
XML

<?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 libusb-download-http "http://downloads.sourceforge.net/libusb/libusb-&libusb-version;.tar.gz">
<!ENTITY libusb-download-ftp " ">
<!ENTITY libusb-md5sum "caf182cbc7565dac0fd72155919672e6">
<!ENTITY libusb-size "389 KB">
<!ENTITY libusb-buildsize "8.4 MB (includes installing all documentation)">
<!ENTITY libusb-time "0.3 SBU (includes building all documentation)">
]>
<sect1 id="libusb" xreflabel="libusb-&libusb-version;">
<?dbhtml filename="libusb.html"?>
<sect1info>
<othername>$LastChangedBy$</othername>
<date>$Date$</date>
</sect1info>
<title>libusb-&libusb-version;</title>
<indexterm zone="libusb">
<primary sortas="a-Libusb">Libusb</primary>
</indexterm>
<sect2 role="package">
<title>Introduction to libusb</title>
<para>The <application>libusb</application> package contains a library
used by some applications for USB device access.</para>
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>Download (HTTP): <ulink url="&libusb-download-http;"/></para>
</listitem>
<listitem>
<para>Download (FTP): <ulink url="&libusb-download-ftp;"/></para>
</listitem>
<listitem>
<para>Download MD5 sum: &libusb-md5sum;</para>
</listitem>
<listitem>
<para>Download size: &libusb-size;</para>
</listitem>
<listitem>
<para>Estimated disk space required: &libusb-buildsize;</para>
</listitem>
<listitem>
<para>Estimated build time: &libusb-time;</para>
</listitem>
</itemizedlist>
<bridgehead renderas="sect3">libusb Dependencies</bridgehead>
<bridgehead renderas="sect4">Optional</bridgehead>
<para role="optional"><xref linkend="pkgconfig"/></para>
<bridgehead renderas="sect4">Optional
(Required to Build the HTML User Manual)</bridgehead>
<para role="optional"><xref linkend="openjade"/> and
<ulink url="http://www.docbook.org/sgml/4.2/index.html"> DocBOOK SGML
DTD-4.2</ulink></para>
<bridgehead renderas="sect4">Optional
(Required to Build the API Documentation)</bridgehead>
<para role="optional"><xref linkend="doxygen"/> and
<xref linkend="graphviz"/></para>
<para condition="html" role="usernotes">User Notes:
<ulink url="&blfs-wiki;/libusb"/></para>
</sect2>
<sect2 role="installation">
<title>Installation of libusb</title>
<para>Install <application>libusb</application> by running the following
commands:</para>
<screen><userinput>./configure --prefix=/usr --disable-build-docs &amp;&amp;
make</userinput></screen>
<para>If you wish to build the API documentation (see the required
dependencies), issue the following command:</para>
<screen><userinput>make apidox</userinput></screen>
<para>To test the results, issue <command>make -k check</command>.</para>
<para>Now, as the <systemitem class="username">root</systemitem> user:</para>
<screen role="root"><userinput>make install</userinput></screen>
<para>If you built the HTML user manual (by having the required
dependencies installed and removing the
<parameter>--disable-build-docs</parameter> parameter from the
<command>configure</command> command), install it using the following
commands as the <systemitem class="username">root</systemitem> user:</para>
<screen role="root"><userinput>install -v -d -m755 /usr/share/doc/libusb-&libusb-version;/html &amp;&amp;
install -v -m644 doc/html/* /usr/share/doc/libusb-&libusb-version;/html</userinput></screen>
<para>If you built the API documentation, install it using the following
commands as the <systemitem class="username">root</systemitem> user:</para>
<screen role="root"><userinput>install -v -d -m755 /usr/share/doc/libusb-&libusb-version;/apidocs &amp;&amp;
install -v -m644 apidocs/html/* \
/usr/share/doc/libusb-&libusb-version;/apidocs</userinput></screen>
</sect2>
<sect2 role="commands">
<title>Command Explanations</title>
<para><parameter>--disable-build-docs</parameter>: This switch avoids
building the HTML user manual. Remove it if you have the required
dependencies installed and wish to build the manual.</para>
</sect2>
<sect2 role="configuration">
<title>Configuring Libusb</title>
<!--
<para><application>libusb</application> requires the
<systemitem class="filesystem">usbfs</systemitem> kernel filesystem
to be mounted on <filename class="directory">/proc/bus/usb</filename>.
Applications require the files in this directory to be accessible to the user,
sometimes for both reading and writing. To restrict access to USB devices,
ensure the <systemitem class="filesystem">usb</systemitem> group exits
on your system. If necessary, create the <systemitem
class="filesystem">usb</systemitem> group using the following command:</para>
<screen role='root'><userinput>groupadd -g 14 usb</userinput></screen>
-->
<para id="libusb-kernel">To access raw USB devices (those not treated as a
disk by the mass-storage driver), appropriate support must be available in
the kernel. Check your kernel configuration for Device Drivers &rArr; USB
support &rArr; Support for Host-side USB. Select any USB hardware device
drivers you may need on the same page.</para>
<indexterm zone="libusb libusb-kernel">
<primary sortas="d-USB-device-filesystem">Support for Host-side USB</primary>
</indexterm>
<para>To have raw USB devices set up properly, add the following
<application>udev</application> rule and add any users
that need to access raw USB devices to the "usb" group.</para>
<screen><literal>cat &gt; /etc/udev/rules.d/23-usb.rules &lt;&lt; "EOF"
# Set group ownership for raw USB devices
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
EOF</literal></screen>
<!--
<para>Fine-tuning of permissions is also possible by creating extra rules,
matching on something like this (on one line). The vendor and product can
be found by searchng the <filename
class='directory'>/sys/devices</filename> directory entries or using
<command>udevinfo</command> after the device has been attached. See the
documentation in the current udev directory of <filename
class='directory'>/usr/share/doc></filename> for details.</para>
<screen><literal>SUBSYSTEM=="usb_device", SYSFS{idVendor}=="05d8",
SYSFS{idProduct}=="4002", GROUP:="scanner"</literal></screen>
<para>Some older applications, such as <application>VMware</application>,
need the following deprecated entry in the <filename>/etc/fstab</filename>
file. This is not normally needed.</para>
<screen><literal>usbfs /proc/bus/usb usbfs devgid=14,devmode=0660 0 0</literal></screen>
-->
</sect2>
<sect2 role="content">
<title>Contents</title>
<segmentedlist>
<segtitle>Installed Program</segtitle>
<segtitle>Installed Libraries</segtitle>
<segtitle>Installed Directory</segtitle>
<seglistitem>
<seg>libusb-config</seg>
<seg>libusb.{so,a} and libusbpp.{so,a}</seg>
<seg>/usr/share/doc/libusb-&libusb-version;</seg>
</seglistitem>
</segmentedlist>
<variablelist>
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<varlistentry id="libusb-config">
<term><command>libusb-config</command></term>
<listitem>
<para>is a script that provides the right compiler and linker
flags for programs using
<filename class='libraryfile'>libusb</filename>.</para>
<indexterm zone="libusb libusb-config">
<primary sortas="b-libusb-config">libusb-config</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="libusb-lib">
<term><filename class='libraryfile'>libusb.{so,a}</filename></term>
<listitem>
<para> libraries contain C functions for accessing
USB hardware.</para>
<indexterm zone="libusb libusb-lib">
<primary sortas="c-libusb">libusb.{so,a}</primary>
</indexterm>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>