Blame INSTALL.md

Packit 2fc92b
INSTALL - CUPS v2.2.6 - 2017-11-01
Packit 2fc92b
==================================
Packit 2fc92b
Packit 2fc92b
This file describes how to compile and install CUPS from source code. For more
Packit 2fc92b
information on CUPS see the file called "README.md".  A complete change log can
Packit 2fc92b
be found in "CHANGES.md".
Packit 2fc92b
Packit 2fc92b
Using CUPS requires additional third-party support software and printer drivers.
Packit 2fc92b
These are typically included with your operating system distribution.  Apple
Packit 2fc92b
does not endorse or support third-party support software for CUPS.
Packit 2fc92b
Packit 2fc92b
> Note: Current versions of macOS DO NOT allow installation to /usr with the
Packit 2fc92b
> default System Integrity Protection (SIP) settings.  In addition, we do not
Packit 2fc92b
> recommend replacing the CUPS supplied with macOS because:
Packit 2fc92b
>
Packit 2fc92b
> a. not all versions of CUPS are compatible with every macOS release,
Packit 2fc92b
>
Packit 2fc92b
> b. code signing prevents replacement of system libraries and access to the
Packit 2fc92b
>    system keychain (needed for encrypted printer sharing), and
Packit 2fc92b
>
Packit 2fc92b
> c. software updates will often replace parts of your local installation,
Packit 2fc92b
>    potentially rendering your system unusable.
Packit 2fc92b
>
Packit 2fc92b
> Apple only supports using the Clang supplied with Xcode to build CUPS on
Packit 2fc92b
> macOS.
Packit 2fc92b
Packit 2fc92b
Packit 2fc92b
BEFORE YOU BEGIN
Packit 2fc92b
----------------
Packit 2fc92b
Packit 2fc92b
You'll need ANSI-compliant C and C++ compilers, plus a make program and POSIX-
Packit 2fc92b
compliant shell (/bin/sh).  The GNU compiler tools and Bash work well and we
Packit 2fc92b
have tested the current CUPS code against several versions of GCC with excellent
Packit 2fc92b
results.
Packit 2fc92b
Packit 2fc92b
The makefiles used by the project should work with most versions of make.  We've
Packit 2fc92b
tested them with GNU make as well as the make programs shipped by Compaq, HP,
Packit 2fc92b
SGI, and Sun.  BSD users should use GNU make (gmake) since BSD make does not
Packit 2fc92b
support "include".
Packit 2fc92b
Packit 2fc92b
Besides these tools you'll want ZLIB library for compression support, the GNU
Packit 2fc92b
TLS library for encryption support on platforms other than iOS, macOS, or
Packit 2fc92b
Windows, and either MIT (1.6.3 or higher) or Heimdal Kerberos for Kerberos
Packit 2fc92b
support.  CUPS will compile and run without these, however you'll miss out on
Packit 2fc92b
many of the features provided by CUPS.
Packit 2fc92b
Packit 2fc92b
On a stock Ubuntu install, the following command will install the required
Packit 2fc92b
prerequisites:
Packit 2fc92b
Packit 2fc92b
    sudo apt-get install autoconf build-essential libavahi-client-dev \
Packit 2fc92b
         libgnutls28-dev libkrb5-dev libnss-mdns libpam-dev \
Packit 2fc92b
         libsystemd-dev libusb-1.0-0-dev zlib1g-dev
Packit 2fc92b
Packit 2fc92b
Also, please note that CUPS does not include print filters to support PDF or
Packit 2fc92b
raster printing.  You *must* download GPL Ghostscript and/or the Open Printing
Packit 2fc92b
CUPS filters package separately to print on operating systems other than macOS.
Packit 2fc92b
Packit 2fc92b
Packit 2fc92b
CONFIGURATION
Packit 2fc92b
-------------
Packit 2fc92b
Packit 2fc92b
CUPS uses GNU autoconf, so you should find the usual "configure" script in the
Packit 2fc92b
main CUPS source directory.  To configure CUPS for your system, type:
Packit 2fc92b
Packit 2fc92b
    ./configure
Packit 2fc92b
Packit 2fc92b
The default installation will put the CUPS software in the "/etc", "/usr", and
Packit 2fc92b
"/var" directories on your system, which will overwrite any existing printing
Packit 2fc92b
commands on your system.  Use the `--prefix` option to install the CUPS software
Packit 2fc92b
in another location:
Packit 2fc92b
Packit 2fc92b
    ./configure --prefix=/some/directory
