HPLIP Technical Documentation - Portablity Reference
Description: HP Linux Imaging and Printing - HPLIP is an HP developed solution for printing, scanning, and faxing with HP inkjet and laser based printers in Linux.
Keywords: HPLIP, HP, Linux, Printing, HPIJS

Home > Technical Documentation > Portablity Reference

# Technical Documentation: Portablity Reference

HPLIP uses GNU Autotools for building and installing. GNU Autotools simplify most portability issues automatically, but some customization may be desirable. This section documents different configuration options that are available and some caveats for building HPLIP on different distributions and platforms.

This information is useful for package maintainers and users who want to build and install HPLIP from the source tar ball. Most users don't not need to build from source code and should get the latest HPLIP package from their distribution.

This section assumes all System Requirements have been met and any pre-existing HPLIP install uses the same "./configure --prefix=/usr" parameters. For more detailed install instructions see Installation Instructions .

PPD files are used to specifiy driver and driver parameters. Each print job has an associated PPD file and each HP printer has a unique PPD file. There are HPIJS PPD files, postscript PPD files and fax PPD files. All HPIJS PPD files are generated from a CUPS drv file called hpijs.drv.

CUPS drv support is part of the CUPS DDK at http://www.cups.org/ddk. The CUPS DDK allows us to support the hpijs/ghostscript/foomatic-rip driver. CUPS drv support provides dynamic and static PPD file support similar to the foomatic database. CUPS drv support provides more PPD options, faster PPD file generation, and a smaller foot-print than the foomatic database. See http://linuxprinting.org for foomatic database information.

Unfortunately drv generated PPDs are only compatible with the latest foomatic-rip. Since the static PPDs included in the tar ball are not compatible with older versions of foomatic-rip, we included a copy of the latest foomatic-rip called foomatic-rip-hplip. The foomatic-rip-hplip was built from foomatic-filters-3.0-current.tar.gz dated 1/23/2008.

There are two major install configurations - dynamic PPD install and static PPD install. The default is the dynamic PPD install. The dynamic PPD install will install all necessary files for dynamic PPD file creation at runtime. Currently only HPIJS PPDs are built-on-the-fly. Postscript PPDs and fax PPDs are pre-built.

The dynamic PPD install works with CUPS systems that use dynamic PPD file creation. Generally CUPS 1.2 uses dynamic PPD file creation. Use static PPD install with CUPS 1.1.x. The following command displays the CUPS version.

    cups-config --version

The following configure time options are valid for dynamic PPD install and static PPD install.

1. Static PPD install with foomatic-rip-hplip - Intended for distros that do not have the latest foomatic-rip. Installs precompiled HPIJS PPDs included in the tar ball. All HPIJS PPDs call foomatic-rip-hplip.

    --disable-foomatic-drv-install
    --enable-foomatic-ppd-install
    --with-hpppddir  [destination for *-hpijs.ppd, *-ps.ppd and HP-Fax-hplip.ppd]
    --enable-foomatic-rip-hplip-install

2. Static PPD install with no foomatic-rip-hplip and HPIJS PPDs must be modified - Intended for distros that have the latest foomatic-rip. The user must manually change the *cupsFilter line from foomatic-rip-hpijs to foomatic-rip for all HPIJS PPDs before "make install".

    --disable-foomatic-drv-install
    --enable-foomatic-ppd-install
    --with-hpppddir  [destination for *-hpijs.ppd, *-ps.ppd and HP-Fax-hplip.ppd]
    --disable-foomatic-rip-hplip-install

3. Static PPD install with no foomatic-rip-hplip and new HPIJS PPDs must be created - Intended for distros that have the latest foomatic-rip. The user must manually create new HPIJS PPDs with the CUPS DDK by running "ppdc prnt/drv/hpijs.drv" before "make install".

    --disable-foomatic-drv-install
    --enable-foomatic-ppd-install
    --with-hpppddir  [destination for *-hpijs.ppd, *-ps.ppd and HP-Fax-hplip.ppd]
    --disable-foomatic-rip-hplip-install

4. Dynamic PPD install with foomatic-rip-hplip - Intended for distros that do not have the latest foomatic-rip. No static HPIJS PPD files are installed. Dynamic PPD files will call foomatic-rip-hplip.

    --enable-foomatic-drv-install
    --with-drvdir  [destination for hpijs.drv]
    --with-hpppddir  [destination for *-ps.ppd and HP-Fax-hplip.ppd]
    --enable-foomatic-rip-hplip-install

5. Dynamic PPD install with no foomatic-rip-hplip - Intended for distros that have the latest foomatic-rip. Dynamic PPD files will call foomatic-rip.

    --enable-foomatic-drv-install
    --with-drvdir  [destination for *.drv]
    --with-hpppddir  [destination for *-ps.ppd and HP-Fax-hplip.ppd]
    --disable-foomatic-rip-hplip-install

