Compiling and installing the software
This file documents the procedure for compiling and installing the
HP OfficeJet Linux driver (hpoj) package.
In case of difficulty
If something goes wrong with these instructions, then refer to the separate
build details and troubleshooting
document for more information.
Checking for other necessary software
Before compiling and installing the hpoj software, make sure the following
prerequisite commands and packages are already installed on your system.
The indented commands are possible ways to check for their existence, but
you may need to make adjustments depending on your system.
Required:
Optional:
Needed only to enable specific functionality. If you're compiling hpoj from
source, the ./configure script performs its own checks for some
(but not all) of these items and disables features which depend on packages
that aren't installed.
- For USB support:
an appropriate kernel version.
uname -a
- For full JetDirect (network-connect) support:
an SNMP library, such as the ucd-snmp package.
NET-SNMP version 5 is not currently supported, but older versions should work.
ldconfig -p | grep libsnmp # For Linux
ldconfig -r | grep libsnmp # For FreeBSD
If building hpoj from source:
also the SNMP library header files, which might be in a separate package
such as ucd-snmp-devel. In addition, if your SNMP library was
built with OpenSSL support, then you may need to ensure that the OpenSSL
development libraries are installed, which might be in a separate package
such as openssl-devel. Look for a library symlink with the name
libcrypto.so:
ldconfig -p | grep libcrypto # For Linux
ldconfig -r | grep libcrypto # For FreeBSD
- For the best print quality on most PCL-only (non-PostScript)
models:
hpijs and
ghostscript.
hpijs -h
gs -h
(Due to the complexity of manually installing or upgrading
hpijs,
you might want to consider installing a
distribution
that includes it already.)
- For scanning support:
SANE (sane-backends and
one or more SANE frontend packages, such as sane-frontends or
xsane).
which scanimage
which xscanimage
which xsane
- For photo-card support:
mtools.
which mdir
which mcopy
- For xojpanel support:
a recent version of the QT library.
ldconfig -p | grep libqt # For Linux
ldconfig -r | grep libqt # For FreeBSD
If building hpoj from source:
also the QT header files and meta-object compiler ("which moc"),
which might be in a separate package such as qt-devel.
Checking for and uninstalling an old hpoj version
Special care must be taken if some version of hpoj is already installed
on your system and you want to upgrade it to the latest version.
Some versions of some
distributions provide pre-compiled hpoj packages, but possibly for an
older hpoj version. Or you may have previously installed an older hpoj
version that you built from source or got as a pre-compiled package from
somewhere else.
Try the following commands to determine if a version of hpoj is already
installed on your system:
which ptal-connect
/sbin/ldconfig -p | grep ptal # For Linux
/sbin/ldconfig -r | grep ptal # For FreeBSD
If hpoj is not already installed as indicated by the above commands,
then you can skip to the next section to install it for the first time.
Check the list of
known distribution versions that provide hpoj packages for the package
name(s) that you should look for on your system. For example, on an
RPM-based distribution you might be able to use commands such as the
following:
rpm -qa | grep hpoj
rpm -qa | grep ptal
Or on an APT-based distribution such as Debian:
dpkg -l|grep hpoj
If the desired components of the desired (current) version are already
installed on your system, then you can likely skip to the next step of
setting up basic device connectivity.
Important: If an old hpoj version is already installed, then
be sure to do one of the following to prevent subsequent problems:
- Completely un-install all hpoj-related packages. RPM users
may need to use the --force option if rpm complains
about a SANE dependency. Refer to your distribution's documentation
for package removal instructions.
- If building hpoj from source, then install the new version on top of the
old copy using the same installation path prefix. If for example the commands
above found /usr/bin/ptal-connect and/or /usr/lib/libptal.so,
then pass the "--prefix=/usr" option to the ./configure
script below.
- Upgrade to a newer precompiled hpoj package set from your distribution
vendor instead of compiling hpoj from source.
Installing the new hpoj version
Installing from pre-compiled package(s)
The hpoj project does not provide pre-compiled packages, but
your distribution
vendor may provide them. Refer to your distribution's documentation
for package installation instructions. Be careful about attempting to
install packages that were built for a different distribution or version.
You might be able to work around some binary package installation problems
by rebuilding new binary packages from the source package provided by your
vendor (which they are required to do by the
GNU General Public
License (GPL)).
Compiling hpoj from source
The latest stable hpoj version is available from the hpoj
Download page.
If you haven't already, issue one of the following commands to extract
the source code from the hpoj-0.XX.tgz "tarball" file (the
exact name depends on the version):
tar xvfz hpoj-0.XX.tgz # For GNU tar
zcat hpoj-0.XX.tgz | tar xvf - # For non-GNU tar
cd into the source-code directory that was created and
enter the following commands at the shell prompt:
./configure
make # Use "gmake" instead for FreeBSD.
su # When prompted, enter the root password.
make install
By default, the hpoj software is installed under /usr/local,
and the HTML documentation you're reading right now is installed under
/usr/local/share/doc/hpoj (a different documentation path from
version 0.8).
Important: Watch the "make install" step above closely for
any error messages that might indicate problems in automatically performing
certain operations. If you see any such error messages, then refer to the
Post-installation steps section,
especially if any error messages appear about "setting ptal-init to
start at bootup".
Caution: If ptal-init does
not get started before the print spooler at boot time, then you run the
risk of hanging your boot sequence.
In case of difficulty
If something goes wrong with these instructions, then refer to the separate
build details and troubleshooting
document for more information.
Next steps
Now you're ready to set up basic device
connectivity.