Packit 2fc92b
Packit 2fc92b
> Note: Current versions of macOS DO NOT allow installation to /usr with the
Packit 2fc92b
> default System Integrity Protection (SIP) settings.
Packit 2fc92b
Packit 2fc92b
To see a complete list of configuration options, use the `--help` option:
Packit 2fc92b
Packit 2fc92b
    ./configure --help
Packit 2fc92b
Packit 2fc92b
If any of the dependent libraries are not installed in a system default location
Packit 2fc92b
(typically "/usr/include" and "/usr/lib") you'll need to set the CFLAGS,
Packit 2fc92b
CPPFLAGS, CXXFLAGS, DSOFLAGS, and LDFLAGS environment variables prior to running
Packit 2fc92b
configure:
Packit 2fc92b
Packit 2fc92b
    setenv CFLAGS "-I/some/directory"
Packit 2fc92b
    setenv CPPFLAGS "-I/some/directory"
Packit 2fc92b
    setenv CXXFLAGS "-I/some/directory"
Packit 2fc92b
    setenv DSOFLAGS "-L/some/directory"
Packit 2fc92b
    setenv LDFLAGS "-L/some/directory"
Packit 2fc92b
    ./configure ...
Packit 2fc92b
Packit 2fc92b
or:
Packit 2fc92b
Packit 2fc92b
    CFLAGS="-I/some/directory" \
Packit 2fc92b
    CPPFLAGS="-I/some/directory" \
Packit 2fc92b
    CXXFLAGS="-I/some/directory" \
Packit 2fc92b
    DSOFLAGS="-L/some/directory" \
Packit 2fc92b
    LDFLAGS="-L/some/directory" \
Packit 2fc92b
    ./configure ...
Packit 2fc92b
Packit 2fc92b
The `--enable-debug` option compiles CUPS with debugging information enabled.
Packit 2fc92b
Additional debug logging support can be enabled using the
Packit 2fc92b
`--enable-debug-printfs` option - these debug messages are enabled using the
Packit 2fc92b
`CUPS_DEBUG_xxx` environment variables at run-time.
Packit 2fc92b
Packit 2fc92b
CUPS also includes an extensive set of unit tests that can be used to find and
Packit 2fc92b
diagnose a variety of common problems - use the "--enable-unit-tests" configure
Packit 2fc92b
option to run them at build time.
Packit 2fc92b
Packit 2fc92b
On macOS, use the `--with-archflags` option to build with the correct set of
Packit 2fc92b
architectures:
Packit 2fc92b
Packit 2fc92b
    ./configure --with-archflags="-arch i386 -arch x86_64" ...
Packit 2fc92b
Packit 2fc92b
Once you have configured things, just type:
Packit 2fc92b
Packit 2fc92b
    make ENTER
Packit 2fc92b
Packit 2fc92b
or if you have FreeBSD, NetBSD, or OpenBSD type:
Packit 2fc92b
Packit 2fc92b
    gmake ENTER
Packit 2fc92b
Packit 2fc92b
to build the software.
Packit 2fc92b
Packit 2fc92b
Packit 2fc92b
TESTING THE SOFTWARE
Packit 2fc92b
--------------------
Packit 2fc92b
Packit 2fc92b
Aside from the built-in unit tests, CUPS includes an automated test framework
Packit 2fc92b
for testing the entire printing system.  To run the tests, just type:
Packit 2fc92b
Packit 2fc92b
    make check ENTER
Packit 2fc92b
Packit 2fc92b
or if you have FreeBSD, NetBSD, or OpenBSD type:
Packit 2fc92b
Packit 2fc92b
    gmake check ENTER
Packit 2fc92b
Packit 2fc92b
The test framework runs a copy of the CUPS scheduler (cupsd) on port 8631 in
Packit 2fc92b
/tmp/cups-$USER and produces a nice HTML report of the results.
Packit 2fc92b
Packit 2fc92b
Packit 2fc92b
INSTALLING THE SOFTWARE
Packit 2fc92b
-----------------------
Packit 2fc92b
Packit 2fc92b
Once you have built the software you need to install it.  The "install" target
Packit 2fc92b
provides a quick way to install the software on your local system:
Packit 2fc92b
Packit 2fc92b
    make install ENTER
