The Perl script mkprintpkg.pl is used to construct all Samba printing packages. The tool takes several command-line arguments which set information which apply to the entire package and specify where to find the vendor drivers prepared in the previous section. For most vendor drivers, the script will try to infer the majority of the information necessary to build a package. However, in some cases, there may be some information that cannot be automatically determined. In these cases, the package builder must also pass some override options to mkprintpkg.pl to help it along.
The output from mkprintpkg.pl is a gzip-compressed tar file with a name based on the name and version based as options on the command-line. The exact format is NAME-VERSION.tar.gz.
For every Samba printing package, there is some administrative information associated with the entire package regardless of what architectures will be present in the package. Choices must be made for this information whenever a package is built. The information is:
Name of the package. This should be a short name suitable for use in a filename.
Version of the package. This should be any sort of string such as 1.01, 0.2.4, etc. that can denote a standard version number. This string will show up in the final filename of the package so it should be suitable for a filename. It should be noted that the version described here is the version of the Samba Printing Package and not the version of the vendor's drivers.
Display name. This should be a "nice" name for the printer drivers related to the actual type of printer the drivers interface with. It will mainly be used by GUI and command-line packaging tools to display a nice synopsis of the printer package to them. It is not used in the package's final filename.
The choices for these three parameters are just passed to mkprintpkg.pl via the following options:
Table 1. Global Parameter Options
Parameter | Option |
---|---|
Name | --name |
Version | --version |
Display Name | --display-name |
The remaining options arguments to mkprintpkg.pl are either the names of temporary directories constructed in the previous section or the filenames of ZIP archives containing the vendor driver distributions. The tool will try to infer several pieces of information from the vendor driver distributions that are necessary to build and install a Samba printing package. If mkprintpkg.pl is unable to infer the information, you will need to rerun the tool with one of the override options listed later in this section. These override options go before the temporary directory name or archive name to which they will apply. The information that mkprintpkg.pl will try to infer is:
INF file. The INF file is just a plain text file containing a list of files and destination directories that must be installed for the driver to operate. Microsoft Windows normally reads this file when the driver is installed natively on a Windows system. mkprintpkg.pl uses the INF file in a similar manner to identify which files must be copied into the package. The package installer will use the INF file later to copy files into the correct place on the Samba server.
If a single INF file is present, then mkprintpkg.pl will use it automatically. If not, it will abort and display the names of the ones it found. In this case, use the -i override option to choose one of the names.
Manufacturer. The installation instructions in the INF file are indexed by two strings: a manufacturer string and a model string. The [Manufacturer] section of the INF file contains a list of manufacturers. If only a single string is present, then mkprintpkg.pl will use it automatically. If not, it will abort and display the manufacturer strings it found. Use the -m override option in this case to choose one of the manufacturers.
Model. Once mkprintpkg.pl has the right manufacturer, it can obtain a list of printer models associated with that manufacturer from the INF file. If there is only one model, then that model will be chosen automatically. If not, the tool will abort and display the possible model strings that can be used. In this case, use the -d override option to choose one of the models.
Architecture. This is the particular Windows platform that this vendor distribution should be used for. mkprintpkg.pl will normally attempt to guess the architecture from the INF file. However, this will not work in all cases. If the architecture was guessed wrong, then the architecture displayed by mkprintpkg.pl when processing the vendor drivers will be listed incorrectly. No error message will be displayed since it is possible for mkpringpkg.pl to continue with an incorrect guess.
If the tool guesses wrong, you can rerun the tool using the --arch override option to force the selection of a particular architecture. The possible choices that can be passed to the --arch option are:
Table 2. Windows Architecture Choices
Architecture | --arch parameters |
---|---|
Windows 95/98 | win95, win98, WIN40 |
Windows NT X86 | nt, W32X86 |
Windows NT Alpha | nt-alpha, alpha, W32alpha |
Windows NT PowerPC | nt-ppc, ppc, W32ppc |
Windows NT MIPS | nt-mips, mips, W32mips |
All of these override options are described in the examples of the next section.
Here is a quick reference of all available options for mkprintpkg.pl:
Table 3. All Options
Name | Description |
---|---|
--name,-n | Name of the package. |
--version,-v | Version of the package. |
--display-name,-N | Pretty name for the driver(s) in the package. |
--inf-fname,--inf,-i | Override the name of the INF file used for the next driver set. |
--architecture,--arch,-a | Override the architecture used for the next driver set. |
--manufacturer,-m | Override the string used to index into the [Manufacturer] section of the INF file. |
--model,-d | Override the name of model associated with a manufacturer in the next driver set. |
--debug | Make the tool print lots of debugging messages only useful to the developers. |