Last update before x-mas: CUPSprinting hint...

alex at alex at
Fri Dec 20 03:56:47 PST 2002

Ho Ho Ho Ho!

An early christmas present for you - I made some preliminary updates on
my CUPSprinting hint. Find it attached.

Merry Christmas and a Happy New Year!

-------------- next part --------------
TITLE:		Printing on LFS using CUPS
AUTHOR:		Alex Kloss <l.x. at>

	Short Guide how to set up the necessary software to print using
	ghostscript, psutils, a2ps, foomatic and CUPS, Samba and Gimp-
	Print as an Option.

	This is a short Hint based on other printing hints, which did
	not work for me properly. Another reason for using CUPS instead
	of LPRng is the better KDE integration since 2.2. I don't claim
	to deliver a perfect hint, but with you help, we can get it
	there. Gimp Print is an useful addition if you're using Inkjet
	Color Printers, because you'll get better quality in some cases.

	Your favourite flavour of Ghostscript:
	look at, check mirror sites.

	I prefer using AFPL Ghostscript 8.00, obtainable on, but any other
	Version should do, too. You should also obtain a package of the
	necessary type1-fonts, e.g. GNU-ghostscript-fonts.

	Since Version 1.1.15, CUPS no longer includes the PS RIP filter
	called pstoraster. So you need some ghostscript version that
	provides as cups raster driver. ATM, GNU ghostscript DOES NOT
	HAVE such a backend. So you're better off with AFPL or EPS

	You'll also need 
	libjpeg (,,
	and libpng (,




	or search your local gnome mirror.

	look on this page for your nearest mirror.

	look on this page for your nearest mirror.

	and, if you want it


	Actual Versions (AFPL 8.00, GNU 7.05, ESP 7.05.5) have a
	./configure script that enables Ghostscript to use the system
	libraries, so you don't need their sources to be around on the
	Ghostscript installation anymore. Just type:

	./configure --prefix=/usr &&
	make &&
	make install
	If you encounter problems about HAVE_SYS_TIME_H to be rede-
	fined, run the following script. Never versions of Ghostscript
	shouldn't show that behaviour anymore, but you never know:

	for file in src/*.c
	  timeinc=`cat $file | grep time_.h`
	  if [ -n "$timeinc" ]
	    mv $file $file.old
	    cat $file.old | \
	    sed $'/#include "time_.h"/a \\\n#include "time.h"' \
	    > $file

	and retry "make && make install". It should work now.

	Afterwards, install the fonts into the right dir (if you've
	chosen the prefix "/usr", it should be "/usr/share/ghostscript",
	otherwise read the docs	of your ghostscript release to find out 


	cp Makefile.unix Makefile

	Edit the Makefile for preferred prefix, includedir and mandir.

	make &&
	make install

	if mkdir gives errors about being unable to create existent
	directories, don't mind.


	./configure --prefix=/usr --enable-paths=yes && 
	make && 
	make install

	did the job for me.


	foomatic will require libxml2. Since this is bl**dy easy to
	install, I won't lose a word on it, here.

	./configure --prefix=/usr &&
	make &&
	make install

	Look on for documentation about
	how to configure it.


	./configure && 
	make && 
	make install

	should be enough. You can add options like --with-openssl if
	you want (then you need to read the openssh hint before).

	I dislike the start/stop script cups comes with. So I remade it
	and composed a new one loosely after it, but w/o unnecessary
	stuff. It looks like that:

# "$Id:,v 1.12 2001/05/21 21:32:50 mike Exp $"
#   Startup/shutdown script for the Common UNIX Printing System (CUPS).
#   Copyright 1997-2001 by Easy Software Products, all rights reserved.
#   Slightly changed by Alex Kloss to fit into the LFS bootup
# Start or stop the CUPS server based upon the first argument to the script.

source /etc/init.d/functions

case $1 in
		echo -n "Starting CUPS Printserver..."
		loadproc /usr/sbin/cupsd
                echo -n "Stopping CUPS Printserver..."
                killproc cupsd

                echo -n "Reloading CUPS Printserver..."
                reloadproc /usr/sbin/cupsd

                $0 stop
                /usr/bin/sleep 1
                $0 start

                statusproc cupsd

                echo "Usage: $0 {start|stop|reload|restart|status}"
                exit 1

# end of cups startup script.

	You don't need to replace the script, but I like it better like
	this. So I added it to the hint.


	You can install samba yourself. Look at "./configure --help",
	there are some nice options, you possibly want to select. To
	use CUPS for printing on a samba printer you need to

	ln -s `whereis smbspool` /usr/lib/cups/backend/smb

	Next, you can install samba printers.

	If you need help on CUPS, try http://localhost:631


	Remember you only need that if you want the advanced drivers
	(especially a quality improvement for inkjet printers).

	./configure --prefix=/usr --with-cups --with-ghost &&
	make &&
	make install

	/etc/init.d/cups restart

Hope this was helpful.
Thanks to the help of the #lfs channel.
Alex Kloss (LX on #lfs on

More information about the hints mailing list