Typo
[linux_from_scratch_hints.git] / OLD / printing2.txt
blobd93d24107bfac27f5c9c7c9795acd4f10462646d
1 TITLE:          Printing
2 LFS VERSION:    Any
3 AUTHOR:         Wolfgang Arendt <Wolfgang.Arendt@gmx.de>
5 SYNOPSIS:
6                 Installing printing software on an LFS system
8 HINT:
10 Table of contents
12      * Introduction
13      * Packages
14      * Users and groups
15      * Building gdbm
16      * Building LPRNG
17      * Installing Ghostscript
18      * Installing psutils
19      * Installing a2ps
20      * Installing apsfilter
22 Introduction
24    This document describes all steps, that have to be taken, in order to
25    make an LFS system print. It is based on the printing hint by Fabio
26    Fracassi and on the ghostscript hint written by myself.
28 Packages
30    The basic printing system consists of the following packages:
31      * gdbm-1.8.0.tar.gz: ftp://ftp.gnu.org/gnu/gdbm/
32      * LPRng-3.8.4.tgz: ftp://ftp.lprng.com/pub/LPRng/LPRng/
33      * psutils-p17.tar.gz: ftp://ftp.dcs.ed.ac.uk/pub/ajcd/
34      * a2ps-4.13:a2ps-4.13: ftp://ftp.enst.fr/pub/unix/a2ps/
35      * apsfilter-7.1.1.tar.gz: http://www.apsfilter.org/download/
36      * ghostscript-7.00.tar.gz:
37        http://download.sourceforge.net/ghostscript/
39    We will build LPRNG with gdbm support. It will run as user lp, member
40    of the daemon group. In this example, the GID of the group daemon is 5
41    and so is the UID of the user lp. Please modify all commands to fit
42    your environment. All components will install their configuration into
43    the /etc directory.
45 Users and groups
47    First, check, whether you have a user named lp, that is member of
48    group daemon. If so, then skip the rest of this section.
50    All others create the user with the following commands:
51 groupadd -g 5 daemon
52 useradd -u 5 -d /var/spool/lp -s /bin/sh -g daemon lp
54 Building gdbm
56    The configure script does not seem to recognize the --prefix=...
57    option correctly, so we will manually make an adjustment to the
58    Makefile.
60    Enter:
61 ./configure &&
62 ed Makefile <<EOF
63 /^prefix/s#/local##
66 EOF
67 make &&
68 make install
70 Building LPRNG
72    LPRNG seems to behave a little nasty, if you use optimization higher
73    than O2. You may try to compile it with your usual compiler flags. But
74    if this fails, try "-O2"
76    Build LPRNG with the following commands:
77 ./configure --prefix=/usr \
78   --sysconfdir=/etc \
79   --with-userid=lp \
80   --with-groupid=daemon &&
81 make &&
82 make install
84    Instead of using the start stop script, that comes with LPRng, create
85    such a file from the template.
87 Installing Ghostscript
89    Extract ghostscript and change to the top-level-directory of the
90    distribution. If you use version 5.10 you will find all the source
91    files in that directory. Users of version 6.5 and higher will find
92    subdirectories there, containing the sources, libraries etc.
94    If you can not find a file named unix-gcc.mak in your present
95    directory (which should be gs<VERSION>), then copy it there from the
96    src subdirectory.
98    Stay in the same directory and extract the zlib-package. This creates
99    a directory named zlib-1.1.3. Rename this directory to zlib (or make a
100    symlink).
102    Extract jpegsrc.v6b.tar.gz and rename the jpeg-6b directory to jpeg
103    (or make a symlink).
105    Extract libpng-1.2.1.tar.gz and move the libpng-1.2.1-directory to
106    libpng (or - guess, what - make a symlink).
108    Create the file changes.sed, containing the following lines:
109 s|XINCLUDE=-I/usr/local/X/include|XINCLUDE=-I/usr/X11R6/include|
110 s|XLIBDIRS=-L/usr/X11/lib|XLIBDIRS=-L/usr/X11R6/lib|
111 s|jpeg-6a|jpeg|
112 s|prefix = /usr/local|prefix = /usr|
113 w Makefile
115    Now create the Makefile, by running the following command:
116 sed -n -f changes.sed unix-gcc.mak
118    Now, you should be ready to compile the whole thing. Just run:
119 make &&
120 make install
122    If the compilation fails with error messages, containing something
123    about zdevcal.c, then append the line
124 #include <time.h>
126    to the file src/time_.h and try again. (This might have to do with
127    glibc-2.2.... but I am not sure about it).
129    Finally extract the fonts to the /usr/share/ghostscript directory. The
130    directory structure should look somewhat like this:
131 /usr/share/ghostscript
132 /usr/share/ghostscript/gs7.00
133 /usr/share/ghostscript/fonts
135 Installing psutils
137    The following command will install psutils. It is configured for paper
138    size a4. If you need another media type, then you need to change the
139    line beginning with PAPER= in the Makefile.
140 cp Makefile.unix Makefile &&
141 ed Makefile <<EOF
142 /^BINDIR/s#/local##
143 /^INCLUDEDIR/s#/local##
144 /^PERL/s#/local##
145 /^MANDIR/s#/local##
149 make &&
150 make install
152 Installing a2ps
154    Compile a2ps by entering:
155 ./configure --prefix=/usr \
156   --sysconfdir=/etc \
157   --enable-shared &&
158 make &&
159 make install
161 Installing apsfilter
163    First of all, it has to be said, that apsfilter does not build, if you
164    do not have a mail transfer agent installed, whose binary is linked to
165    /usr/bin/sendmail. If you (like me) have a machine, whithout such
166    program, you can still get apsfilter to compile if you just create a
167    fake sendmail by touching the file named /usr/bin/sendmail and making
168    it executable:
169 touch /usr/bin/sendmail &&
170 chmod 750 /usr/bin/sendmail
172    Then, compile apsfilter by entering
173 ./configure --prefix=/usr \
174   --sysconfdir=/etc &&
175 make &&
176 make install
178    Last thing, that you have to do is, to configure apsfilter using
179    /usr/share/apsfilter/SETUP.