The following example is a dynamic PPD install which is the default.

    tar xzvf hplip-2.7.x.tar.gz
    cd hplip-2.7.x
    ./configure --prefix=/usr
    make
    make install

Use this example for a static PPD install.

    tar xzvf hplip-2.7.x.tar.gz
    cd hplip-2.7.x
    ./configure --prefix=/usr --disable-foomatic-drv-install --enable-foomatic-ppd-install --with-hpppddir=/usr/share/cups/model
    make
    make install

If HPLIP built and installs correctly you now need to check device permissions. Most distributions set the default device permissions to root. This means ordinary users do not have access to the device. Usually this is not be a problem for printing, but it is a problem for scanning and the hp-toolbox. These applications will not see the device with-out proper permissions.

To solve this device permissions problem HPLIP installs the udev rule /etc/udev/rules.d/55-hpmud.rules. In this file there is a rule for every HP product recognized by HPLIP. When a udev event occurs (ie: USB plug-and-play event), this rules file will be invoked. If the HP vendor-id and product-id matches one of the rules, the rule assigns device ownership and permissions for this device.

For USB devices recognized by the 55-hpmud.rules file, the device file privileges will be set to the following. This example uses the lsusb command to determine the USB bus number and device number. Use these numbers to list the /dev/bus/usb/xxx/xxx device file.

    $ lsusb
    Bus 002 Device 003: ID 03f0:6511 Hewlett-Packard
    $ ls -l /dev/bus/usb/002/003
    crw-rw-rw-- 1 lp lp 189, 258 May 22 17:04 /dev/bus/usb/003/003

For parallel port devices recognized by the 55-hpmud.rules file, the device file privileges will be set to the following.

    $ ls -l /dev/parport0
    crw-rw-rw- 1 lp lp 99, 0 May 22 11:26 /dev/parport0

If the device permissions are set correctly. You should now be able to use HPLIP.

Caveats

1. Network support requires libsnmp. HPLIP can be build without network support. At configure time use the following command.

    ./configure --prefix=/usr --disable-network-build

2. In order to get HPLIP to compile with libsnmp on SUSE 9.1 you need add the following symlink for libcrypto.

    ln -s /usr/lib/libcrypto.so.0.9.7 /usr/lib/libcrypto.so

3. For distribution package managers the following ./configure options are available. This allows the package manager to configure these options.

    --enable-doc-build              enable documentation build (default=yes)
    --enable-hpijs-only-build       enable hpijs only build (default=no)
    --enable-network-build          enable network build (default=yes)
    --enable-pp-build               enable parallel port build (default=yes)
    --enable-scan-build             enable scanner build (default=yes)
    --enable-gui-build              enable gui build (default=yes)
    --enable-fax-build              enable fax build (default=yes)
    --enable-cups11-build           enable cups 1.1.x build (default=no)
    --enable-shadow-build           enable shadow build (default=no)
    --enable-foomatic-ppd-install   enable foomatic ppd install, uses hpppddir (default=no)
    --enable-foomatic-drv-install   enable foomatic drv install, uses foomaticdir (default=yes)
    --enable-foomatic-rip-hplip-install    enable foomatic-rip-hplip install (default=yes), uses cupsfilterdir
    --with-cupsbackenddir=DIR       set cups backend install directory (default=/usr/lib/cups/backend)
    --with-icondir=DIR              set icon install directory (default=/usr/share/applications)
    --with-hpppddir=DIR             set hp ppd install directory (default=datadir/ppd/HP)
    --with-drvdir=DIR               set cups drv install directory (default=datadir/cups/drv/hp)
    --with-cupsfilterdir=DIR        set cups filter install directory (default=/usr/lib/cups/filter)

4. For Mandrake be sure to include the net-snmp-mibs package for network support.
5. In order to run the HP Device Manager, PyQt needs to be installed. Also Fedora C3 requires the "sip" module, see the following Fedora C3 instructions.

    yum install PyQt
    yum install sip

