Linux Print Server with Samba & Lexmark 3200

Deutsche Version
Build Ghostscript Configure CUPS Configure Samba-Printserver


Printing with Linux is a hairy thing, especially, when you call a Windows-GDI-Printer your own. The informations here i have partially found out myself, partially discovered via research in the INternet, for Google is my friend, and after that, collected the right info I needed.
IN many mailing lists, you will find: after a long searching and peeking. I hope, with this document, you have less to peek around. In the following text, I refer to SuSE Linux 7.2 and Ghostscript 5.50.

I asume you know enough about Unix/Linux to know what I talk about. Unix is cool!

Questions, Comments: Mail!

For unpacking *.tar.gz-Files, say "TARBALLS",use the command tar -zvxf *.tar.gz. Replace the asterisk with the name of the tarball. For unpacking *.tar.bz2-Files use the command tar -jvxf *.tar.bz2.

Requisites you need:

Downloads for Lexmark-Ghostscript: lxm3200.sourceforge.net

I have buildt should-be-compileable-without-problems TARBALLS:
gs5.50-Source+lxm32-driver with Patch f. Lexmark Z12 & Lexmark Z31

gs7.05-Source+lxm32-driver without patch

GS-lxm3200-Treiber with Patches for Lexmark Z12 & Lexmark Z31

The Patch for Lexmark Z12 is by Boer Attila . The Patch for Lexmark Z31 is byTomas Groth.

Special: Gimp-Print 4.3.4 LExmark 3200 Printer driver

Now do as follows:

Building Ghostscript Configure CUPS Configure Samba-Printserver
Ghostscript-Installation:

1. Install ghostscript on the linux box.

2. Untar lxm3200-0.4.1-gs5.50-bin.tar.gz in a temporary directory of your choice.

3.Create the following soft links:


If setting the soft links does not work, create the subdirectories /usr/share/fonts and /usr/share/fonts/default with the command mkdir.

4. Change to the Directory of the Ghostscript-Binary with the compiled in Lexmark 3200-Driver and execute the install-Script.

5. With gs -h|grep -lxm, you can look, if the compiled in printer driver for Lexmark is present in Ghostscript.

6. Execute this command: gs -q -dNOPAUSE -dSAFER -sOutputFile=/tmp/lexmark.test -sDEVICE=lxm3200 /usr/share/doc/packages/ghostscript/examples/colorcir.ps quit.ps. A long mess of messages spewn out by ghostscript, should appear on the screen. After it has finished work, execute cat /tmp/lexmark.test>/dev/lp0 (change device, if neccessary!). Yor Lexmark should come to life very quick - and print.

Hints for compiling: untar the file lxm3200-0.4.1-gs5.50-src.tar.gz. get and unpack a source distribution of ghostscript v5.50. Open the README-File of the lxm3200-driver and let it open. Put the sourcecode "gdevlx32.c" in the root directory of GS5.50 (./src in other versions of ghostscript - see below). The Lines from "LEXMARK 3200 DEVICE til "add everything up to here, this line excluded", you shall copy in the file contrib.mak of GS5.50. Attention: Do the indents with TAB (via VI/EMACS!). In the file unix-gcc.mak, append "lxm3200.dev" to the line beginning with "dev6". An exact howto for that is included inthe README-File.

The Difficulties begin on compilation: You have to contribute an actual libpng as wall as a libjpg. Those Libraries you have to untar and copy into the root directory of the gs5.50 distribution. Rename the directories to libpng or libjpeg respectively - without any version numbers! In case of the libpng 1.2.1, there is some work to be done in the libpng.mak: You have to declare the new version number, because otherwise the make-script does not find a rule for building the libpng for GS. In the file unix-gcc.mak, declare the libraries as explained in the Documentation for compiling GS.

Compilation is started with make -f unix-gcc.mak. The Compiler will quit building some source-files with ERROR. In those cases I have helped out by adding a line #include < time.h > before the line #include "time_.h" in the corresponding files. This has stopped such compiler errurs successfully.

