tar xvfz hpoj-0.X.tgz # For GNU tar zcat hpoj-0.X.tgz | tar xvf - # For non-GNU tarEnter the following commands at the shell prompt:
./configure make su # When prompted, enter the root password. make installBy default, this causes the software to get installed under /usr/local. See the next section if you want to override this or if the configure script has trouble finding other packages it needs.
--prefix=/usr --prefix=/opt/hpojNote that if you use this option, you may need to specify a --with-ptal=DIR option when you configure SANE.
--with-qt=DIR
Helps find the base of the QT tree. The specified directory should
contain include, bin, and lib subdirectories
which contain the corresponding components of QT. Examples:
--with-qt=/opt/qt-2.1.0 --with-qt=/usr/lib/qt-1.45--with-snmp=DIR
--with-snmp=/usr/include/ucd-snmpThe above --with-PACKAGE options may also take the form --without-PACKAGE to disable use of the selected package when it otherwise would have been used. Examples:
--without-snmp --without-qtAdditionally, if you experience compilation problems with ptal-mlcd (the low-level I/O driver), you may give the --without-par or --without-usb switches to disable parallel-port or USB support, respectively. Note that these options prevent only a small amount of code from being compiled, so there's little value in specifying them except as a workaround for build problems.
If you use one of the --without-PACKAGE switches, or if the corresponding package can't be found, then the rest of the hpoj package should still build, minus the parts that depend on the missing functionality.
"make install" invoked as root looks for the directory /etc/profile.d and adds the scripts hpoj.sh and hpoj.csh to this directory if it exists. These scripts add to the PATH environment variable the bin and sbin directories into which the hpoj software was installed. You'll need to log out and back in again for the new PATH to take effect. If for whatever reason these scripts couldn't be added, then enter the following command on the command line, or add it to /etc/profile (for all users) or to ~/.bash_profile (for individual users), and adjust /usr/local as necessary for the actual installation directory you specified:
export PATH=/usr/local/sbin:/usr/local/bin:$PATHIf you don't run "make install" as root, then you will need to manually create the directories /dev/ptal-mlcd and /dev/ptal-printd, if you haven't already. Set the ownership and permissions as appropriate (probably 0755 and root:root).
"make install" as root tries to create a symlink to ptal-init in your system's init script directory, such as /etc/init.d, and run chkconfig to create the runlevel-specific symlinks. If init scripts are located in a directory not known to the Makefile, or if chkconfig isn't available on your system, then you will need to create these symlinks by hand to ensure that ptal-init gets started and stopped as appropriate. Alternatively, you might be able to add a line to some sort of "local" init script, such as /etc/rc.d/rc.local, that invokes "ptal-init start". You'll probably need to specify the full path to ptal-init in this case.
Caution: RedHat 7.x invokes a checkpc command in its lpd init script. This command will hang, particularly during bootup, if ptal-printd is not already running. For this reason, be sure that ptal-init runs before lpd gets started.
"make install" as root checks /etc/ld.so.conf for the directory into which libptal.so was installed, and adds it and runs ldconfig if necessary. If you build and install several times using --prefix=DIR switches that differ only in extra slashes in the path, then you run the risk of having redundant lines added to this file. It would probably be a good idea to inspect this file and make corrections if necessary, and re-run ldconfig to make your changes take effect.
As an alternative to modifying /etc/ld.so.conf, you can set the environment variable LD_LIBRARY_PATH to /usr/local/lib (or wherever the libraries were installed) before running any of the hpoj programs that depend on libptal.so.
If you install the hpoj software into separate unique directories for different versions, then you should also check /etc/ld.so.conf and remove lines that point to old hpoj versions. However, be careful not to delete the line for the current version, or any line specifying a path containing other libraries on your system that you want to continue to be accessible. Run ldconfig (again, as root) to make your changes to this file take effect.
Now you're ready to set up basic device connectivity.