Cups-2.2.10

#### Beyond Linux® From Scratch - Version 2019-02-27

### Chapter 46. Printing

- Prev

  Printing

- Next

  cups-filters-1.22.0

- Up
- Home

# Cups-2.2.10

## Introduction to Cups

The Common Unix Printing System (CUPS) is a print spooler and associated utilities. It is based on the "Internet Printing Protocol" and provides printing services to most PostScript and raster printers.

This package is known to build and work properly using an LFS-8.4 platform.

### Package Information

- Download (HTTP): https://github.com/apple/cups/releases/download/v2.2.10/cups-2.2.10-source.tar.gz

- Download MD5 sum: 3d22d747403ec5dcd0b66d1332564816

- Download size: 9.9 MB

- Estimated disk space required: 63 MB

- Estimated build time: 0.5 SBU

### Cups Dependencies

#### Required

GnuTLS-3.6.6

#### Recommended

colord-1.4.3, dbus-1.12.12, libusb-1.0.22, Linux-PAM-1.3.0, and xdg-utils-1.1.3

#### Optional

Avahi-0.7, libpaper-1.1.24+nmu5, MIT Kerberos V5-1.17, OpenJDK-11.0.2, PHP-7.3.2, and Python-2.7.15

#### Required (Postinstall)

cups-filters-1.22.0

#### Optional (Postinstall)

Gutenprint-5.2.14 and hplip (HP printers)

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/cups

## Kernel Configuration

### Note

There used to be a conflict between the Cups libusb backend and the usblp kernel driver. This is no longer the case and cups will work with both of these enabled.

If you want to use the kernel usblp driver (for example, if you wish to use escputil from Gutenprint-5.2.14) enable the following options in your kernel configuration and recompile the kernel:

    Device Drivers  --->
      [*] USB support  --->                          [CONFIG_USB_SUPPORT]
        <*/M>  OHCI HCD (USB 1.1) support            [CONFIG_USB_OHCI_HCD]
        <*/M>  UHCI HCD (most Intel and VIA) support [CONFIG_USB_UHCI_HCD]
        <*/M>  USB Printer support                   [CONFIG_USB_PRINTER]

If you have a parallel printer, enable the following options in your kernel configuration and recompile the kernel:

    Device Drivers  --->
      <*/M> Parallel port support  --->    [CONFIG_PARPORT]
        <*/M> PC-style hardware            [CONFIG_PARPORT_PC]
      Character devices  --->
        <*/M> Parallel printer support     [CONFIG_PRINTER]

## Installation of Cups

You will need to add an `lp` user, as Cups will create some files owned by this user. (The `lp` user is the default used by Cups, but may be changed to a different user by passing a parameter to the configure script.) Use the following command as the `root` user:

    useradd -c "Print Service User" -d /var/spool/cups -g lp -s /bin/false -u 9 lp

You will also need a dedicated group that will contain users allowed to do Cups administrative tasks. Add the group by running the following command as the `root` user:

    groupadd -g 19 lpadmin

If you want to add a user to the Cups administrative group, run the following command as the `root` user:

    usermod -a -G lpadmin <username>

If you didn't install xdg-utils-1.1.3, use the following sed to change the default browser that will be used to access the Cups web interface:

    sed -i 's#@CUPS_HTMLVIEW@#firefox#' desktop/cups.desktop.in

Replace firefox with the web browser of your choice.

Build Cups by running the following commands:

    sed -i 's:444:644:' Makedefs.in                                     &&
    sed -i '/MAN.EXT/s:.gz::' configure config-scripts/cups-manpages.m4 &&

    aclocal  -I config-scripts &&
    autoconf -I config-scripts &&

    CC=gcc CXX=g++ \
    ./configure --libdir=/usr/lib            \
                --disable-systemd            \
                --with-rcdir=/tmp/cupsinit   \
                --with-system-groups=lpadmin \
                --with-docdir=/usr/share/cups/doc-2.2.10 &&
    make

To test the results, issue: make -k check. An already active graphical session with bus address is necessary to run the tests. Some tests fail for unknown reasons.

Now, as the `root` user:

    make install &&
    rm -rf /tmp/cupsinit &&
    ln -svnf ../cups/doc-2.2.10 /usr/share/doc/cups-2.2.10

Create a basic Cups client configuration file by running the following command as the `root` user:

    echo "ServerName /var/run/cups/cups.sock" > /etc/cups/client.conf

### Note

This package installs icon files into the `/usr/share/icons/hicolor` hierarchy and you can improve system performance and memory usage by updating `/usr/share/icons/hicolor/index.theme`. To perform the update you must have GTK+-2.24.32 or GTK+-3.24.5 installed and issue the following command as the `root` user:

    gtk-update-icon-cache

## Command Explanations

sed ... Makedefs.in: Fix files and directories permissions.

sed ... cups-manpages.m4: This sed prevents compression of the man pages by default.

