File: distributing.html

package info (click to toggle)
cupsddk 1.2.3-5
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 4,488 kB
  • ctags: 1,125
  • sloc: ansic: 7,074; cpp: 5,423; makefile: 526; xml: 227; sh: 153
file content (151 lines) | stat: -rw-r--r-- 7,712 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<HTML>
<BODY>

<H1 ALIGN="RIGHT"><A NAME="DISTRIBUTING">7 - Distributing Printer Drivers</A></H1>

<P>This chapter describes how to upload PPD files to the CUPS web site and package your printer drivers for Linux and Mac OS X.</P>

<H2>Uploading PPD Files to the CUPS Web Site</H2>

<P>The easiest way to distribute your printer drivers is to upload your PPD files to the printer driver page on the CUPS web site (www.cups.org). This page provides an on-line printer driver database where CUPS users can search for and download PPD files for PostScript and CUPS/CUPS DDK-supported printers.</P>

<P>To upload PPD files for other CUPS users to download, click on the "Submit Printer Driver" link to start the registration process.</P>

<H2>Creating Printer Driver Packages</H2>

<P>If you will be distributing printer drivers from your own web site or on physical media, or if your printer drivers require one or more custom filter, port monitor, or backend programs, create packages containing the drivers so that users can install and remove the drivers as needed.</P>

<!-- NEED 10 -->
<CENTER><TABLE WIDTH="80%" BORDER="1" CELLPADDING="5" CELLSPACING="0">
<CAPTION ALIGN="BOTTOM"><A NAME="TABLE7-1"><I>Table 7-1, Installation Directories</I></A></CAPTION>
<TR BGCOLOR="#cccccc">
	<TH>Operating System</TH>
	<TH>PPD Directory</TH>
	<TH>Filter Directory</TH>
</TR>
<TR>
	<TD>Linux i386</TD>
	<TD><VAR>/usr/share/cups/model/<B>vendor</B></VAR></TD>
	<TD><VAR>/usr/lib/cups/filter</VAR></TD>
</TR>
<TR>
	<TD>Linux x86_64</TD>
	<TD><VAR>/usr/share/cups/model/<B>vendor</B></VAR></TD>
	<TD><VAR>/usr/lib/cups/filter</VAR> or <VAR>/usr/lib64/cups/filter</VAR></TD>
</TR>
<TR>
	<TD>Mac OS X</TD>
	<TD><VAR>/Library/Printers/PPDs/ Contents/Resources/en.lproj</VAR></TD>
	<TD><VAR>/usr/libexec/cups/filter</VAR></TD>
</TR>
</TABLE></CENTER>

<P>Printer drivers are typically distributed as RPM packages on Linux or Installer packages on Mac OS X. Each package typically installs PPD files (or <a href="#DRV">driver information files </a>, as described later) and filter/driver programs in the corresponding directories. <A HREF="#TABLE7-1">Table 7-1</A> lists the directories to use on each operating system.</P>

<P>If you will be distributing drivers for the Linux x86_64 platform, please see the section on <A HREF="#X86_64">"Packaging Issues on Linux"</A> later in this chapter as well.</P>

<H3>Tools for Creating Packages</H3>

<P>Aside from the <tt>rpmbuild(8)</tt> and <tt>PackageMaker</tt> tools that come with Linux and Mac OS X, respectively, we recommend using our (free) ESP Package Manager (EPM) software to create your driver packages:</P>

<PRE>
    http://www.easysw.com/epm
</PRE>

<P>EPM creates both RPM and Installer format packages, as well as several other common formats. It can also insulate you from system-specific packaging details that can lead to inconsistent package quality.</P>

<H3>Creating Driver Packages with EPM</H3>

<P>EPM works with "list" files. A list file literally lists the files you want to package along with common information such as the version of the package, a human-readable description of the package contents, and so forth. <A HREF="#LISTING7-1">Listing 7-1</A> provides an example list file for a driver package consisting of one filter program called <var>rastertofoo</var> and three PPD files. 

<P>The list file starts with the common informations (lines 1-8). Lines 12-14 and 16-18 define the installation directories for Mac OS X and Linux, respectively. Lines 20-25 implement one of the suggested workarounds for supporting Linux on the x86_64 platform. Finally, lines 30-33 list the files we want in the package along with the permissions and ownership. The destination filename is listed first, followed by the source filename relative to the current directory.</P>