6. In SUSE 9.2 and above PyQt is now part of kdebindings3-python.
7. In order to run HPLIP with Fedora C4 you must disable SELinux protection. Under "Security Level Configuration", select SELinux tab, un-click "Enforcing Current:Permissive". The default SELinux policies will conflict with HPLIP I/O. If you want to run with SELinux enabled install the FC4 HPLIP rpm available at RH.
8. HPLIP can be uninstalled with the "make uninstall" command.
9. With FC4 64-bit systems use must use "./configure --prefix=/usr --libdir=/usr/lib64" in order to get libsane-hpaio installed correctly.
10. The udev 55-hpmud.rules file sets the default Unix permissions to 666 which allow read/write to "owner", "group" and "other" users. This means anybody can use this HP printer. If you want to change this user policy, then you must modify the 55-hpmud.rules file. For example you can set the Unix permissions to 660 (MODE="0660"), then only users that are members of the "lp" group can use the device.
11. The udev 55-hpmud.rules file wild-cards the USB product-id check based on known HP products. This means the current rules files should work on new future HP products.
12. For older distributions (ie: Suse 10.0) the kernel usbfs used /proc/bus/usb/xxx/xxx instead of /dev/bus/usb/xxx/xxx device files. This means the standard udev rules will not work for setting device permissions. You can modify the 55-hpmud.rules file to set device permissions for /proc based systems with the following rule changes.

    SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??11", PROGRAM="/bin/sh -c 'X=%k; X=$${X#usbdev}; B=$${X%%%%.*}; D=$${X#*.}; printf /proc/bus/usb/%%03i/%%03i $$B $$D'", RUN+="/bin/sh -c 'chown lp: %c; chmod 666 %c'"
    SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??02", PROGRAM="/bin/sh -c 'X=%k; X=$${X#usbdev}; B=$${X%%%%.*}; D=$${X#*.}; printf /proc/bus/usb/%%03i/%%03i $$B $$D'", RUN+="/bin/sh -c 'chown lp: %c; chmod 666 %c'"
    SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??12", PROGRAM="/bin/sh -c 'X=%k; X=$${X#usbdev}; B=$${X%%%%.*}; D=$${X#*.}; printf /proc/bus/usb/%%03i/%%03i $$B $$D'", RUN+="/bin/sh -c 'chown lp: %c; chmod 666 %c'"
    SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??04", PROGRAM="/bin/sh -c 'X=%k; X=$${X#usbdev}; B=$${X%%%%.*}; D=$${X#*.}; printf /proc/bus/usb/%%03i/%%03i $$B $$D'", RUN+="/bin/sh -c 'chown lp: %c; chmod 666 %c'"
    SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??17", PROGRAM="/bin/sh -c 'X=%k; X=$${X#usbdev}; B=$${X%%%%.*}; D=$${X#*.}; printf /proc/bus/usb/%%03i/%%03i $$B $$D'", RUN+="/bin/sh -c 'chown lp: %c; chmod 666 %c'"

13. For Suse 10.3 cups-autoconfig does not work well with the "hp" backend. Cups-autoconfig can be configured to automatically disable print queues. This feature works well with the "usb" backend, but not the "hp" backend. Since both backends do not use libusb you must disable this feature in /etc/cups-autoconfig.conf. Otherwise the printer queue will have to be manually re-started after each udev plug-in-play event.

    from:
    DisablePrintersOnRemoval=yes

    to:
    DisablePrintersOnRemoval=no

# HPIJS Portability Reference

The previous section installed the complete HPLIP package which includes HPIJS. HPIJS predates HPLIP and some distributions package HPIJS separately. In order to support HPIJS only solution, HPIJS can be built and installed without HPLIP support. HPIJS has it's own configuration option --enable-hpijs-only-build.

With the HPLIP master Makefile a standalone version of HPIJS can be compiled and installed using the following instructions.

    tar xzvf hpip-0.9.x.tar.gz
    cd hplip-0.9.x/prnt/hpijs
    ./configiure --prefix=/usr --enable-hpijs-only-build
    make
    make install

If you are running CUPS 1.1.x restart cupsd in order to cause the CUPS daemon to re-read all the PPD files in the PPD directory. You can skip this step if your are running CUPS 1.2 or higher.

    /etc/init.d/cups restart

You can verify HPIJS was build and installed correctly with the following command.

    hpijs -h
    Hewlett-Packard Co. Inkjet Server 2.x
    Copyright (c) 2001-2006, Hewlett-Packard Co.

Caveats

1. For distribution package managers the following ./configure options are available for HPIJS.

    --enable-foomatic-ppd-install   enable foomatic ppd install, uses hpppddir (default=no)
    --enable-foomatic-drv-install   enable foomatic drv install, uses drvdir (default=yes)
    --enable-foomatic-rip-hplip-install    enable foomatic-rip-hplip install (default=yes), uses cupsfilterdir
    --with-hpppddir=DIR             set hp ppd install directory (default=datadir/ppd/HP)
    --with-drvdir=DIR               set cups drv install directory (default=datadir/cups/drv/hp)
    --with-cupsfilterdir=DIR        set cups filter install directory (default=/usr/lib/cups/filter)

2. If you are building Ghostscript from scratch and gs gets a missing font error message, try the following symbolic link. Ghostscript looks for fonts in hardcoded directories, see GS_LIB_DEFAULT in the Ghostscript Makefile. For Red Hat the following symbolic link will allow Ghostscript to find fonts with out modifying the makefile. Other distributions may have different font directories.

    ln -s /usr/share/fonts/default/Type1 /usr/share/ghostscript/fonts

Page last updated: Wed Apr 2 15:18:08 2008; HPLIP Version: 2.8.4