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 .

There are two major install configurations - foomatic-xml-install and foomatic-ppd-install. The default is the foomatic-xml-install. The foomatic-xml-install will install all necessary files for dynamic PPD file creation at runtime. Since the foomatic db builds HPIJS PPD files, only HPIJS PPD files are built-on-the-fly. HP postscript PPD files are always pre-built. The foomatic-ppd-install will install pre-built HPIJS PPD files and HP postscript PPD files.

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

    cups-config --version

The following example is a foomatic-xml-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 foomatic-ppd-install.

    tar xzvf hplip-2.7.x.tar.gz
    cd hplip-2.7.x
    ./configure --prefix=/usr --disable-xml-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-xml-install   enable foomatic xml install, uses foomaticdir (default=yes)
    --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-foomaticdir=DIR          set foomatic db install directory (default=datadir/foomatic)

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-xml-install   enable foomatic xml install, uses foomaticdir (default=yes)
    --with-hpppddir=DIR             set hp ppd install directory (default=datadir/ppd/HP)
    --with-foomaticdir=DIR          set foomatic db install directory (default=datadir/foomatic)

    Foomatic-ppd-install will (1) copy HPIJS PPD files to $(hpppddir) (2) copy HP postscript PPD files to $(hpppddir) (3) gzip all PPD files.

    Foomatic-xml-install will (1) copy HPIJS xml files to $(foomaticdir)/... (2) copy HP postscript PPD files to $(foomaticdir)/db/source/PPD/HP
    (3) gzip all postscript PPD files.

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 Oct 17 15:58:14 2007; HPLIP Version: 2.7.12