`CC=gcc`: This environment variable ensures that gcc is used, if clang is installed. Remove it, if you prefer to use clang. Using clang almost doubles build time and slightly decreases build disk space. Installed disk space is not appreciably modified.

`--disable-systemd`: Systemd is not supported by this version of BLFS.

`--with-rcdir=/tmp/cupsinit`: This switch tells the build process to install the shipped bootscript into `/tmp` instead of `/etc/rc.d`.

`--with-system-groups=lpadmin`: This switch ensures that only `lpadmin` will be used as the Cups administrative group.

`--disable-libusb`: Use this switch if you have installed libusb-1.0.22, but wish to use the kernel usblp driver.

`--enable-libpaper`: Use this switch if you have installed libpaper and wish to use it with Cups.

## Configuring Cups

### Config Files

`/etc/cups/*`

### Configuration Information

Normally, printers are set up via a web browser. The Cups server will normally connect via the url http://localhost:631. From there printers, print jobs, and the server configuration can be set up and managed. Remote system administration can also be set up. Configuration can also be done from the command line via the lpadmin, lpoptions, and lpstat commands.

Configuration of Cups is dependent on the type of printer and can be complex. Generally, PostScript printers are easier. For detailed instructions on configuration and use of Cups, see http://www.cups.org/documentation.php.

For non-PostScript printers to print with Cups, you need to install ghostscript-9.26 to convert PostScript to raster images and a driver (e.g. from Gutenprint-5.2.14) to convert the resulting raster images to a form that the printer understands. Foomatic drivers use ghostscript-9.26 to convert PostScript to a printable form directly, but this is considered suboptimal by Cups developers.

### Linux PAM Configuration

If CUPS has been built with Linux PAM support, you need to create a PAM configuration file to get it working correctly with BLFS.

Issue the following command as the `root` user to create the configuration file for Linux PAM:

    cat > /etc/pam.d/cups << "EOF"
    # Begin /etc/pam.d/cups

    auth    include system-auth
    account include system-account
    session include system-session

    # End /etc/pam.d/cups
    EOF

### Boot Script

If you want the Cups print service to start automatically when the system is booted, install the init script included in the blfs-bootscripts-20180105 package:

    make install-cups

## Contents

Installed Programs: accept, cancel, cupsaccept, cupsaddsmb, cups-config, cupsctl, cupsd, cupsdisable, cupsenable, cupsfilter, cupsreject, cupstestdsc, cupstestppd, ippfind, ipptool, lp, lpadmin, lpc, lpinfo, lpmove, lpoptions, lpq, lpr, lprm, lpstat, ppdc, ppdhtml, ppdi, ppdmerge, ppdpo, and reject
Installed Libraries: libcupscgi.so, libcupsimage.so, libcupsmime.so, libcupsppdc.so, and libcups.so
Installed Directories: /etc/cups, /usr/{include,lib,share}/cups, /usr/share/doc/cups-2.2.10, and /var/{cache,log,run,spool}/cups

### Short Descriptions

accept | instructs the printing system to accept print jobs to the specified destinations.
cancel | cancels existing print jobs from the print queues.
cupsaccept | accept jobs sent to a destination.
cupsaddsmb | exports printers to the Samba software for use with Windows clients.
cups-config | is a Cups program configuration utility.
cupsctl | updates or queries the cupsd.conf file for a server.
cupsd | is the scheduler for the Common Unix Printing System.
cupsdisable | stop printers and classes.
cupsenable | start printers and classes.
cupsfilter | is a front-end to the Cups filter subsystem which allows you to convert a file to a specific format.
cupsreject | reject jobs sent to a destination.
cupstestdsc | tests the conformance of PostScript files.
cupstestppd | tests the conformance of PPD files.
ippfind | finds internet printing protocol printers.
ipptool | sends IPP requests to the specified URI and tests and/or displays the results.
lp | submits files for printing or alters a pending job.
lpadmin | configures printer and class queues provided by Cups.
lpc | provides limited control over printer and class queues provided by Cups.
lpinfo | lists the available devices or drivers known to the Cups server.
lpmove | moves the specified job to a new destination.
lpoptions | displays or sets printer options and defaults.
lpq | shows the current print queue status on the named printer.
lpr | submits files for printing.
lprm | cancels print jobs that have been queued for printing.
lpstat | displays status information about the current classes, jobs, and printers.
ppdc | compiles PPDC source files into one or more PPD files.
ppdhtml | reads a driver information file and produces a HTML summary page that lists all of the drivers in a file and the supported options.
ppdi | imports one or more PPD files into a PPD compiler source file.
ppdmerge | merges two or more PPD files into a single, multi-language PPD file.
ppdpo | extracts UI strings from PPDC source files and updates either a GNU gettext or Mac OS X strings format message catalog source file for translation.
reject | instructs the printing system to reject print jobs to the specified destinations.
`libcups.so` | contains the Cups API functions.

Last updated on 2019-02-15 15:01:29 -0600

- Prev

  Printing

- Next

  cups-filters-1.22.0

- Up
- Home