Compiling and installing the software

This file documents the procedure for compiling and installing the HP OfficeJet Linux driver (hpoj) software.

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.

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 below 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
	rpm -qa | grep -i officejet
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:

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		# Watch closely for missing dependencies.
	make			# Use "gmake" instead for FreeBSD.
	su                      # When prompted, enter the root password.
	make install		# Watch closely for post-installation steps.
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). If on the other hand your copy of hpoj is installed under /usr, then you can find the documentation under /usr/share/doc/hpoj. (However, if you're using a precompiled hpoj package from a distribution vendor, the downstream package maintainer may have elected to place the documentation files somewhere else.)

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.

Finally, you may need to log out and back in again to make changes to the PATH environment variable take effect.

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.