NAME

ppr2samba - Generates Samba configuration files from PPR configuration files

ppd2win95drv - Converts PPD files and generates printers.def for Samba

ppd2windrv - Converts PPD files and modifies Samba 2.2.x Configuration


SYNOPSIS

ppr2samba [--nocreate] [--debug] [--version] [--help]

ppd2win95drv

ppd2windrv


DESCRIPTION

[This manpage is somewhat out of date. An attempt has been made to correct some of the more glaring problems, but it needs a thorough going over.]

These program are designed to make it easier to use PPR with Samba. Samba is an open source file and print server for SMB clients such as Microsoft Windows 95, 98, NT, etc. For information on Samba refer to:

        http://www.samba.org/

The program ppr2samba is used to export PPR's list of printers and groups to a file which Samba can use the share them. This file is called /etc/ppr/smb-include.conf.

The program ppd2win95drv can be used to convert PPR's collection of PPD files to the correct format for Microsoft Windows 95. It also creates a file called printers.def which Samba uses to help Microsoft Windows 95 clients install printer drivers. The converted PPD files are stored in /var/spool/ppr/drivers/WIN40/ and printers.def is stored in the directory /var/spool/ppr/drivers/WIN40. Since ppd2win95drv is a Perl script, you must have Perl installed to use it. The script should work with either Perl 4 or Perl 5.

The program ppd2windrv is a replacement for ppd2win95drv. Together with Samba 2.2.x it allows not only Windows 95 clients, but Windows NT (including 2000 and XP) clients to automatically download printer drivers.

If you add or remove printers from PPR, change their PPD files, or change their descriptive comment strings, it is necessary to rerun ppr2samba so that Samba will perceive the change.

If you add, remove, replace, or modify any of the files in /usr/share/ppr/PPDFiles or add or remove any of the Microsoft Windows 95 PostScript driver files in /var/spool/ppr/drivers/WIN40, or set a printer to use a PPD file which doesn't reside in /usr/share/ppr/PPDFiles, you must rerun ppd2win95drv or ppd2windrv (whichever you are using) to reconfigure the MS-Windows drivers.

Versions of Samba

It is recomended that you use that you use Samba 1.9.18 or later. If you use a version of Samba earlier than that, you must move the ``printing = bsd'' line in the [pprproto] section into the [global] section. You will also find that some of the other configuration lines have no effect. For full automatic installation of drivers on Microsoft Windows 95 clients, 1.9.18p10 or later is recomended.

Changes to Samba

To use PPR with Samba you must add two lines to Samba's configuration file. Samba's configuration file is called smb.conf. It is frequently to be found in the directory /usr/local/samba/lib. Here are the lines:

 include = /usr/lib/ppr/lib/smb-protos.conf
 include = /etc/ppr/smb-include.conf

These lines can go at the end of the file or anywhere between sections but not before the [global] section. The first line includes a file defines some prototype shares which the actual print queue shares use as a source for default values. These prototype shares are [pprproto], and [pprproto_pprpopup]. It also defines two disk shares which PPR uses.

The second line includes the file smb-include.conf which is generated by ppr2samba.

Once you have added these lines you should run ppr2samba to create the initial smb-include.conf.

You should add the name of Samba's guest user to the file /etc/ppr/acl/pprprox.allow. (The name of the user Samba uses for guest logins is set in smb.conf. The default is generally ``nobody''.) If you don't do this, jobs submitted by guest users will appear in the MS-Windows print manager under the name of the Samba guest user and Print Manager will grey out the Document/Delete Document menu item.

In versions of Samba at least as late as 2.0.x you must also copy the ``printer driver file ='' line from the [pprprotos] section of smb-protos.conf to the [global] section of smb.conf. Hopefully we can get a future version of Samba patched so that it is adaquate to have this line in smb-protos.conf with the others.

Contents of smb-protos.conf

When PPR is installed, it installs the lastest version of smb-protos.conf as smb-protos.conf.sample. If you don't have a smb-protos.conf then the sample file is copied to the real one when you run fixup. When you upgrade PPR you should compare the new sample file to the one you are using and incorporate any needed changes.

The [pprproto] section defines commands to submit jobs, delete jobs, list the queue, and so forth. When ppr2samba generates the smb-include.conf file it will place a ``copy ='' line in each section it generates. By default these lines will read ``copy = pprproto'', so the [pprproto] section serves to set default values for PPR shares.

The option ``-X %m@samba'' in the ``print command ='' and ``lprm command ='' lines make sure that a user can only delete his own jobs.

The option ``-f %m'' in the print command causes the name of the sending machine to appear as the user on banner pages and in queue listings. This option will be ignored unless the user name which Samba uses to run ppr under is listed in /etc/ppr/acl/pprprox.allow. That is why it is recomended that you put the name of the Samba guest user in pprprox.allow. That way, guest users can identify themselves for job tracking purposes, but other users will not be able to override their identification.