This shall the unix-gcc.mak-file look like at the point, where you declare libpng,libjpeg,libz for compilation:


This way you declare the libpng in the libpng.mak-file, so that th make-command can find a rule for building the libpng:


Ad GNU-Ghostscript-7.05:
With this version of ghostscript, compilation is less nastier: For adding the Lexmark 3200 driver, you have to:



If it doesn't run as expected: Turn your parallel-Port on Mode EPP. I have seen, that parport_probe recognized the printer and inserted it in /proc/parport/0/autoprobe without problems. You can trace the printers state with tunelp /dev/lp0 -s -qon

building Ghostscript configure CUPS configure Samba-Printserver
CUPS-Printer Configuration

With the cups-webinterface at http://localhost:631/, the printer can be configured very conveniently for cps-daemon. The following steps are to be done:
1. Make the Webinterface accessible freely: I understand normal Paranoia, but for experimenting, login procedures are not necessary.
The following excerpts of the cupsd.conf-file are shortened. I have removed the comments.

Virgin cupsd.conf-file at point "AUTHENTICATION".

Changed copsd.conf-file at point "AUTHENTICATION". I have commented out the Auth-Types and said "Allow ALL".

Let's RemoteRoot be ROOT, so you have less obstacles whilst working with the Webinterface.

After having edited these files restart cupsd with rccups restart.
2. COnfigure the Printer via CUPS Web-Interface.
Step 1:


Step 2:


Step 3:


Step 4:


Step 5:


Step 6:


Step 7:


those seven steps you can perform for any printer.

Building Ghostscript Configure CUPS Configure Samba-Printserver
Samba-Printer-Share for Windows-Clients
1. Declare a Printer share pointing to the Printer as well as to the DRIVER Share for Win Clients to automatically Retrieve Driver stuff upon adding the Printer.
[drucker]
2. Declare a share named printer$,which is nonbrowseable,nonwriteable, accessible for guests. (p.ex. /usr/share/samba/printer - Driver directory)
[PRINTER$]
in windows:
3. Install some Postscript driver (some Apple Color Laser Printer: Apple Color LW 12/660 PS ) on the windows client (W2K Prof). As this printer is in the normal windows printer driver library, the definiion for this driver is to be found in the file "ntprint.inf". Have the Win2K Box do the searching for you. It should be in C:\WINNT\inf - a hidden directory! Copy the File to the root of your samba share: switch to the linux Box, go to the corresponding directory and test the file with grep "[desired printer driver]" for Existence of a Driver definition. If it does not find anything this is either cuz the file is spilled with ^@-Signs or there is no existing driver definition. Given the first case, switch back to the W2K-Box, open the file "ntprint.inf" on the samba share with the wordpad and save it back: upon save, wordpad asks for encoding of the file - Choose ascii, and the gibberish is gone and the grep for our APPLE-Printer does a good job.

in linux:
4. Go to the Directory, where the ntprint.inf is located. execute the following:
make_printerdef ntprint.inf "Apple Color LW 12/660 PS" > printers.def
This command spills out the printers.def file as well as a list of driver files needed to be copied from the w2k box: in our example:
they are to be found here in most cases:
C:\WINNT\system32\spool\drivers\w32x86\[1 .. n]

5. Copy the above mentioned files as well as the printers.def file to the directory you have choosen in the samba share [printer$].
In our example: /usr/share/samba/printers.

6. execute some "rcsmb restart" command to restart the smb daemons.

7. Switch to the w2k-box, delete the locally installed printer, go to the "Network neighbourhood", select your samba server: Here should be the new created printer: Select it, and it should download/install the driver without much asking and you should be able to print. Mark: This does not care about the model of printer that is connected to the server. If the Server translates the postscript for any non postscript (even a lexmark 3200) printer via ghostscript, there is no problem.

This Description is executed/tested on SuSE Linux 7.2 / Samba 2.2.3 / Cups 1.0.6 / Ghostscript 7.05 & gdevlx32.x - Printer: Lexmark 3200.