[567] | 1 | # $Id$ |
---|
| 2 | |
---|
[576] | 3 | Tea4CUPS : Tee for CUPS |
---|
[567] | 4 | |
---|
| 5 | This program is free software; you can redistribute it and/or modify |
---|
| 6 | it under the terms of the GNU General Public License as published by |
---|
| 7 | the Free Software Foundation; either version 2 of the License, or |
---|
| 8 | (at your option) any later version. |
---|
| 9 | |
---|
| 10 | This program is distributed in the hope that it will be useful, |
---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 13 | GNU General Public License for more details. |
---|
| 14 | |
---|
| 15 | You should have received a copy of the GNU General Public License |
---|
| 16 | along with this program; if not, write to the Free Software |
---|
| 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
---|
| 18 | |
---|
| 19 | ============================================================================= |
---|
| 20 | |
---|
[576] | 21 | Tea4CUPS is the equivalent of the *nix command 'tee', but as a CUPS |
---|
[567] | 22 | backend. |
---|
| 23 | |
---|
[576] | 24 | Tea4CUPS behaves just like any other CUPS backend, but allows you to |
---|
[567] | 25 | transparently send print jobs' datas to any number of outputs : other |
---|
| 26 | CUPS backends, files or pipes. |
---|
| 27 | |
---|
| 28 | This for example allows you to output the same print job on several |
---|
| 29 | printers at the same time, which is not possible with CUPS. |
---|
| 30 | |
---|
| 31 | Another possibility would be for example to send the same document to |
---|
| 32 | a printer, a PDF generator, a Fax, and as an attachment to an email |
---|
| 33 | message, all of this by printing it a single time. |
---|
| 34 | |
---|
[598] | 35 | Tea4CUPS provides three ways to launch commands : |
---|
| 36 | |
---|
| 37 | - prehooks : these are guaranteed to be launched before the |
---|
| 38 | print job is sent to the real printer. |
---|
[603] | 39 | Any prehook which exits -1 can cancel the |
---|
| 40 | print job. |
---|
[598] | 41 | |
---|
| 42 | - tees : these are launched at the same time the job is being |
---|
[603] | 43 | sent to the real printer, unless the job was |
---|
| 44 | previously cancelled by a prehook. |
---|
[598] | 45 | |
---|
| 46 | - posthooks : these are guaranteed to be launched after the |
---|
[603] | 47 | print job has been sent to the real printer, |
---|
| 48 | unless the job was previously cancelled by a |
---|
| 49 | prehook. |
---|
[598] | 50 | |
---|
[586] | 51 | To help your own commands, Tea4CUPS makes available as part of the |
---|
| 52 | environment several variables which can be used as part of the |
---|
| 53 | commands you use : |
---|
| 54 | |
---|
| 55 | TEAPRINTERNAME : The print queue name. |
---|
| 56 | TEADIRECTORY : Tea4CUPS output directory. |
---|
| 57 | TEADATAFILE : Full name of Tea4CUPS work file (in $TEADIRECTORY). |
---|
| 58 | TEAJOBSIZE : Job's size in bytes. |
---|
| 59 | TEAMD5SUM : MD5 sum of the job's datas. |
---|
| 60 | TEACLIENTHOST : Client's hostname or IP address. |
---|
| 61 | TEAJOBID : Job's Id. |
---|
| 62 | TEAUSERNAME : Name of the user who launched the print job. |
---|
| 63 | TEATITLE : Job's title. |
---|
| 64 | TEACOPIES : Number of copies requested. |
---|
| 65 | TEAOPTIONS : Options of the print job. |
---|
| 66 | TEAINPUTFILE : Print job's data file or empty when job read from stdin. |
---|
[598] | 67 | TEASTATUS : Original CUPS backend's exit code : ONLY AVAILABLE FROM |
---|
[603] | 68 | posthooks, obviously. |
---|
[586] | 69 | |
---|
[590] | 70 | In the case you want to use both Tea4CUPS and PyKota, you MUST install |
---|
| 71 | PyKota v1.22alpha2 or higher to avoid a race condition. |
---|
| 72 | |
---|
[567] | 73 | ============================================================================= |
---|
| 74 | |
---|
| 75 | Installation : |
---|
| 76 | -------------- |
---|
| 77 | |
---|
[591] | 78 | 0 - Download Tea4CUPS from : |
---|
| 79 | |
---|
| 80 | http://www.librelogiciel.com/software/Tea4CUPS/action_Presentation |
---|
| 81 | |
---|
[592] | 82 | and extract it : |
---|
| 83 | |
---|
| 84 | $ tar -zxf tea4cups-x.yy.tar.gz |
---|
| 85 | |
---|
| 86 | where x.yy is Tea4CUPS' version number. |
---|
| 87 | |
---|
[576] | 88 | 1 - Copy the 'tea4cups' command into CUPS' backend directory, |
---|
[567] | 89 | for example : |
---|
| 90 | |
---|
[576] | 91 | $ cp tea4cups /usr/lib/cups/backend |
---|
[567] | 92 | |
---|
| 93 | 2 - Restart CUPS in order for this new backend to be detected. |
---|
| 94 | |
---|
| 95 | 3 - Either from CUPS' web interface, add new printers with |
---|
[576] | 96 | 'Tea4CUPS managed' in front of the device's name. |
---|
[567] | 97 | |
---|
| 98 | Or by directly modifying CUPS' printers.conf file, prepend |
---|
[576] | 99 | each DeviceURI value with 'tea4cups://', and restart CUPS. |
---|
[567] | 100 | |
---|
[576] | 101 | 4 - Copy tea4cups.conf into CUPS' configuration directory (where |
---|
[567] | 102 | cupsd.conf resides) : |
---|
| 103 | |
---|
[576] | 104 | $ cp tea4cups.conf /etc/cups/ |
---|
[567] | 105 | |
---|
[576] | 106 | 5 - Modify tea4cups.conf to suit your needs. Several examples |
---|
[567] | 107 | are included. |
---|
| 108 | |
---|
| 109 | 6 - There's no 6 ! |
---|
| 110 | |
---|
| 111 | ============================================================================= |
---|
| 112 | |
---|
| 113 | Troubleshooting : |
---|
| 114 | ----------------- |
---|
| 115 | |
---|
| 116 | 1 - Set "LogLevel debug2" in CUPS' cupsd.conf |
---|
| 117 | |
---|
| 118 | 2 - Restart CUPS. |
---|
| 119 | |
---|
[576] | 120 | 3 - Set "debug: yes" in the [global] section of tea4cups.conf |
---|
[567] | 121 | |
---|
| 122 | 4 - Print something on a print queue managed |
---|
[576] | 123 | by Tea4CUPS. |
---|
[567] | 124 | |
---|
| 125 | 5 - Look at CUPS' error_log file for diagnostic and error messages. |
---|
| 126 | |
---|
| 127 | ============================================================================= |
---|
[591] | 128 | |
---|
| 129 | CUPS (Common UNIX(r) Printing System) is trademark property of Easy Software |
---|
| 130 | Products. |
---|
| 131 | |
---|
| 132 | You can download CUPS from : |
---|
| 133 | |
---|
| 134 | http://www.cups.org |
---|
| 135 | |
---|
| 136 | ============================================================================= |
---|
[567] | 137 | |
---|
| 138 | Please e-mail bugs to : alet@librelogiciel.com (Jerome Alet) |
---|