Typo
[linux_from_scratch_hints.git] / OLD / cups-printing.txt
blobeb24b355a55d046bcf4ba2babaa2a96d4746e3a2
1 TITLE:          Printing on LFS using CUPS
2 LFS VERSION:    any
3 AUTHOR:         Alex Kloss <l.x.@gmx.de>
5 SYNOPSIS:
6         Short Guide how to set up the necessary software to print using
7         ghostscript, psutils, a2ps, foomatic and CUPS, Samba and Gimp-
8         Print as an Option.
10 HINT:   
11         This is a short Hint based on other printing hints, which did
12         not work for me properly. Another reason for using CUPS instead
13         of LPRng is the better KDE integration since 2.2. I don't claim
14         to deliver a perfect hint, but with you help, we can get it
15         there. Gimp Print is an useful addition if you're using Inkjet
16         Color Printers, because you'll get better quality in some cases.
18 DOWNLOADS:
19         Your favourite flavour of Ghostscript:
20         look at http://www.cs.wisc.edu/~ghost/, check mirror sites.
22         I prefer using AFPL Ghostscript 8.00, obtainable on
23         ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/, but any other
24         Version should do, too. You should also obtain a package of the
25         necessary type1-fonts, e.g. GNU-ghostscript-fonts.
27         Since Version 1.1.15, CUPS no longer includes the PS RIP filter
28         called pstoraster. So you need some ghostscript version that
29         provides as cups raster driver. ATM, GNU ghostscript DOES NOT
30         HAVE such a backend. So you're better off with AFPL or EPS
31         ghostscript.
33         You'll also need 
34         libjpeg (http://www.ijg.org, ftp://ftp.uu.net/graphics/jpeg),
35         and libpng (http://libpng.sourceforge.net, 
36         ftp://swrinde.nde.swri.edu/pub/png)
38         psutils:
39         ftp.dcs.ed.ac.uk/pub/ajcd/
41         a2ps:
42         http://www.inf.enst.fr/~demaille/a2ps/
43         ftp://ftp.enst.fr/pub/unix/a2ps/
45         foomatic:
46         http://www.linuxprinting.org/download/foomatic/
48         libxml2:
49         http://ftp.gnome.org/pub/GNOME/sources/libxml2/2.4/
50         or search your local gnome mirror.
52         cups:
53         www.cups.org
54         look on this page for your nearest mirror.
56         samba:
57         http://www.samba.org
58         look on this page for your nearest mirror.
60         and, if you want it
62         gimp-print:
63         http://gimp-print.sourceforge.net
65 INSTALL:
66         Ghostscript:
67         
68         Actual Versions (AFPL 8.00, GNU 7.05, ESP 7.05.5) have a
69         ./configure script that enables Ghostscript to use the system
70         libraries, so you don't need their sources to be around on the
71         Ghostscript installation anymore. Just type:
73         ./configure --prefix=/usr &&
74         make &&
75         make install
76         
77         If you encounter problems about HAVE_SYS_TIME_H to be rede-
78         fined, run the following script. Never versions of Ghostscript
79         shouldn't show that behaviour anymore, but you never know:
81         for file in src/*.c
82         do
83           timeinc=`cat $file | grep time_.h`
84           if [ -n "$timeinc" ]
85           then
86             mv $file $file.old
87             cat $file.old | \
88             sed $'/#include "time_.h"/a \\\n#include "time.h"' \
89             > $file
90           fi
91         done
93         and retry "make && make install". It should work now.
95         Afterwards, install the fonts into the right dir (if you've
96         chosen the prefix "/usr", it should be "/usr/share/ghostscript",
97         otherwise read the docs of your ghostscript release to find out 
98         which).
101         psutils:
103         cp Makefile.unix Makefile
105         Edit the Makefile for preferred prefix, includedir and mandir.
107         make &&
108         make install
110         if mkdir gives errors about being unable to create existent
111         directories, don't mind.
114         a2ps:
116         ./configure --prefix=/usr --enable-paths=yes && 
117         make && 
118         make install
120         did the job for me.
123         foomatic:
125         foomatic will require libxml2. Since this is bl**dy easy to
126         install, I won't lose a word on it, here.
128         ./configure --prefix=/usr &&
129         make &&
130         make install
132         Look on http://www.linuxprinting.org for documentation about
133         how to configure it.
136         cups:
138         ./configure && 
139         make && 
140         make install
142         should be enough. You can add options like --with-openssl if
143         you want (then you need to read the openssh hint before).
145         I dislike the start/stop script cups comes with. So I remade it
146         and composed a new one loosely after it, but w/o unnecessary
147         stuff. It looks like that:
149 #!/bin/sh
151 # "$Id: cups-printing.txt,v 1.1 2003/09/13 16:18:12 tushar Exp $"
153 #   Startup/shutdown script for the Common UNIX Printing System (CUPS).
155 #   Copyright 1997-2001 by Easy Software Products, all rights reserved.
157 #   Slightly changed by Alex Kloss to fit into the LFS bootup
160 # Start or stop the CUPS server based upon the first argument to the script.
163 source /etc/init.d/functions
165 case $1 in
166         start)
167                 echo -n "Starting CUPS Printserver..."
168                 loadproc /usr/sbin/cupsd
169                 ;;
170         stop)
171                 echo -n "Stopping CUPS Printserver..."
172                 killproc cupsd
173                 ;;
175         reload)
176                 echo -n "Reloading CUPS Printserver..."
177                 reloadproc /usr/sbin/cupsd
178                 ;;
180         restart)
181                 $0 stop
182                 /usr/bin/sleep 1
183                 $0 start
184                 ;;
186         status)
187                 statusproc cupsd
188                 ;;
190         *)
191                 echo "Usage: $0 {start|stop|reload|restart|status}"
192                 exit 1
193                 ;;
194 esac
196 # end of cups startup script.
198         You don't need to replace the script, but I like it better like
199         this. So I added it to the hint.
202         samba:
204         You can install samba yourself. Look at "./configure --help",
205         there are some nice options, you possibly want to select. To
206         use CUPS for printing on a samba printer you need to
208         ln -s `whereis smbspool` /usr/lib/cups/backend/smb
210         Next, you can install samba printers.
212         If you need help on CUPS, try http://localhost:631
215         gimp-print:
217         Remember you only need that if you want the advanced drivers
218         (especially a quality improvement for inkjet printers).
220         ./configure --prefix=/usr --with-cups --with-ghost &&
221         make &&
222         make install
224         /etc/init.d/cups restart
226 Hope this was helpful.
227 Thanks to the help of the #lfs channel.
228 Alex Kloss (LX on #lfs on irc.linuxfromscratch.org)