]> git.ipfire.org Git - thirdparty/cups.git/blame - INSTALL.md
Update INSTALL.md (Issue #5116)
[thirdparty/cups.git] / INSTALL.md
CommitLineData
fd2f0a7a 1INSTALL - CUPS v2.2.5 - 2017-09-25
2a20b512
MS
2==================================
3
4This file describes how to compile and install CUPS from source code. For more
5information on CUPS see the file called "README.txt". A complete change log can
6be found in "CHANGES.txt".
7
fd2f0a7a
MS
8Using CUPS requires additional third-party support software and printer drivers.
9These are typically included with your operating system distribution. Apple
10does not endorse or support third-party support software for CUPS.
11
12> Note: Current versions of macOS DO NOT allow installation to /usr with the
13> default System Integrity Protection (SIP) settings. In addition, we do not
14> recommend replacing the CUPS supplied with macOS because:
15>
16> a. not all versions of CUPS are compatible with every macOS release,
17>
18> b. code signing prevents replacement of system libraries and access to the
19> system keychain (needed for encrypted printer sharing), and
20>
21> c. software updates will often replace parts of your local installation,
22> potentially rendering your system unusable.
2a20b512
MS
23
24
25BEFORE YOU BEGIN
26----------------
27
28You'll need ANSI-compliant C and C++ compilers, plus a make program and POSIX-
29compliant shell (/bin/sh). The GNU compiler tools and Bash work well and we
30have tested the current CUPS code against several versions of GCC with excellent
31results.
32
33The makefiles used by the project should work with most versions of make. We've
34tested them with GNU make as well as the make programs shipped by Compaq, HP,
35SGI, and Sun. BSD users should use GNU make (gmake) since BSD make does not
36support "include".
37
38Besides these tools you'll want ZLIB library for compression support, the GNU
39TLS library for encryption support on platforms other than iOS, macOS, or
40Windows, and either MIT (1.6.3 or higher) or Heimdal Kerberos for Kerberos
41support. CUPS will compile and run without these, however you'll miss out on
42many of the features provided by CUPS.
43
bb719eb3
MS
44On a stock Ubuntu install, the following command will install the required
45prerequisites:
46
47 sudo apt-get install autoconf build-essential libavahi-client-dev \
48 libgnutls28-dev libkrb5-dev libnss-mdns libpam-dev \
49 libsystemd-dev libusb-1.0-0-dev zlib1g-dev
50
2a20b512
MS
51Also, please note that CUPS does not include print filters to support PDF or
52raster printing. You *must* download GPL Ghostscript and/or the Open Printing
53CUPS filters package separately to print on operating systems other than macOS.
54
55
56CONFIGURATION
57-------------
58
59CUPS uses GNU autoconf, so you should find the usual "configure" script in the
60main CUPS source directory. To configure CUPS for your system, type:
61
62 ./configure
63
64The default installation will put the CUPS software in the "/etc", "/usr", and
65"/var" directories on your system, which will overwrite any existing printing
fd2f0a7a 66commands on your system. Use the `--prefix` option to install the CUPS software
2a20b512
MS
67in another location:
68
69 ./configure --prefix=/some/directory
70
fd2f0a7a
MS
71> Note: Current versions of macOS DO NOT allow installation to /usr with the
72> default System Integrity Protection (SIP) settings.
73
74To see a complete list of configuration options, use the `--help` option:
2a20b512
MS
75
76 ./configure --help
77
78If any of the dependent libraries are not installed in a system default location
79(typically "/usr/include" and "/usr/lib") you'll need to set the CFLAGS,
80CPPFLAGS, CXXFLAGS, DSOFLAGS, and LDFLAGS environment variables prior to running
81configure:
82
83 setenv CFLAGS "-I/some/directory"
84 setenv CPPFLAGS "-I/some/directory"
85 setenv CXXFLAGS "-I/some/directory"
86 setenv DSOFLAGS "-L/some/directory"
87 setenv LDFLAGS "-L/some/directory"
88 ./configure ...
89
90or:
91
92 CFLAGS="-I/some/directory" \
93 CPPFLAGS="-I/some/directory" \
94 CXXFLAGS="-I/some/directory" \
95 DSOFLAGS="-L/some/directory" \
96 LDFLAGS="-L/some/directory" \
97 ./configure ...
98
fd2f0a7a 99The `--enable-debug` option compiles CUPS with debugging information enabled.
2a20b512 100Additional debug logging support can be enabled using the
fd2f0a7a
MS
101`--enable-debug-printfs` option - these debug messages are enabled using the
102`CUPS_DEBUG_xxx` environment variables at run-time.
2a20b512
MS
103
104CUPS also includes an extensive set of unit tests that can be used to find and
105diagnose a variety of common problems - use the "--enable-unit-tests" configure
106option to run them at build time.
107
fd2f0a7a 108On macOS, use the `--with-archflags` option to build with the correct set of
2a20b512
MS
109architectures:
110
111 ./configure --with-archflags="-arch i386 -arch x86_64" ...
112
2a20b512
MS
113Once you have configured things, just type:
114
115 make ENTER
116
117or if you have FreeBSD, NetBSD, or OpenBSD type:
118
119 gmake ENTER
120
121to build the software.
122
123
124TESTING THE SOFTWARE
125--------------------
126
127Aside from the built-in unit tests, CUPS includes an automated test framework
128for testing the entire printing system. To run the tests, just type:
129
130 make check ENTER
131
132or if you have FreeBSD, NetBSD, or OpenBSD type:
133
134 gmake check ENTER
135
136The test framework runs a copy of the CUPS scheduler (cupsd) on port 8631 in
137/tmp/cups-$USER and produces a nice HTML report of the results.
138
139
140INSTALLING THE SOFTWARE
141-----------------------
142
143Once you have built the software you need to install it. The "install" target
144provides a quick way to install the software on your local system:
145
146 make install ENTER
147
148or for FreeBSD, NetBSD, or OpenBSD:
149
150 gmake install ENTER
151
152Use the BUILDROOT variable to install to an alternate root directory:
153
154 make BUILDROOT=/some/other/root/directory install ENTER
155
156You can also build binary packages that can be installed on other machines using
157the RPM spec file ("packaging/cups.spec") or EPM list file
158("packaging/cups.list"). The latter also supports building of binary RPMs, so
159it may be more convenient to use.
160
161You can find the RPM software at:
162
163 http://www.rpm.org/
164
165The EPM software is available at:
166
167 https://michaelrsweet.github.io/epm
168
169
170CREATING BINARY DISTRIBUTIONS WITH EPM
171--------------------------------------
172
173The top level makefile supports generation of many types of binary distributions
174using EPM. To build a binary distribution type:
175
176 make <format> ENTER
177
178or
179
180 gmake <format> ENTER
181
182for FreeBSD, NetBSD, and OpenBSD. The <format> target is one of the following:
183
184- "epm": Builds a script + tarfile package
185- "bsd": Builds a *BSD package
186- "deb": Builds a Debian package
187- "pkg": Builds a Solaris package
188- "rpm": Builds a RPM package
189- "slackware": Build a Slackware package
190
191
192GETTING DEBUG LOGGING FROM CUPS
193-------------------------------
194
fd2f0a7a 195When configured with the `--enable-debug-printfs` option, CUPS compiles in
2a20b512
MS
196additional debug logging support in the scheduler, CUPS API, and CUPS Imaging
197API. The following environment variables are used to enable and control debug
198logging:
199
200- `CUPS_DEBUG_FILTER`: Specifies a POSIX regular expression to control which
201 messages are logged.
202- `CUPS_DEBUG_LEVEL`: Specifies a number from 0 to 9 to control the verbosity of
203 the logging. The default level is 1.
204- `CUPS_DEBUG_LOG`: Specifies a log file to use. Specify the name "-" to send
205 the messages to stderr. Prefix a filename with "+" to append to an existing
fd2f0a7a
MS
206 file. You can include a single "%d" in the filename to embed the current
207 process ID.
2a20b512
MS
208
209
210REPORTING PROBLEMS
211------------------
212
fd2f0a7a 213If you have problems, *read the documentation first*! If the documentation does
2a20b512
MS
214not solve your problems, please post a message on the users forum at:
215
216 https://www.cups.org/
217
218Include your operating system and version, compiler and version, and any errors
219or problems you've run into. The "config.log" file and the output from the
220configure script and make should also be sent, as it often helps to determine
221the cause of your problem.
222
223If you are running a version of Linux, be sure to provide the Linux distribution
224you have, too.