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-7.6
platform.
Package Information
Additional Downloads
Cups Dependencies
Recommended
Colord-1.2.3, D-Bus-1.8.8, and
libusb-1.0.19
Optional
Avahi-0.6.31, GnuTLS-3.3.7 (if
you have it installed, then libgcrypt-1.6.2 is required) or OpenSSL-1.0.1i, libpaper-1.1.24+nmu3, Linux-PAM-1.1.8, MIT
Kerberos V5-1.12.2, OpenJDK-1.7.0.65/IcedTea-2.5.2,
PHP-5.6.0, Python-2.7.8,
and xdg-utils-1.1.0-rc2
Required (Runtime)
cups-filters-1.0.58
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.10) enable the following
options in your kernel configuration and recompile the kernel:
Device Drivers --->
USB support --->
OHCI HCD (USB 1.1) support: Y or M
UHCI HCD (most Intel and VIA) support: Y or M
USB Printer support: Y or M
If you have a parallel printer, enable the following options in
your kernel configuration and recompile the kernel:
Device Drivers --->
Parallel port support --->
PC-style hardware: Y or M
Character devices --->
Parallel printer support: Y or M
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.0-rc2, 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.
If you need to access a remote Cups print server, use the following patch:
patch -Np1 -i ../cups-1.7.5-content_type-1.patch
Install Cups by running the
following commands:
patch -Np1 -i ../cups-1.7.5-blfs-1.patch &&
aclocal -I config-scripts &&
autoconf -I config-scripts &&
CC=gcc \
./configure --libdir=/usr/lib \
--with-rcdir=/tmp/cupsinit \
--with-docdir=/usr/share/cups/doc \
--with-system-groups=lpadmin &&
make
To test the results, issue: make -k
check. An already active graphical session with bus
address is necessary to run the tests. A small number of tests fail
for unknown reasons.
Now, as the root
user:
make install &&
rm -rf /tmp/cupsinit &&
ln -svfn ../cups/doc /usr/share/doc/cups-1.7.5
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
Remove filters that are now part of the Cups Filters package by running the following
commands as the root
user:
rm -rf /usr/share/cups/banners &&
rm -rf /usr/share/cups/data/testprint
Note
If you reinstall or update Cups,
commands above break cups-filters-1.0.58, which needs,
therefore, to be reinstalled.
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.24 or
GTK+-3.12.2 installed and issue the following
command as the root
user:
gtk-update-icon-cache
Command Explanations
CC=gcc
: This environment variable
ensures that gcc is used if clang is installed. The build fails
with the clang compiler.
--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.19, 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.
--disable-gnutls --enable-openssl
: This
switch tells the build process to use OpenSSL-1.0.1i
instead of GnuTLS-3.3.7. The current version of
GnuTLS might produce lot of
warnings during the Cups build.