3 AUTHOR: Wolfgang Arendt <wolare@gmx.de>
6 This hint describes, how to set up basic printing. We are
7 assuming local networking is enabled, sections 9.1 through 9.6
24 * Building Ghostscript
28 * Sources and disclaimer
34 We will build LPRng with gdbm support. It will run as user lp, member
35 of the daemon group. In this example, the GID of the group daemon is 5
36 and so is the UID of the user lp. Please modify all commands to fit
37 your environment. All components will install their configuration into
38 the /etc directory. Moreover we will install Ghostscript as printer
39 driver, assisted by a2ps, the "any to Postscript" converter, apsfilter
44 This hint is a merge of the following documents:
47 by Fabio Fracassi <f.fracassi@gmx.net>
50 by ktb <x.y.f@home.com>
53 by Wolfgang Arendt <wolare@gmx.de>
56 by Wolfgang Arendt <wolare@gmx.de>
60 The basic printing system consists of the following packages:
63 ftp://ftp.gnu.org/gnu/gdbm/
66 ftp://ftp.lprng.com/pub/LPRng/LPRng/
69 ftp://ftp.dcs.ed.ac.uk/pub/ajcd/
72 ftp://ftp.enst.fr/pub/unix/a2ps/
74 apsfilter-7.1.1.tar.gz
75 http://www.apsfilter.org/download/
77 ghostscript-7.00.tar.gz
78 ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/
80 Standard fonts for ghostscript
81 ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/fonts/ghostscript-fonts-std-6.0.tar.gz
83 Optional fonts for ghostscript
84 ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/fonts/ghostscript-fonts-other-6.0.tar.gz
90 You need a supported printer. Check:
92 http://www.linuxprinting.org/printer_list.cgi
94 for a list of supported hardware.
98 You need a kernel with support for the interface, your printer is
99 connected to and printing support in general.
101 To check, whether this is the case, try the following:
103 For a local printer on the first parallel port try:
104 echo "bla\\f" > /dev/lp0
106 The printer should react in any way (to be more precisely: it should
107 print one page with the word "bla" on it).
109 For a networked printer try pinging the IP number of the printer.
111 If one of those worked, you are ready to install the software.
113 If the printer did not respond make sure it is connected to the
114 computer correctly i.e., check cables, make sure the network is
115 working correctly and that there is kernel support for the printer.
117 You can check, whether your kernel supports the parallel port, by
120 cat /usr/src/linux/.config | grep CONFIG_PARPORT
122 You can check, whether you have printing support in the kernel, by
125 cat /usr/src/linux/.config | grep CONFIG_PRINTER
129 The printer daemon should not run as user root for security reasons.
130 Check, whether you have a user named "lp", that is member of the group
131 "daemon". If you do not, create such user, by running
135 useradd -u 5 -d /var/spool/lp -s /bin/sh -g daemon lp
139 In order to build apsfilter, it is necessary, that you have an
140 executable file named "sendmail" in your path. This does not need to
141 be a real mail transfer agent, since apsfilter does not really use it,
142 except for acquiring the apsfilter's author's mail address.
144 You might get along, by creating a faked sendmail, like
146 touch /usr/bin/sendmail &&
147 chmod 750 /usr/bin/sendmail
149 but consider installing a real MTA. If you want an easy solution for a
150 dial-up system, consider Masqmail, which is quite easy to set up. Find
151 Masqmail here: http://www.innominate.org/~oku/masqmail/
153 (please consider, sending the apsfilter's author an email
158 The gdbm database library helps speed up large print jobs.
160 LPRng does not compile unless you have "gdbm" installed. You may
161 choose, not to install it, and to skip this section. In that case, you
162 will have to use "--disable-gdbm" as a "configure" option, when
165 For more information see:
166 * http://www.astart.com/lprng/LPRng-HOWTO.html
167 * http://www.gnu.org/software/gdbm/gdbm.html
169 The configure script does not seem to recognize the "--prefix=..."
170 option correctly, so we will manually make an adjustment to the
186 LPRng seems to behave in an unpredictable way, if you use optimization
187 higher than O2. You may try to compile it with your usual compiler
188 flags. But if this fails, try "-O2"
190 Build LPRng with the following commands:
192 ./configure --prefix=/usr \
195 --with-groupid=daemon &&
199 Instead of using the start stop script, that comes with LPRng, create
200 such a file from the /etc/init.d/template file.
204 Extract the package and change to the top-level-directory of the
205 distribution. If you use version 5.10 you will find all the source
206 files in that directory. Users of version 6.5 and higher will find
207 subdirectories there, containing the sources, libraries etc.
209 If you can not find a file named unix-gcc.mak in your present
210 directory (which should be gs<VERSION>), then copy it there from the
213 Stay in the same directory and extract the zlib-package. This creates
214 a directory named zlib-1.1.3. Rename this directory to zlib (or make a
217 Extract jpegsrc.v6b.tar.gz and rename the jpeg-6b directory to jpeg
220 Extract libpng-1.2.1.tar.gz and move the libpng-1.2.1-directory to
221 libpng (or - guess, what - make a symlink).
223 Create the file changes.sed, containing the following lines:
224 s|XINCLUDE=-I/usr/local/X/include|XINCLUDE=-I/usr/X11R6/include|
225 s|XLIBDIRS=-L/usr/X11/lib|XLIBDIRS=-L/usr/X11R6/lib|
227 s|prefix = /usr/local|prefix = /usr|
230 Now create the Makefile, by running the following command:
232 sed -n -f changes.sed unix-gcc.mak
234 Now, you should be ready to compile the whole thing. Just run:
239 If the compilation fails with error messages, containing something
240 about zdevcal.c, then append the line
244 to the file src/time_.h and try again. (This might have to do with
245 glibc-2.2.... but I am not sure about it).
247 Finally extract the fonts to the /usr/share/ghostscript directory. The
248 directory structure should look somewhat like this:
250 /usr/share/ghostscript
251 /usr/share/ghostscript/gs7.00
252 /usr/share/ghostscript/fonts
256 If you have zlib and libpng installed, you might choose, to use shared
257 versions of the libpng and zlib libraries. In that case, please edit
258 the Makefile, before running "make":
260 Change SHARE_LIBPNG=0 to SHARE_LIBPNG=1.
262 Change SHARE_ZLIB=0 to SHARE_ZLIB=1.
264 Make sure you have the paths to your X libs and X*.h files accessible
265 to the build process. With a default X install they should be in
266 /usr/X11R6/lib and /usr/X11R6/include/X11.
268 Make sure, that the following two lines to are in your
272 /usr/X11R6/include/X11
278 It is possible, to build ghostscript, without having X installed. In
279 that case, edit the Makefile and comment out all the lines, that refer
284 Installing psutils is optional. If you do not install the package, you
285 will get a warning, when you install a2ps. For more information see:
286 http://www.dcs.ed.ac.uk/home/ajcd/psutils/
288 The following command will install psutils. It is configured for paper
289 size a4. If you need another media type, then you need to change the
290 line beginning with PAPER= in the Makefile.
292 cp Makefile.unix Makefile &&
295 /^INCLUDEDIR/s#/local##
306 a2ps is the "Any (graphics format) to Postscript" converter.
308 Compile a2ps by entering:
310 ./configure --prefix=/usr \
318 Apsfilter a filter that runs ghostscript and creates /etc/printcap.
320 Compile apsfilter by entering
322 ./configure --prefix=/usr \
327 The last thing, that you have to do is, to configure apsfilter using
328 /usr/share/apsfilter/SETUP
330 You will be asked a series of questions about printer type, which
331 driver to install, paper size, network connection etc.
333 Sources and disclaimer
335 We certainly do not consider ourselves experts at print installations.
336 This document should give you a good start though. We welcome any
341 02 May 2002. Yoon Soo <yoonsoo@web.de> added:
343 I have an addition which may be interesting for your lfs-hint about
346 It deals with ghostscript-6.51 :
348 If you already have installed zlib and libpng (as described in the
349 blfs book) you can skip the copy of these sources into the ghostscript
350 tree (for jpeg it is strongly recommended to have this statically
353 cp Makefile Makefile.bak
354 sed "60 s/\/usr\/local/\/usr/" Makefile.bak |
355 sed "65 s/\/man/\/share\/man/" |
356 sed "s/SHARE_LIBPNG=0/SHARE_LIBPNG=1/" |
357 sed "s/SHARE_ZLIB=0/SHARE_ZLIB=1/" |
358 sed "263 s/-I/-I\/usr/" > Makefile
364 * http://www.linuxdoc.org/HOWTO/Printing-HOWTO/index.html
365 * http://www.linuxprinting.org/printer_list.cgi