Packit 2fc92b
Packit 2fc92b
or for FreeBSD, NetBSD, or OpenBSD:
Packit 2fc92b
Packit 2fc92b
    gmake install ENTER
Packit 2fc92b
Packit 2fc92b
Use the BUILDROOT variable to install to an alternate root directory:
Packit 2fc92b
Packit 2fc92b
    make BUILDROOT=/some/other/root/directory install ENTER
Packit 2fc92b
Packit 2fc92b
You can also build binary packages that can be installed on other machines using
Packit 2fc92b
the RPM spec file ("packaging/cups.spec") or EPM list file
Packit 2fc92b
("packaging/cups.list").  The latter also supports building of binary RPMs, so
Packit 2fc92b
it may be more convenient to use.
Packit 2fc92b
Packit 2fc92b
You can find the RPM software at:
Packit 2fc92b
Packit 2fc92b
    http://www.rpm.org/
Packit 2fc92b
Packit 2fc92b
The EPM software is available at:
Packit 2fc92b
Packit 2fc92b
    https://michaelrsweet.github.io/epm
Packit 2fc92b
Packit 2fc92b
Packit 2fc92b
CREATING BINARY DISTRIBUTIONS WITH EPM
Packit 2fc92b
--------------------------------------
Packit 2fc92b
Packit 2fc92b
The top level makefile supports generation of many types of binary distributions
Packit 2fc92b
using EPM.  To build a binary distribution type:
Packit 2fc92b
Packit 2fc92b
    make <format> ENTER
Packit 2fc92b
Packit 2fc92b
or
Packit 2fc92b
Packit 2fc92b
    gmake <format> ENTER
Packit 2fc92b
Packit 2fc92b
for FreeBSD, NetBSD, and OpenBSD.  The <format> target is one of the following:
Packit 2fc92b
Packit 2fc92b
- "epm": Builds a script + tarfile package
Packit 2fc92b
- "bsd": Builds a *BSD package
Packit 2fc92b
- "deb": Builds a Debian package
Packit 2fc92b
- "pkg": Builds a Solaris package
Packit 2fc92b
- "rpm": Builds a RPM package
Packit 2fc92b
- "slackware": Build a Slackware package
Packit 2fc92b
Packit 2fc92b
Packit 2fc92b
GETTING DEBUG LOGGING FROM CUPS
Packit 2fc92b
-------------------------------
Packit 2fc92b
Packit 2fc92b
When configured with the `--enable-debug-printfs` option, CUPS compiles in
Packit 2fc92b
additional debug logging support in the scheduler, CUPS API, and CUPS Imaging
Packit 2fc92b
API.  The following environment variables are used to enable and control debug
Packit 2fc92b
logging:
Packit 2fc92b
Packit 2fc92b
- `CUPS_DEBUG_FILTER`: Specifies a POSIX regular expression to control which
Packit 2fc92b
  messages are logged.
Packit 2fc92b
- `CUPS_DEBUG_LEVEL`: Specifies a number from 0 to 9 to control the verbosity of
Packit 2fc92b
  the logging. The default level is 1.
Packit 2fc92b
- `CUPS_DEBUG_LOG`: Specifies a log file to use.  Specify the name "-" to send
Packit 2fc92b
  the messages to stderr.  Prefix a filename with "+" to append to an existing
Packit 2fc92b
  file.  You can include a single "%d" in the filename to embed the current
Packit 2fc92b
  process ID.
Packit 2fc92b
Packit 2fc92b
Packit 2fc92b
REPORTING PROBLEMS
Packit 2fc92b
------------------
Packit 2fc92b
Packit 2fc92b
If you have problems, *read the documentation first*!  If the documentation does
Packit 2fc92b
not solve your problems, please post a message on the users forum at:
Packit 2fc92b
Packit 2fc92b
    https://www.cups.org/
Packit 2fc92b
Packit 2fc92b
Include your operating system and version, compiler and version, and any errors
Packit 2fc92b
or problems you've run into.  The "config.log" file and the output from the
Packit 2fc92b
configure script and make should also be sent, as it often helps to determine
Packit 2fc92b
the cause of your problem.
Packit 2fc92b
Packit 2fc92b
If you are running a version of Linux, be sure to provide the Linux distribution
Packit 2fc92b
you have, too.