The options ``-e responder -m samba -r %m'' cause error messages to be sent back to the client through the use of the responder samba. The responder samba uses Samba's smbclient to send a message to the clients messenger service (winpopup on Windows 95).

The ``-U'' option causes the temporary file created by Samba to be deleted after ppr has copied it into the queue.

The option ``-C '''' prevents the job title from defaulting to the file name since the name of the temporary file is not generally meaningful.

The print command is put into the background because it can take a long time to run if certain filters are invoked.

The section [pprproto_pprpopup] is an alternative prototype for PPR shares. If jobs are submitted to a share which uses this prototype, then the wrapper script /usr/lib/ppr/lib/samba_submitter will be used instead of invoking ppr directly. Before using ppr to submit the job, this wrapper script will attempt to contact a program called pprpopup.tcl which is hopefully running on the client. The program pprpopup.tcl is a Tcl/Tk script for use on computers running Windows 95 or NT in public computer rooms. It can ask users to enter their names and it can receive messages which inform users about what happened to their jobs.

If pprpopup.tcl is running on the client, then it will pop up a window which asks the user for his name. The wrapper script will receive the response and use it as the argument for the -f switch when it invokes ppr. It will also use the -m switch to select the pprpopup responder. If pprpopup.tcl is not found to be running on the client, then printing proceeds normally and the samba responder is selected.

To set a printer or group up to use pprpopup.tcl, you must select the prototype [pprproto_pprpopup] instead of [pprproto]. To do this, add this line to the printer or group configuration file:

 ppr2samba-prototype: pprproto_pprpopup

You must rerun ppr2samba for the change to take effect.

The share [pprwin95] contains driver files for downloading by Microsoft Windows 95 computers.

The share [pprclipr] is used by the audio responder and audio commentator when sending a sound file to pprpopup.tcl on a computer running Microsoft Windows 95.

What ppr2samba Does

This program ppr2samba reads the PPR printer and group configuration files and generates the file /etc/ppr/smb-include.conf. The file will contain one Samba printer share definition for each PPR printer or group. (See below for how to exclude printers or groups.)

Since it can only perform one function, and that non-disruptive one, any user may run ppr2samba.

Versions of ppr2samba before 1.40 also generated a file called /etc/ppr/printcap. This was for compatibility with an older and inferior scheme for using Samba and PPR together.

Special Configuration Lines

When ppr2samba is reading printer and group configuration files it recognizes several special configuration lines which only it pays attention to.

One such line is ``ppr2samba:''. This takes a numberic argument. If the argument is non-zero, the printer or group is included in the files generated by ppr2samba, if it is zero it is ommited. If no such line is present, then the printer or group is included. For example, to exclude a printer from sharing by Samba, we add this line to its configuration file:

 ppr2samba: 0

Another such line is ``ppr2samba-prototype:''. This line takes a string argument. This argument is the name of another Samba share that should be used as a prototype for this printer share. By default this is ``pprproto'', a prototype share defined in smb-protos.conf.

To make a printer share use the [pprproto_pprpopup] prototype so that the pprpopup.tcl program running on the client will be contacted to ask the user for his name, put this line in the printer or group configuration file:

 ppr2samba-prototype: pprproto_pprpopup

The ``ppr2samba-prototype:'' line was added in PPR version 1.41. In previous versions, the only way to specify the prototype was as a second argument to the ``ppr2samba:'' line, like this:

 ppr2samba: 1 pprproto_pprpopup

This obsolete format is still supported for compatibility.

Another such line is ``ppr2samba-drivername:'' which can be used to override the value ppr2samba would select for the ``printer driver ='' line in smb-include.conf. For example, to cause clients to use the PPD file for the imaginary printer called ``PPR Generic'', put this line in a printer or group configuration file:

 ppr2samba-drivername: PPR Generic

(Note that the printer PPR Generic is imaginary only in the sense that no hardware with that name actually exists. However, a PPD file describing this hypothetical printer does exist. This PPD file can be used to configure an MS-Windows or Macintosh print driver so that it can invoke certain special features of the PPR feature such as n-up printing.)

Prior to PPR version 1.40, ppr2samba looked for a ``ms-driver-name:'' line. The name of this line was changed to ``ppr2samba-drivername:'' in PPR version 1.40. If any of the old lines are found, ppr2samba will print warnings but will otherwise ignore them.

People who want to share many print queues might also want to know about the ``ppr2samba-vserver:'' line. This takes a numberic argument in the range 1 through 10. If this line is present in a printer's or a group's configuration file, then in addition to writing a section in smb-include.conf, ppr2samba will write a section in one of ten files with names in the form smb-include-N.conf. This will allow you to split your Samba print server up into a number of `virtual servers'. Some people want to do this because under some circumstances there are limits on the size of a single server's browse list. [Unfortunately, the details on how to do this are currently missing from this document. If you are one of the people who requested this feature, please write to <ppr-bugs@mail.trincoll.edu> with a description of how to set up smb.conf for this mode of operation.]

Setting Configuration Lines

If you do not wish to edit the queue's configuration file directly, you can use ppad. For example, to set the ``ppr2samba-drivername:'' line for the printer ``myprn'':

        $ ppad addon ppr2samba-drivername "PPR Generic"

If you later want to remove the option, set it without supplying a value:

        $ ppad addon ppr2samba-drivername

See the ppad man page for general descriptions of the ppad addon, ppad group addon and ppad alias addon commands.

Command Line Options for ppr2samba

The ppr2samba command has an option called --nocreate. When this option is used it will do nothing if smb-include.conf does already exist. This option is used by the PPR WWW administration tools to skip the update of smb-include.conf if the Samba tie-in hasn't been set up.

The --version option prints the PPR version number.

The --debug option turns on messages which describe what ppr2samba is doing.

The --help option prints a brief description of the command line options that ppr2samba accepts.

What ppd2win95drv does.

The program ppd2win95drv is a Perl script which prepares the directory /var/spool/ppr/drivers/WINPPD/ and /var/spool/ppr/drivers/WIN40/ as a directories from which to dispense printer drivers for Microsoft Windows 95.

Setting up this feature is not simple. The reason is that it requires files which may not be distributed with PPR. These files are components of the PostScript driver that comes with Microsoft Windows 95, and the Adobe PostScript driver versions 4.1 and 4.2x. You must obtain the files for the Windows 95 driver or the Adobe 4.1 driver or both. You may also choose to obtain the files for Adobe's 4.2x driver which works with PostScript level 2 printers only.

The driver that comes with Windows 95 is the easiest to get. Install the driver for a PostScript printer on a Windows 95 computer and copy the following files from the SYSTEM directory to /var/spool/ppr/drivers/WIN40 on the PPR server:

        PSCRIPT.DRV
        PSCRIPT.HLP
        FONTS.MFM
        ICONLIB.DLL
        PSMON.DLL
        PSCRIPT.INI

When this is done, run ppd2win95drv. Drag-and-drop printer installation should work now.

Unfortunately, the PostScript driver that comes with Windows 95 has some annoying bugs. Adobe has distributed several later versions that fixes many of them. Version 4.1 from Adobe works with PostScript level 1 and level 2 printers. To obtain it, go to:

http://www.adobe.com/supportservice/custsupport/LIBRARY/pdrvwin.htm

where you will find a link to the driver. While you are there you might as well download the 4.2x driver too. (Note, it appears that Adobe is no longer distributing the version 4.1 driver. This is a pity. Does anyone know of a place from which it may still be downloaded?)

Install the driver on a computer running Windows 95 and then copy these files from the SYSTEM directory to /var/spool/ppr/drivers/WIN40 on the PPR server:

        ADOBEPS4.DRV (rename to ADBEPS41.DRV)
        ADOBEPS4.HLP
        FONTS.MFM
        ICONLIB.DLL
        PSMON.DLL

No you can rerun ppd2win95drv and now when you drag-and-drop a PPR printer share, the newer Adobe driver will be installed instead of the one that came with Windows 95.

The 4.2x Adobe driver is newer than the one we installed above, but it won't work with PostScript level 1 printers. Adobe says that it is not possible to have the 4.1 and the 4.2x drivers installed simulaineously on the same Windows 95 computer because the drivers both have a file called ADOBEPS4.DRV. To get around this we renamed the file from the 4.1 driver in the previous step.

To install the 4.2x driver on the server, install it on a Windows 95 computer as you did with the others. Then copy the following files from the SYSTEM directory to /var/spool/ppr/drivers/WIN40 on the PPR server:

        ADOBEPS4.DRV
        ADOBEPS4.HLP
        ADFONTS.MFM
        ICONLIB.DLL
        PSMON.DLL
        PSCRIPT.INI

then rerun ppd2win95drv. Once this is done, dragg-and-drop installing a printer that supports level 2 PostScript will result in the installation of the 4.2x Adobe driver rather than the 4.1 Adobe driver or the driver that came with Windows 95.

Now that I have lead you through this whole process, I should tell you that there is a batch file called WIN95CP.BAT in the samba/ subdirectory of the PPR source which can be used to copy the files up to the share area if the client it is run on has write access to the pprprnt$ share (otherwise known as /var/spool/ppr/drivers/). You will have to grant such access if you want to use win95cp.bat.


SEE ALSO

Samba's smb.conf(5), ``Installing and Using PPR'', ppr(1).


HISTORY

PPR was written at Trinity College during 1993--2003. It was first released to the public on 26 April 1995.


AUTHORS

David Chappell, Trinity College Computing Center, Hartford, Connecticut.


BUGS

It is necessary to rerun ppr2samba after adding or removing printers and groups or changing PPD files. This should be done automatically.