<P>You can then create the package using the <tt>epm(1)</tt> command. For example, type the following command to create a driver package called "foo" using the native packaging format on your system:</P>

<PRE>
    epm -f native foo foo.list
</PRE>

<H3>Packaging Drivers Using Standard CUPS Drivers</H3>

<P>When packaging drivers that use the DDK or CUPS sample drivers, we recommend creating packages that depend on the corresponding CUPS or CUPS DDK software rather than bundling your own copies. For the CUPS DDK software, we recommend downloading and redistributing the packages from the CUPS web site (www.cups.org).</P>

<P>If you are using EPM to create your driver packages on Linux, add the following lines to your list file:</P>

<PRE>
    %system linux
    %requires cupsddk-drivers
    %system
</PRE>

<P>These will ensure that the CUPS DDK drivers are installed on the system.</P>

<H3><A NAME="X86_64">Packaging Issues on Linux</A></H3>

<P>Because the CUPS packages provided on the Linux x86_64 platform can use one of two different directories for any filter programs, we recommend installing to <VAR>/usr/lib/cups/filter</VAR> and including the following pre-install command to ensure that at symlink is present from <VAR>/usr/lib/cups</VAR> to <VAR>/usr/lib64/cups</VAR> on systems that use <VAR>/usr/lib64/cups/filter</VAR>:</P>

<PRE>
    if test -d /usr/lib64/cups -a ! -d /usr/lib/cups; then
        ln -s /usr/lib64/cups /usr/lib
    fi
</PRE>

<P>Another option is to install your Linux drivers in <VAR>/opt/<B>vendor</B>/filter</VAR> and then reference that directory in the <tt>cupsFilter</tt> attributes of your PPD files, for example:</P>

<PRE>
    <I>// Attribute as it appears in the driver information file...</I>
    Attribute cupsFilter "" ""
              "application/vnd.cups-raster - /opt/vendor/filter"

    <I>*% Attribute as it appears in the PPD file:</I>
    *cupsFilter: "application/vnd.cups-raster - /opt/vendor/filter"
</PRE>

<!-- NEW PAGE -->
<CENTER><TABLE BORDER="1" BGCOLOR="#cccccc" CELLPADDING="5" CELLSPACING="0" WIDTH="80%">
<CAPTION ALIGN="BOTTOM"><A NAME="LISTING7-1"><I>Listing 7-1, Sample EPM List File</I></A></CAPTION>
<TR><TD><PRE>
 1  # Standard package information
 2  %product Foo Printer Drivers
 3  %copyright 2007 by Foo Industries, Inc.
 4  %vendor Foo Industries, Inc.
 5  %license license.txt
 6  %readme readme.txt
 7  %description Foo Printer Drivers for Foo 1000, 2000, and 3000.
 8  %version 1.0
 9
10  # Define installation directories
11
12  %system osx
13  $PPD=/Library/Printer/PPDs/Contents/Resources/en.lproj
14  $FILTER=/usr/libexec/cups/filter
15
16  %system linux
17  $PPD=/usr/share/cups/model/foo
18  $FILTER=/usr/lib/cups/filter
19
20  # Workaround Linux x86_64 issues
21  %preinstall &lt;&lt; EOF
22  if -d /usr/lib64/cups -a ! -d /usr/lib/cups; then
23      ln -s /usr/lib64/cups /usr/lib
24  fi
25  EOF
26
27  # List files in package
28  %system
29
30  f 0755 root sys $FILTER/rastertofoo rastertofoo
31  f 0644 root sys $PPD/foo-1000.ppd.gz ppd/foo-1000.ppd.gz
32  f 0644 root sys $PPD/foo-2000.ppd.gz ppd/foo-2000.ppd.gz
33  f 0644 root sys $PPD/foo-3000.ppd.gz ppd/foo-3000.ppd.gz
</PRE></TD></TR>
</TABLE></CENTER>

<H3><A NAME="DRV">Distributing Driver Information Files Instead of PPDs</A></H3>

<P>If you are supplying drivers that will only be used on systems running CUPS 1.2 or higher, and if the CUPS DDK drivers are also installed, you can distribute the driver information and message catalog files you use with the PPD compiler instead of the generated PPD files, often leading to noticeable reductions in package size.</P>

<P>Driver information and message catalog files are installed in a <VAR>/usr/share/cups/drv/<b>vendor</b></VAR> subdirectory. The PPD compiler's driver interface to CUPS automatically sees the new files as soon as they are installed.</P>

</BODY>
</HTML>