Codebase list foomatic-db-engine / upstream/3.0.2-20060530
Imported Upstream version 3.0.2-20060530 Didier Raboud 13 years ago
12 changed file(s) with 614 addition(s) and 225 deletion(s). Raw diff Collapse all Expand all
00 /COPYING/3.1/Tue Jan 28 23:01:10 2003//Tfoomatic-3_0-branch
1 /ChangeLog/3.99.2.40/Tue Feb 28 11:01:43 2006//Tfoomatic-3_0-branch
1 /ChangeLog/3.99.2.48/Tue May 23 22:46:40 2006//Tfoomatic-3_0-branch
22 /Foomatic-Devel-Ideas.txt/3.2/Tue Apr 22 23:19:52 2003//Tfoomatic-3_0-branch
3 /Makefile.in/3.16.2.3/Fri Jan 28 16:17:13 2005//Tfoomatic-3_0-branch
4 /README/3.26.2.7/Tue Jul 12 23:38:02 2005//Tfoomatic-3_0-branch
3 /Makefile.in/3.16.2.4/Wed Apr 19 23:48:43 2006//Tfoomatic-3_0-branch
4 /README/3.26.2.8/Wed Apr 19 23:48:43 2006//Tfoomatic-3_0-branch
55 /README.build-foomatic-filters-ppds/3.3.2.1/Sun Mar 28 23:04:51 2004//Tfoomatic-3_0-branch
66 /TODO/3.1/Fri Nov 29 01:31:37 2002//Tfoomatic-3_0-branch
7 /USAGE/3.14.2.4/Tue Sep 14 21:08:37 2004//Tfoomatic-3_0-branch
7 /USAGE/3.14.2.5/Wed Apr 19 23:48:43 2006//Tfoomatic-3_0-branch
88 /acinclude.m4/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
9 /configure.ac/1.1.2.1/Fri Jan 6 17:37:50 2006//Tfoomatic-3_0-branch
9 /configure.ac/1.1.2.3/Mon May 22 13:56:26 2006//Tfoomatic-3_0-branch
1010 /extract_pjl/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
1111 /foomatic-addpjloptions.8.in/3.2/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
1212 /foomatic-addpjloptions.in/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
1616 /foomatic-compiledb.1.in/3.1/Thu Nov 28 02:42:26 2002//Tfoomatic-3_0-branch
1717 /foomatic-compiledb.in/3.6.2.2/Sun Oct 23 01:03:45 2005//Tfoomatic-3_0-branch
1818 /foomatic-configure.1.in/3.1/Thu Nov 28 02:42:26 2002//Tfoomatic-3_0-branch
19 /foomatic-configure.in/3.18.2.9/Tue Feb 28 11:01:43 2006//Tfoomatic-3_0-branch
19 /foomatic-configure.in/3.18.2.11/Sat Apr 22 18:40:43 2006//Tfoomatic-3_0-branch
2020 /foomatic-filters-ppds-README/3.1/Sun Feb 23 07:14:18 2003//Tfoomatic-3_0-branch
2121 /foomatic-filters-ppds-install/3.1/Sun Feb 23 07:14:18 2003//Tfoomatic-3_0-branch
2222 /foomatic-fix-xml.in/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
3030 /foomatic-ppd-options.1.in/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
3131 /foomatic-ppd-options.in/3.2/Wed Nov 19 03:41:29 2003//Tfoomatic-3_0-branch
3232 /foomatic-ppdfile.1.in/3.2/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
33 /foomatic-ppdfile.in/3.4.2.4/Sun Oct 23 00:43:39 2005//Tfoomatic-3_0-branch
33 /foomatic-ppdfile.in/3.4.2.7/Mon May 22 11:49:27 2006//Tfoomatic-3_0-branch
3434 /foomatic-preferred-driver.8.in/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
3535 /foomatic-preferred-driver.in/3.3.2.1/Sun Mar 28 23:04:51 2004//Tfoomatic-3_0-branch
3636 /foomatic-printermap-to-gimp-print-xml.in/1.1.2.2/Sun Mar 28 23:04:51 2004//Tfoomatic-3_0-branch
4141 /gsQuit/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
4242 /gsTest/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
4343 /install-sh/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
44 /makeDefaults.in/3.3.2.1/Fri Jan 28 12:39:36 2005//Tfoomatic-3_0-branch
44 /makeDefaults.in/3.3.2.2/Wed Apr 19 23:48:43 2006//Tfoomatic-3_0-branch
4545 /makeMan.in/3.1/Thu Jun 26 13:28:24 2003//Tfoomatic-3_0-branch
4646 /make_configure/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
4747 /mkinstalldirs/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
0 2006-05-23 Till Kamppeter <till.kamppeter@gmx.net>
1
2 * lib/Foomatic/DB.pm: Eliminated a warning.
3
4 2006-05-22 Till Kamppeter <till.kamppeter@gmx.net>
5
6 * configure.ac: Do never use CUPS commands "enable-cups",
7 "disable-cups", "accept-cups", "reject-cups", even if
8 executable files with these names are available. CUPS has only
9 one executable for these tasks and recognizes by the
10 executable/link name what to do. So it only accepts execution
11 with one of the names "enable", "disable", "accept", "reject".
12
13 * lib/Foomatic/DB.pm: When generating PPD files from Foomatic
14 XML data and the option XML files contain "<arg_order>" tags
15 with different values, the options get ordered by the
16 "<arg_order>" values (within their group). This way manually
17 defining the presentation order of the options gets possible.
18 Fixed also a buglet in the setting of the default of numerical
19 options.
20
21 * foomatic-ppdfile.in: Removed "use strict;" due to an
22 incompatibility with the "getopts()" Perl function.
23
24 2006-05-20 Till Kamppeter <till.kamppeter@gmx.net>
25
26 * lib/Foomatic/DB.pm: Improved group name parsing in the PPD
27 files, now the group names of the Gutenprint CUPS raster
28 PPDs are read out correctly. Do not sort the options any more
29 when reading PPD files.
30
31 2006-05-19 Till Kamppeter <till.kamppeter@gmx.net>
32
33 * foomatic-ppdfile.in: Let PPD file generation with cups-driverd
34 also work if the driver name contains dashes (as in Gutenprint),
35 added "use strict;", let debug output and error messages have
36 prefixes to be correctly categorized in the CUPS error_log.
37
38 2006-04-22 Till Kamppeter <till.kamppeter@gmx.net>
39
40 * foomatic-configure.in: Added support for reading additional items
41 from the /etc/cups/printers.conf file: Print quotas, individual,
42 printer sharing, error and operation policies.
43
44 2006-04-21 Till Kamppeter <till.kamppeter@gmx.net>
45
46 * lib/Foomatic/DB.pm: Eliminated some warnings
47
48 * foomatic-configure.in: Added new URIs to URI overview in
49 header comments, let beh wrapper backend also not be
50 applied to HPLIP fax queues (URI: "hpfax:/...").
51
52 2006-04-19 Till Kamppeter <till.kamppeter@gmx.net>
53
54 * foomatic-ppdfile.in, lib/Foomatic/DB.pm, configure.ac,
55 Makefile.in, makeDefaults.in, USAGE, README: Added support for
56 on-the-fly PPD file generation by the CUPS 1.2 cups-driverd.
57
58 * USAGE: Update HPOJ -> HPLIP.
59
060 2006-02-28 Till Kamppeter <till.kamppeter@gmx.net>
161
262 * foomatic-configure.in: Treat a missing /etc/cups/printers.conf
00
11 # Makefile to install foomatic-db-engine
2 # $Revision: 3.16.2.3 $
2 # $Revision: 3.16.2.4 $
33
44 # PREFIX defaults to /usr/local for manually installed progs, so that they
55 # are not messed up on a system upgrade.
8585 CUPS_PPDS=@CUPS_PPDS@
8686 CUPS_FILTERS=@CUPS_FILTERS@
8787 CUPS_BACKENDS=@CUPS_BACKENDS@
88 LIB_CUPS=@LIB_CUPS@
89 CUPS_DRIVER=@LIB_CUPS@/driver
8890 CUPS_PCONF=@CUPS_PCONF@
8991 CUPS_LPR=@CUPS_LPR@
9092 CUPS_LPQ=@CUPS_LPQ@
199201 # Link to allow foomatic-ppdfile be called under the old name
200202 # foomatic-datafile
201203 ln -sf foomatic-ppdfile $(DESTDIR)$(BINDIR)/foomatic-datafile
204 # Link foomatic-ppdfile to the CUPS 1.2 PPD generator directory,
205 # so that the cups-driverd automatically generates Foomatic PPDs
206 # on demand (/usr/lib/cups/driver).
207 if [ -d $(LIB_CUPS) ]; then \
208 ${SRC}/mkinstalldirs $(DESTDIR)$(CUPS_DRIVER); \
209 ln -sf $(BINDIR)/foomatic-ppdfile $(DESTDIR)$(CUPS_DRIVER)/foomatic; \
210 fi
202211
203212 install-man: check-config
204213 ${SRC}/mkinstalldirs $(DESTDIR)$(MANDIR)
387387 Foomatic database and not the one from the IEEE-1284 auto-detection
388388 ID string for the "*Manufacturer: ..." tag of the PPD files, as in
389389 the IDs the manufacturer names often do not comply with the Adobe
390 specs (as "Hewlett-Packard", "HP" has to be used.
390 specs (as "Hewlett-Packard", "HP" has to be used).
391
392 Implemented after 3.0.2:
393
394 - Support for on-the-fly PPD generation by CUPS 1.2. Now all Foomatic PPDs
395 appear in the model lists of the CUPS web interface without needing to
396 pre-compile the PPDs. The PPDs get actually generated if one selects
397 them for the new print queue to be set up.
391398
392399 Planned/Roadmap for future releases:
393400
+48
-47
USAGE less more
222222 A default spooler can be set by putting its name into an
223223 /etc/foomatic/defaultspooler file or into ~/.defaultspooler
224224
225 If you have a multi-function device from HP, install HPOJ from
226
227 http://hpoj.sourceforge.net/
228
229 before starting to set up printer queues with Foomatic. This is needed
230 for printing on USB devices and for scanning and photo memory card
231 access on all devices. If you use CUPS 1.1.12 or newer together with
232 the old HPOJ 0.8, you need also the latest "ptal" backend script from
233
234 http://www.hornclan.com/~mark/cups/
235
236 License information and installation instructions for this script you
237 find in the beginning of the script itself. See also the end of the
238 "Adding a queue" section in this file to see how to use this script.
239
240 The "ptal" backend script is already included in HPOJ 0.9.
225 If you have a printer or multi-function device from HP, install HPLIP from
226
227 http://hpinkjet.sourceforge.net/
228
229 before starting to set up printer queues with Foomatic. This gives you
230 the possibility to access all extra functions of your HP device,
231 independent whether it is connected via parallel port, USB, or
232 ethernet. This gives you, depending on the device, functionality, as
233 ink/toner level check, nozzle check and cleaning, color adjustment,
234 head alignement, scanning, memory card access, and even sending faxes.
241235
242236 Printing through the MTink daemon from the MTink package
243237 (http://xwtools.automatix.de/) is also supported. When CUPS is the
245239 will be used. Using the MTink daemon it is possible to check the ink
246240 levels while printing. The MTink daemon supports only Epson inkjets
247241 from the Epson Stylus Color 740 on to the current models.
242
243
244 Easy printer setup with CUPS 1.2
245 --------------------------------
246
247 If you have CUPS 1.2 or newer, you do not need the command line to
248 set up printers with Foomatic. Simply fire up the web interface entering
249
250 http://localhost:631/
251
252 and click the "Administration" tab. Then click the "Add this printer" at
253 the entry of an auto-detected printer (parallel, USB, ethernet) or click
254 "Add printer" at the top. Follow the instructions on the following pages.
255
256 If the printers of the Foomatic database do not appear, check whether the
257 link to foomatic-ppdfile is in /usr/lib/cups/driver:
258
259 lrwxrwxrwx 1 root root 25 Apr 19 18:13 foomatic -> /usr/bin/foomatic-ppdfile
260
261 If not, create it manually.
262
263 If you want the web interface only list entries for the recommended
264 driver for each printer, create a file /etc/cups/foomatic.conf
265 containing the line
266
267 OnlyRecommended Yes
268
269 Note: CUPS paths may be different on your system.
270
248271
249272
250273 Adding a queue
305328 /dev/usb/lp1, ..., so we are
306329 compatible to older versions of
307330 Foomatic.
331 hp:/<device name> : HP printer used with the low-level
332 driver HPLIP (see
333 http://hpinkjet.sourceforge.net/). The
334 device name is name assigned to the
335 device by the HPLIP system, Run
336 "lpinfo -v" to see valid URIs (works
337 only with CUPS).
308338 ptal:/<device name> : HP multi-function device used with
309339 the low-level driver HPOJ (see
310340 http://hpoj.sourceforge.net/). The
311341 device name is name assigned to the
312342 device by the ptal-mlcd daemon, for
313 example "mlc:usb:PSC_950".
343 example "mlc:usb:PSC_950" (Obsolete,
344 but still working).
314345 mtink:/<device name> : Epson Stylus Color, Photo, Pro,
315346 or Scan inkjet printer used through
316347 the mtink daemon. <device name>
456487
457488 foomatic-configure -s lpd -n remoteraw -c socket://192.168.1.234:9100/
458489
459 If you want to print on a multi-function device from HP you should use
460 the low-level driver HPOJ (http://hpoj.sourceforge.net/) so that you
461 are also able to scan or to access memory cards. For many USB devices
462 you need HPOJ even when you only want to print. To set up a queue, set
463 up HPOJ first and then look for the HPOJ device for your printer. You
464 get a list of all configured (with "ptal-init setup") devices with "ls
465 /etc/ptal" (users of HPOJ 0.8 find the device name in /etc/ptal-start.conf
466 in the line starting with "ptal-printd").
467
468 The device name is for example "mlc:usb:PSC_950" for an HP PSC 950
469 connected via USB. To set up a queue for this printer under CUPS you
470 have to enter:
471
472 foomatic-configure -s cups -n PSC950 -c ptal:/mlc:usb:PSC_950
473 -p HP-PSC_950 -d hpijs -o PageSize=A4
474
475 If you use CUPS 1.1.12 and newer, you need the most recent "ptal"
476 backend script, which is either part of HPOJ (0.9 or newer) or
477 separately downloadable from
478
479 http://www.hornclan.com/~mark/cups/
480
481 (use the "File"/"Save as ..." function of your browser to get it onto
482 your hard disk). Foolow the instructions in the beginning of the file
483 to install it.
484
485 After installing HPOJ and/or "ptal" and configuring your printer with
486 "ptal-init setup" restart the CUPS daemon and ONLY NOW set up your
487 printer queue, foomatic-configure will then auto-detect the "ptal"
488 script and make use of it.
489490
490491
491492 Modifying a queue
39763976 ;;
39773977 *)
39783978 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3979 as_dummy="SBB"
3980 for as_dir in $as_dummy
3979 for as_dir in $SBB
39813980 do
39823981 IFS=$as_save_IFS
39833982 test -z "$as_dir" && as_dir=.
43154314 done
43164315 test -n "$CUPS_BACKENDS" || CUPS_BACKENDS="/usr/lib/cups/backend"
43174316
4317 for ac_dir in cups
4318 do
4319 # Extract the first word of "$ac_dir", so it can be a program name with args.
4320 set dummy $ac_dir; ac_word=$2
4321 echo "$as_me:$LINENO: checking for $ac_word/" >&5
4322 echo $ECHO_N "checking for $ac_word/... $ECHO_C" >&6
4323 if test "${ac_cv_path_LIB_CUPS+set}" = set; then
4324 echo $ECHO_N "(cached) $ECHO_C" >&6
4325 else
4326 case "$LIB_CUPS" in
4327 /*)
4328 ac_cv_path_LIB_CUPS="$LIB_CUPS" # Let the user override the test with a path.
4329 ;;
4330 ?:/*)
4331 ac_cv_path_LIB_CUPS="$LIB_CUPS" # Let the user override the test with a dos path.
4332 ;;
4333 *)
4334 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
4335 ac_dummy="$LIBSEARCHPATH"
4336 for ac_dir in $ac_dummy; do
4337 test -z "$ac_dir" && ac_dir=.
4338 if test -d $ac_dir/$ac_word; then
4339 ac_cv_path_LIB_CUPS="$ac_dir/$ac_word"
4340 break
4341 fi
4342 done
4343 IFS="$ac_save_ifs"
4344 ;;
4345 esac
4346 fi
4347 LIB_CUPS="$ac_cv_path_LIB_CUPS"
4348 if test -n "$LIB_CUPS"; then
4349 echo "$as_me:$LINENO: result: $LIB_CUPS" >&5
4350 echo "${ECHO_T}$LIB_CUPS" >&6
4351 else
4352 echo "$as_me:$LINENO: result: no" >&5
4353 echo "${ECHO_T}no" >&6
4354 fi
4355
4356 test -n "$LIB_CUPS" && break
4357 done
4358 test -n "$LIB_CUPS" || LIB_CUPS="/usr/lib/cups"
4359
43184360 for ac_prog in cups/printers.conf
43194361 do
43204362 # Extract the first word of "$ac_prog", so it can be a program name with args.
45104552 ;;
45114553 *)
45124554 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4513 as_dummy="SBB"
4514 for as_dir in $as_dummy
4555 for as_dir in $SBB
45154556 do
45164557 IFS=$as_save_IFS
45174558 test -z "$as_dir" && as_dir=.
46314672 done
46324673 test -n "$CUPS_CANCEL" || CUPS_CANCEL="/usr/bin/cancel"
46334674
4634 for ac_prog in enable-cups enable
4675 for ac_prog in enable
46354676 do
46364677 # Extract the first word of "$ac_prog", so it can be a program name with args.
46374678 set dummy $ac_prog; ac_word=$2
46764717 done
46774718 test -n "$CUPS_ENABLE" || CUPS_ENABLE="/usr/bin/enable"
46784719
4679 for ac_prog in disable-cups disable
4720 for ac_prog in disable
46804721 do
46814722 # Extract the first word of "$ac_prog", so it can be a program name with args.
46824723 set dummy $ac_prog; ac_word=$2
47214762 done
47224763 test -n "$CUPS_DISABLE" || CUPS_DISABLE="/usr/bin/disable"
47234764
4724 for ac_prog in accept-cups accept
4765 for ac_prog in accept
47254766 do
47264767 # Extract the first word of "$ac_prog", so it can be a program name with args.
47274768 set dummy $ac_prog; ac_word=$2
47364777 ;;
47374778 *)
47384779 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4739 as_dummy="SBB"
4740 for as_dir in $as_dummy
4780 for as_dir in $SBB
47414781 do
47424782 IFS=$as_save_IFS
47434783 test -z "$as_dir" && as_dir=.
47674807 done
47684808 test -n "$CUPS_ACCEPT" || CUPS_ACCEPT="/usr/sbin/accept"
47694809
4770 for ac_prog in reject-cups reject
4810 for ac_prog in reject
47714811 do
47724812 # Extract the first word of "$ac_prog", so it can be a program name with args.
47734813 set dummy $ac_prog; ac_word=$2
47824822 ;;
47834823 *)
47844824 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4785 as_dummy="SBB"
4786 for as_dir in $as_dummy
4825 for as_dir in $SBB
47874826 do
47884827 IFS=$as_save_IFS
47894828 test -z "$as_dir" && as_dir=.
48284867 ;;
48294868 *)
48304869 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4831 as_dummy="SBB"
4832 for as_dir in $as_dummy
4870 for as_dir in $SBB
48334871 do
48344872 IFS=$as_save_IFS
48354873 test -z "$as_dir" && as_dir=.
65756613 s,@CUPS_PPDS@,$CUPS_PPDS,;t t
65766614 s,@CUPS_FILTERS@,$CUPS_FILTERS,;t t
65776615 s,@CUPS_BACKENDS@,$CUPS_BACKENDS,;t t
6616 s,@LIB_CUPS@,$LIB_CUPS,;t t
65786617 s,@CUPS_PCONF@,$CUPS_PCONF,;t t
65796618 s,@CUPS_LPR@,$CUPS_LPR,;t t
65806619 s,@CUPS_LPQ@,$CUPS_LPQ,;t t
223223 AC_PATH_PROGS(LPD_LPR,lpr-lpd lpr-lprng lpr-lpr lpr,/usr/bin/lpr,$BINSEARCHPATH)
224224 AC_PATH_PROGS(LPD_LPQ,lpq-lpd lpq-lprng lpq-lpr lpq,/usr/bin/lpq,$BINSEARCHPATH)
225225 AC_PATH_PROGS(LPD_LPRM,lprm-lpd lprm-lprng lprm-lpr lprm,/usr/bin/lprm,$BINSEARCHPATH)
226 AC_PATH_PROGS(LPD_LPC,lpc-lpd lpc-lprng lpc-lpr lpc,/usr/sbin/lpc,SBB)
226 AC_PATH_PROGS(LPD_LPC,lpc-lpd lpc-lprng lpc-lpr lpc,/usr/sbin/lpc,$SBB)
227227 AC_PATH_PROGS(LPRNG_CHECKPC,checkpc,/usr/sbin/checkpc,$SBINSEARCHPATH)
228228
229229 dnl Paths and other settings for CUPS
233233 AC_PATH_DIRS(CUPS_PPDS,cups/model,/usr/share/cups/model,$DATASEARCHPATH)
234234 AC_PATH_DIRS(CUPS_FILTERS,cups/filter,/usr/lib/cups/filter,$DATASEARCHPATH)
235235 AC_PATH_DIRS(CUPS_BACKENDS,cups/backend,/usr/lib/cups/backend,$DATASEARCHPATH)
236 AC_PATH_DIRS(LIB_CUPS,cups,/usr/lib/cups,$LIBSEARCHPATH)
236237 AC_PATH_PROGS(CUPS_PCONF,cups/printers.conf,$CUPS_ETC/printers.conf,$SYSCONFSEARCHPATH)
237238 AC_PATH_PROGS(CUPS_LPR,lpr-cups lpr,/usr/bin/lpr,$BINSEARCHPATH)
238239 AC_PATH_PROGS(CUPS_LPQ,lpq-cups lpq,/usr/bin/lpq,$BINSEARCHPATH)
239240 AC_PATH_PROGS(CUPS_LPRM,lprm-cups lprm,/usr/bin/lprm,$BINSEARCHPATH)
240 AC_PATH_PROGS(CUPS_LPC,lpc-cups lpc,/usr/sbin/lpc,SBB)
241 AC_PATH_PROGS(CUPS_LPC,lpc-cups lpc,/usr/sbin/lpc,$SBB)
241242 AC_PATH_PROGS(CUPS_LP,lp-cups lp,/usr/bin/lp,$BINSEARCHPATH)
242243 AC_PATH_PROGS(CUPS_CANCEL,cancel-cups cancel,/usr/bin/cancel,$BSB)
243 AC_PATH_PROGS(CUPS_ENABLE,enable-cups enable,/usr/bin/enable,$BSB)
244 AC_PATH_PROGS(CUPS_DISABLE,disable-cups disable,/usr/bin/disable,$BSB)
245 AC_PATH_PROGS(CUPS_ACCEPT,accept-cups accept,/usr/sbin/accept,SBB)
246 AC_PATH_PROGS(CUPS_REJECT,reject-cups reject,/usr/sbin/reject,SBB)
247 AC_PATH_PROGS(CUPS_LPMOVE,lpmove,/usr/sbin/lpmove,SBB)
244 AC_PATH_PROGS(CUPS_ENABLE,enable,/usr/bin/enable,$BSB)
245 AC_PATH_PROGS(CUPS_DISABLE,disable,/usr/bin/disable,$BSB)
246 AC_PATH_PROGS(CUPS_ACCEPT,accept,/usr/sbin/accept,$SBB)
247 AC_PATH_PROGS(CUPS_REJECT,reject,/usr/sbin/reject,$SBB)
248 AC_PATH_PROGS(CUPS_LPMOVE,lpmove,/usr/sbin/lpmove,$SBB)
248249 AC_PATH_PROGS(CUPS_LPOPTIONS,lpoptions,/usr/bin/lpoptions,$BINSEARCHPATH)
249250 AC_PATH_PROGS(CUPS_LPINFO,lpinfo,/usr/sbin/lpinfo,$SBINSEARCHPATH)
250251
2929 # parallel:/path/device # Local parallel printer
3030 # serial:/path/device # Local serial printer
3131 # file:/path/file # includes usb, lp, named pipes, other
32 # ptal:/provider:bus:name # HPOJ MLC protocol (hpoj.sourceforge.net)
32 # hp:/bus/model?serial=xxx # HPLIP print queue (hpinkjet.sf.net)
33 # hpfax:/bus/model?serial=xxx # HPLIP fax queue (hpinkjet.sf.net)
34 # ptal:/provider:bus:name # HPOJ MLC protocol (hpoj.sf.net,obsolete)
3335 # mtink:/path/device # Epson inkjet through mtink daemon
3436 # # (for ink level monitoring when printing,
3537 # # http://xwtools.automatix.de/)
3638 # lpd://host/queue # LPD protocol
39 # lpd://host # LPD protocol (default queue, CUPS only)
3740 # socket://host:port # TCP aka appsocket
41 # socket://host # TCP aka appsocket (port 9100)
3842 # ncp://user:pass@host/queue # Netware (LPD, LPRng, direct)
3943 # smb://user:pass@wgrp/host/queue # Windows (CUPS, PPR, LPD, LPRng, direct)
4044 # stdout # Standard output (direct)
12771281 # using the HPLIP ("hp") backend, as otherwise the "hp-toolbox"
12781282 # will not list the printer any more. HPLIP does infinite retries
12791283 # in 30-sec intervals anyway.
1280 if (($cupsuri) && ($cupsuri !~ m!^hp:/!) &&
1284 if (($cupsuri) && ($cupsuri !~ m!^hp(fax|):/!) &&
12811285 (($config->{'dd'} != 0) || ($config->{'att'} != 1))) {
12821286 $cupsuri = sprintf("beh:/%d/%d/%d/%s",
12831287 $config->{'dd'}, $config->{'att'},
27462750 ($c->{'spooler'} eq "cups" ?
27472751 (_tag('dontdisable',$c->{'dd'}),
27482752 _tag('attempts',$c->{'att'}),
2749 _tag('delay',$c->{'delay'})) : ()),
2750
2753 _tag('delay',$c->{'delay'}),
2754 (defined($c->{'quotaperiod'}) ?
2755 _tag('quotaperiod',$c->{'quotaperiod'}) : ()),
2756 (defined($c->{'pagelimit'}) ?
2757 _tag('pagelimit',$c->{'pagelimit'}) : ()),
2758 (defined($c->{'klimit'}) ?
2759 _tag('klimit',$c->{'klimit'}) : ()),
2760 (defined($c->{'laststatechange'}) ?
2761 _tag('laststatechange',$c->{'laststatechange'}) : ()),
2762 (defined($c->{'shared'}) ?
2763 _tag('shared',$c->{'shared'}) : ()),
2764 (defined($c->{'operationpolicy'}) ?
2765 _tag('operationpolicy',$c->{'operationpolicy'}) : ()),
2766 (defined($c->{'errorpolicy'}) ?
2767 _tag('errorpolicy',$c->{'errorpolicy'}) : ())) : ()),
27512768 "</queue>\n";
27522769
27532770 return;
37303747 $uri = "mtink:/$1";
37313748 }
37323749 $c->{'connect'} = $uri;
3750 # CUPS-specific extra info
3751 $c->{'quotaperiod'} = $p->{'QuotaPeriod'}
3752 if defined($p->{'QuotaPeriod'});
3753 $c->{'pagelimit'} = $p->{'PageLimit'}
3754 if defined($p->{'PageLimit'});
3755 $c->{'klimit'} = $p->{'KLimit'}
3756 if defined($p->{'KLimit'});
3757 # CUPS 1.2-specific settings
3758 $c->{'laststatechange'} = $p->{'StateTime'}
3759 if defined($p->{'StateTime'});
3760 $c->{'shared'} = $p->{'Shared'}
3761 if defined($p->{'Shared'});
3762 $c->{'operationpolicy'} = $p->{'OpPolicy'}
3763 if defined($p->{'OpPolicy'});
3764 $c->{'errorpolicy'} = $p->{'ErrorPolicy'}
3765 if defined($p->{'ErrorPolicy'});
37333766 $dat->{'queuedata'} = $c;
37343767 }
37353768 if (!defined($dat->{'queuedata'})) {$dat = undef};
00 #!@PERL@
11 # -*- perl -*-
2
3 # Foomatic PPD file generator for manual PPD generation (via "-p",
4 # "-d", "-A", and "-P" command line options) or for automatic
5 # on-the-fly PPD generation by CUPS 1.2 or newer (via "cat" and "list"
6 # command line options).
7
28 use Foomatic::Defaults;
39 use Foomatic::DB;
410 use Getopt::Std;
511 use Data::Dumper;
6
7 help if !@ARGV ;
8 getopts("AP:d:p:hwt:") || help();
12 #use strict;
13
14 my $debug = 0;
15
16 # Use program name as the first part of the PPD URI for CUPS (should be
17 # "foomatic").
18 $0 =~ m!/([^/]+)\s*$!;
19 my $progname = ($1 || $0);
20
21 # Default settings for listing PPDs by cups-driverd
22
23 # List only the PPD file with the reconmmended driver for each printer
24 # and do not show "(recommended)" in the CUPS web interface. This mode
25 # makes CUPS setup with the web interface very easy for beginners.
26 # This can be set by "OnlyRecommended Yes" or "OnlyRecommended No" in
27 # /etc/cups/foomatic.conf
28 my $onlyrecommended = 0;
29
30 help() if !@ARGV;
31 #my ($opt_h, $opt_d, $opt_p, $opt_A, $opt_P, $opt_w);
32 getopts("AP:d:p:hwt:");
933 help() if $opt_h;
10 my $driver = $opt_d;
34 my $drv = $opt_d;
1135 my $poid = $opt_p;
1236 my $showall = $opt_A;
1337 my $showmatch = $opt_P;
14 my $debug = 0;
15
16 my $db = Foomatic::DB->new();
17 $db->get_overview();
18 my $printer;
19 my @drivers = $db->get_driverlist();
20 if( $showall or $showmatch ){
21 for $printer (@{$db->{'overview'}}) {
38 help() if ($#ARGV > 1) && !($poid);
39
40 if ($ARGV[0] =~ /^list$/i) {
41 # List all available PPD files (format for cups-driverd)
42 cupslistppds();
43 } elsif ($ARGV[0] =~ /^cat$/i) {
44 # Generate and return the selected PPD file (cups-driverd command line)
45 generateppd($ARGV[1]);
46 } elsif ($showall or $showmatch) {
47 # List all PPD files or files matching regexp (manual operation)
48 foomaticlistppds($showmatch);
49 } elsif ($poid) {
50 # Generate and return the selected PPD file (manual operation)
51 generateppd($poid, $drv);
52 } else {
53 help();
54 }
55
56 exit(0);
57
58 sub cupslistppds {
59 my $db = Foomatic::DB->new();
60 $db->get_overview();
61
62 # Read configuration in /etc/cups/foomatic.conf
63 my $conffilename;
64 if (my $cupsserverroot = $ENV{CUPS_SERVERROOT}) {
65 $conffilename = "$cupsserverroot/foomatic.conf";
66 } else {
67 $conffilename = "/etc/cups/foomatic.conf";
68 }
69 if (-r $conffilename and
70 open CONF, "< $conffilename") {
71 while (my $line = <CONF>) {
72 chomp $line;
73 if ($line =~
74 /^\s*OnlyRecommended\s+(Yes|On|True|1)\s*$/i) {
75 $onlyrecommended = 1;
76 } elsif ($line =~
77 /^\s*OnlyRecommended\s+(No|Off|False|0)\s*$/i) {
78 $onlyrecommended = 0;
79 }
80 }
81 close CONF;
82 }
83
84 for my $printer (@{$db->{'overview'}}) {
85 my $poid = $printer->{'id'};
86 my $make = $printer->{'make'};
87 my $model = $printer->{'model'};
88 my $recdriver = $printer->{'driver'};
89 my @drivers = @{$printer->{'drivers'}};
90 my $id = $printer->{'ieee'};
91
92 # No drivers => No PPDs
93 next if $#drivers < 0;
94
95 # Put the reconmmended driver to the beginning of list, as CUPS
96 # probably will take the first PPD which matches the printer model
97 my @sorteddrivers;
98 if (Foomatic::DB::member($recdriver, @drivers)) {
99 # Valid entry for the recommended driver
100 push(@sorteddrivers, $recdriver);
101 if (!$onlyrecommended) {
102 foreach my $driver (@drivers) {
103 push(@sorteddrivers, $driver) if $driver ne $recdriver;
104 }
105 }
106 } else {
107 # Invalid entry for the recommended driver
108 next if $onlyrecommended;
109 undef $recdriver;
110 @sorteddrivers = @drivers;
111 }
112
113 # Go through all the drivers and list the PPD entries
114 foreach my $driver (@sorteddrivers) {
115 # Get PPD header data from the PPD file generator
116 my ($ieee1284,$pnpmake,$pnpmodel,$filename,$longname,
117 $drivername,$nickname,$modelname) =
118 Foomatic::DB::getppdheaderdata($printer, $driver,
119 ($onlyrecommended ? '' :
120 $printer->{'driver'}));
121 print "\"$progname:$longname\" en \"$make\" \"$nickname\" \"$ieee1284\"\n";
122 }
123 }
124 }
125
126 sub foomaticlistppds {
127
128 my ($match) = @_;
129
130 my $db = Foomatic::DB->new();
131 $db->get_overview();
132 my @drivers = $db->get_driverlist();
133
134 for my $printer (@{$db->{'overview'}}) {
22135 my $pr = $printer->{'make'};
23136 my $model = $printer->{'model'};
24137 my $name = "$pr $model";
31144 $dlist .= "$d ";
32145 }
33146 }
34 if( not defined($showmatch) or "$name" =~ m{$showmatch}o ){
147 if (not $match or "$name" =~ m{$match}o) {
35148 print "$name Id='$printer->{'id'}' Driver='$driver'";
36149 if ($dcount > 1){
37150 print " CompatibleDrivers='$dlist'";
39152 print "\n";
40153 }
41154 }
42 exit 0;
43 }
44
45 help() if( not defined( $poid ) );
46
47 # If the user supplies an old numerical printer ID, translate it to
48 # a new clear-text ID
49 $poid = Foomatic::DB::translate_printer_id($poid);
50
51 my $lcname = lc( $poid );
52 my $pentry;
53 for $printer (@{$db->{'overview'}}) {
54 my $name = lc( $printer->{'id'} );
55 print "compare '$lcname' to '$name'\n" if $debug;
56 if( $name eq $lcname ){
57 $pentry = $printer;
58 last;
59 }
60 }
61
62 print "found " . Dumper($pentry) if $debug;
63 die "printer '$poid' not found!\n" if( not defined $pentry );
64
65 if (not defined($driver) ) {
66 $driver = $pentry->{'driver'};
67 if( not defined( $driver ) ){
68 die "printer '$poid' does not have default driver!\n";
69 }
70 }
71
72 my $found = 0;
73 for my $d (@{$pentry->{'drivers'}}) {
74 last if ($found = ($driver eq $d));
75 }
76 if( not $found ){
77 warn "WARNING: printer '$poid' and driver '$driver' are not compatible\n";
78 }
79 $found = 0;
80 for my $d (@drivers) {
81 last if ($found = ($driver eq $d));
82 }
83 if( not $found ){
84 die "ERROR: driver '$driver' not in database!\n";
85 }
86
87 # Get all the data about this driver/printer pair
88 my $possible = $db->getdat($driver, $poid);
89 # Stop if the printer is not supported by the given driver
90 die "That printer and driver combination is not possible.\n"
91 if (!$possible);
92 # Stop if the driver entry has an empty command line prototype or if there
93 # is no custom PPD file
94 die "There is neither a custom PPD file nor the driver database entry contains sufficient data to build a PPD file.\n"
95 if (!$db->{'dat'}{'cmd'}) && (!$db->{'dat'}{'ppdfile'});
96
97 my @data;
98
99 @data = $db->getppd($opt_w);
100 die "ERROR: no PPD file for printer '$poid' and driver '$driver'!\n"
101 if not @data;
102
103 print @data;
104
105 exit 0;
155 }
156
157 sub generateppd {
158
159 my ($ppduri, $driver) = @_;
160 my $poid;
161
162 my $db = Foomatic::DB->new();
163 $db->get_overview();
164 my $printer;
165 my @drivers = $db->get_driverlist();
166
167 if ($ppduri =~ /^$progname:(.*)\.ppd$/) {
168 # cups-driverd operation
169 # We try to split between printer name and driver name at all
170 # dashes in the PPD file name, as some drivers (ex. Gutenprint)
171 # have dashes in their names.
172 my $ppdname = $1;
173 my @poidcomponents = split(/-/, $ppdname);
174 my @drivercomponents = ();
175 while ($#poidcomponents > 1) {
176 unshift(@drivercomponents, pop(@poidcomponents));
177 $driver = join('-', @drivercomponents);
178 next if !Foomatic::DB::member($driver, @drivers);
179 $poid = join('-', @poidcomponents);
180 last;
181 }
182 die "ERROR: Could not determine driver name for $ppdname.ppd!\n"
183 if( !$poid );
184 } else {
185 # manual operation
186 $poid = $ppduri;
187 }
188
189 # If the user supplies an old numerical printer ID, translate it to
190 # a new clear-text ID
191 $poid = Foomatic::DB::translate_printer_id($poid);
192
193 my $lcname = lc( $poid );
194 my $pentry;
195 for $printer (@{$db->{'overview'}}) {
196 my $name = lc( $printer->{'id'} );
197 print STDERR "DEBUG2: $progname: compare '$lcname' to '$name'\n" if $debug;
198 if( $name eq $lcname ){
199 $pentry = $printer;
200 last;
201 }
202 }
203
204 die "ERROR: Printer '$poid' not found!\n" if( not defined $pentry );
205 print STDERR "DEBUG: $progname: Found $pentry->{id}\nDEBUG2: $progname: " .
206 join ("\nDEBUG2: $progname: ", split(/\n/, Dumper($pentry))) .
207 "\n" if $debug;
208
209 if (!$driver || ($driver =~ /(default|recommended)/i)) {
210 $driver = $pentry->{'driver'};
211 if( not defined( $driver ) ){
212 die "ERROR: $progname: Printer '$poid' does not have default driver!\n";
213 }
214 }
215
216 my $found = 0;
217 for my $d (@{$pentry->{'drivers'}}) {
218 last if ($found = ($driver eq $d));
219 }
220 if ( not $found ) {
221 warn "ERROR: $progname: Printer '$poid' and driver '$driver' are not compatible\n";
222 }
223 $found = 0;
224 for my $d (@drivers) {
225 last if ($found = ($driver eq $d));
226 }
227 if ( not $found ) {
228 die "ERROR: $progname: Driver '$driver' not in database!\n";
229 }
230
231 # Get all the data about this driver/printer pair
232 my $possible = $db->getdat($driver, $poid);
233 # Stop if the printer is not supported by the given driver
234 die "ERROR: $progname: That printer and driver combination is not possible.\n"
235 if (!$possible);
236 # Stop if the driver entry has an empty command line prototype or if there
237 # is no custom PPD file
238 die "ERROR: $progname: There is neither a custom PPD file nor the driver database entry contains sufficient data to build a PPD file.\n"
239 if (!$db->{'dat'}{'cmd'}) && (!$db->{'dat'}{'ppdfile'});
240
241 my @data;
242
243 @data = $db->getppd($opt_w);
244 die "ERROR: $progname: No PPD file for printer '$poid' and driver '$driver'!\n"
245 if not @data;
246
247 print @data;
248
249 }
106250
107251 sub help {
108252 print <<HELP;
109 $0 [-h][-A][-w][-P regexp]
110 $0 [-h][-A][-d <driver>] [-p <printerid>]
111 -d <driver> : Driver name
112 -p <printerid> : Printer ID
253
254 $progname -A
255 $progname -P <regexpr>
256 $progname -p <printerid> [-d <driver>] [-w]
257 $progname list
258 $progname cat <CUPS PPD URI> [-w]
259 $progname -h
260
113261 -A : show all Printer ID's and compatible drivers
114262 -P <regexpr> : show all Printer ID's whose names and model
115263 matched by the RE. For example:
116264 -P HP will match all names with HP in them
265 -p <printerid> : Printer ID
266 -d <driver> : Driver name
267 If the driver is not specified then the default driver
268 for the <printerid> is used.
269 list : List all possible PPDs in the format needed by the
270 cups-driverd
271 cat <CUPS PPD URI> : Generate PPD file appropriate to the <CUPS PPD URI>.
272 Available CUPS PPD URIs are listed by
273 "$progname list".
117274 -w : Generate PPD which is compatible with the CUPS PostScript
118275 driver for Windows (GUI strings are limited to 39
119276 characters).
120277 -h : show help information
121278
122 If the driver is not specified then the default driver for the
123 printerid is used.
124279
125280 HELP
126281 exit 1;
0 /DB.pm/3.56.2.21/Tue Jan 17 15:37:27 2006//Tfoomatic-3_0-branch
0 /DB.pm/3.56.2.26/Tue May 23 22:46:40 2006//Tfoomatic-3_0-branch
11 /PPD.pm/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
22 /UIElem.pm/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
33 D
1414 use POSIX; # for rounding integers
1515 use strict;
1616
17 my $ver = '$Revision: 3.56.2.21 $ ';
17 my $ver = '$Revision: 3.56.2.26 $ ';
1818
1919 # constructor for Foomatic::DB
2020 sub new {
403403 if ($firstgroup[$i]) {return 1};
404404 if ($secondgroup[$i]) {return -1};
405405
406 # Check whether they argument names are in the @standardopts list
406 # Sort by order parameter if the order parameters are different
407 if (defined($firstarg->{'order'}) && defined($secondarg->{'order'}) &&
408 $firstarg->{'order'} != $secondarg->{'order'}) {
409 return $firstarg->{'order'} cmp $secondarg->{'order'};
410 }
411
412 # Check whether the argument names are in the @standardopts list
407413 for ($i = 0; $i <= $#standardopts; $i++) {
408414 my $firstinlist = ($first =~ /^$standardopts[$i]/);
409415 my $secondinlist = ($second =~ /^$standardopts[$i]/);
759765 $dat->{'args_byname'}{'PageSize'}{'vals_byname'}{$setting}{'driverval'} = $code;
760766 $dat->{'args_byname'}{'PageRegion'}{'vals_byname'}{$setting}{'driverval'} = $code;
761767 }
762 } elsif (m!^\*Open(Sub|)Group:\s*([^\s/]+)(/(.*)|)$!) {
768 } elsif (m!^\*Open(Sub|)Group:\s*([^/]+)(/(.*)|)$!) {
763769 # "*Open[Sub]Group: <group>[/<translation>]
764770 my $group = $2;
771 chomp($group) if $group;
765772 my $grouptrans = $4;
773 chomp($grouptrans) if $grouptrans;
766774 if (!$grouptrans) {
767775 $grouptrans = longname($group);
768776 }
771779 }
772780 $currentgroup .= $group;
773781 push(@currentgrouptrans, $grouptrans);
774 } elsif (m!^\*Close(Sub|)Group:\s*([^\s/]+)$!) {
782 } elsif (m!^\*Close(Sub|)Group:\s*([^/]+)$!) {
775783 # "*Close[Sub]Group: <group>"
776784 my $group = $2;
785 chomp($group) if $group;
777786 $currentgroup =~ s!$group$!!;
778787 $currentgroup =~ s!/$!!;
779788 pop(@currentgrouptrans);
10301039 $dat->{'args_byname'}{$currentargument}{'vals_byname'}{$setting}{'comment'} = $translation;
10311040 # Make sure that this argument has a default setting, even
10321041 # if none is defined in this PPD file
1033 if ($dat->{'args_byname'}{$currentargument}{'default'} eq "") {
1042 if (!defined($dat->{'args_byname'}{$currentargument}{'default'}) ||
1043 ($dat->{'args_byname'}{$currentargument}{'default'} eq "")) {
10341044 $dat->{'args_byname'}{$currentargument}{'default'} = $setting;
10351045 }
10361046 }
11871197 if (!$isfoomatic) {
11881198 $dat->{'make'} = undef;
11891199 $dat->{'model'} = undef;
1190 sortoptions($dat, 1);
1200 #sortoptions($dat, 1);
11911201 }
11921202
11931203 return $dat;
19571967 if ($arg->{'default'} < $arg->{'min'}) {
19581968 $arg->{'default'} = $arg->{'min'};
19591969 $arg->{'cdefault'} = $arg->{'default'};
1960 } elsif ($arg->{'cdefault'} > $arg->{'max'}) {
1970 } elsif ($arg->{'default'} > $arg->{'max'}) {
19611971 $arg->{'default'} = $arg->{'max'};
19621972 $arg->{'cdefault'} = $arg->{'default'};
19631973 } elsif (defined($arg->{'vals_byname'}{$arg->{'default'}})) {
20242034 } else {
20252035 return $str;
20262036 }
2037 }
2038
2039 sub ppd1284DeviceID {
2040
2041 # Clean up IEEE-1284 device ID to only contain the fields relevant
2042 # to printer model auto-detection (MFG, MDL, DES, CMD, SKU), this
2043 # the line length limit of PPDs does not get exceeded on very long
2044 # ID strings.
2045
2046 my ($id) = @_;
2047 my $ppdid = "";
2048
2049 foreach my $field ("(MFG|MANUFACTURER)", "(MDL|MODEL)", "(CMD|COMMAND SET)", "(DES|DESCRIPTION)", "SKU") {
2050 if ($id =~ m/(\b$field:[^:;]+;)/is) {
2051 $ppdid .= $1;
2052 }
2053 }
2054
2055 return $ppdid;
2056 }
2057
2058 sub getppdheaderdata {
2059
2060 my ($dat, $driver, $recdriver) = @_;
2061
2062 # Complete IEEE 1284 ID string?
2063 my $ieee1284;
2064 $ieee1284 = $dat->{'general_ieee'} or $ieee1284 = $dat->{'pnp_ieee'} or
2065 $ieee1284 = $dat->{'par_ieee'} or $ieee1284 = $dat->{'usb_ieee'} or
2066 $ieee1284 = $dat->{'snmp_ieee'} or $ieee1284 = "";
2067 # Extract data fields from the ID string
2068 my $ieeemake;
2069 my $ieeemodel;
2070 my $ieeecmd;
2071 my $ieeedes;
2072 if ($ieee1284) {
2073 $ieee1284 =~ /(MFG|MANUFACTURER):([^:;]+);/;
2074 $ieeemake = $2;
2075 $ieee1284 =~ /(MDL|MODEL):([^:;]+);/;
2076 $ieeemodel = $2;
2077 $ieee1284 =~ /(CMD|COMMANDS\s+SET):([^:;]+);/;
2078 $ieeecmd = $2;
2079 $ieee1284 =~ /(DES|DESCRIPTION):([^:;]+);/;
2080 $ieeedes = $2;
2081 }
2082 # Auto-detection data listed field by field in the printer XML file?
2083 my $pnpmake;
2084 $pnpmake = $ieeemake or $pnpmake = $dat->{'general_mfg'} or
2085 $pnpmake = $dat->{'pnp_mfg'} or $pnpmake = $dat->{'par_mfg'} or
2086 $pnpmake = $dat->{'usb_mfg'} or $pnpmake = "";
2087 my $pnpmodel;
2088 $pnpmodel = $ieeemodel or $pnpmodel = $dat->{'general_mdl'} or
2089 $pnpmodel = $dat->{'pnp_mdl'} or $pnpmodel = $dat->{'par_mdl'} or
2090 $pnpmodel = $dat->{'usb_mdl'} or $pnpmodel = "";
2091 my $pnpcmd;
2092 $pnpcmd = $ieeecmd or $pnpcmd = $dat->{'general_cmd'} or
2093 $pnpcmd = $dat->{'pnp_cmd'} or $pnpcmd = $dat->{'par_cmd'} or
2094 $pnpcmd = $dat->{'usb_cmd'} or $pnpcmd = "";
2095 my $pnpdescription;
2096 $pnpdescription = $ieeedes or
2097 $pnpdescription = $dat->{'general_des'} or
2098 $pnpdescription = $dat->{'pnp_des'} or
2099 $pnpdescription = $dat->{'par_des'} or
2100 $pnpdescription = $dat->{'usb_des'} or
2101 $pnpdescription = "";
2102 if ((!$ieee1284) && ((($pnpmake) && ($pnpmodel)) || ($pnpdescription))){
2103 $ieee1284 .= "MFG:$pnpmake;" if $pnpmake;
2104 $ieee1284 .= "MDL:$pnpmodel;" if $pnpmodel;
2105 $ieee1284 .= "CMD:$pnpcmd;" if $pnpcmd;
2106 $ieee1284 .= "DES:$pnpdescription;" if $pnpdescription;
2107 }
2108
2109 # Remove everything from the device ID which is not relevant to
2110 # auto-detection of the printer model.
2111 $ieee1284 = ppd1284DeviceID($ieee1284) if $ieee1284;
2112
2113 my $make = $dat->{'make'};
2114 my $model = $dat->{'model'};
2115
2116 $pnpmake = $make if !$pnpmake;
2117 $pnpmodel = $model if !$pnpmodel;
2118
2119 # File name for the PPD file
2120 my $filename = join('-',($dat->{'make'},
2121 $dat->{'model'},
2122 $driver));;
2123 $filename =~ s![ /\(\)]!_!g;
2124 $filename =~ s![\+]!plus!g;
2125 $filename =~ s!__+!_!g;
2126 $filename =~ s!_$!!;
2127 $filename =~ s!^_!!;
2128 $filename =~ s!_-!-!;
2129 $filename =~ s!-_!-!;
2130 my $longname = "$filename.ppd";
2131
2132 # Driver name
2133 my $drivername = $driver;
2134
2135 # Do we use the recommended driver?
2136 my $driverrecommended = "";
2137 if ($driver eq $recdriver) {
2138 $driverrecommended = " (recommended)";
2139 }
2140
2141 # evil special case.
2142 $drivername = "stp-4.0" if $drivername eq 'stp';
2143
2144 # Nickname for the PPPD file
2145 my $nickname =
2146 "$make $model Foomatic/$drivername$driverrecommended";
2147 my $modelname = "$make $model";
2148 # Remove forbidden characters (Adobe PPD spec 4.3 section 5.3)
2149 $modelname =~ s/[^A-Za-z0-9 \.\/\-\+]//gs;
2150
2151 return ($ieee1284,$pnpmake,$pnpmodel,$filename,$longname,
2152 $drivername,$nickname,$modelname);
20272153 }
20282154
20292155 #
33503476 $pcfilename = 'FOOMATIC' if !defined($pcfilename);
33513477 my $model = $dat->{'model'};
33523478 my $make = $dat->{'make'};
3353 my $ieee1284;
3354 $ieee1284 = $dat->{'general_ieee'} or $ieee1284 = $dat->{'pnp_ieee'} or
3355 $ieee1284 = $dat->{'par_ieee'} or $ieee1284 = $dat->{'usb_ieee'} or
3356 $ieee1284 = $dat->{'snmp_ieee'} or $ieee1284 = "";
3357 my $ieeemodel;
3358 my $ieeemake;
3479 my ($ieee1284,$pnpmake,$pnpmodel,$filename,$longname,
3480 $drivername,$nickname,$modelname) =
3481 getppdheaderdata($dat, $dat->{'driver'}, $dat->{'recdriver'});
33593482 if ($ieee1284) {
3360 $ieee1284 =~ /(MDL|MODEL):([^:;]+);/;
3361 $ieeemodel = $2;
3362 $ieee1284 =~ /(MFG|MANUFACTURER):([^:;]+);/;
3363 $ieeemake = $2;
3364 }
3365 my $pnpmodel;
3366 $pnpmodel = $dat->{'general_mdl'} or $dat->{'pnp_mdl'} or
3367 $pnpmodel = $dat->{'par_mdl'} or $pnpmodel = $dat->{'usb_mdl'} or
3368 $pnpmodel = $ieeemodel or $pnpmodel = $model;
3369 my $pnpmake;
3370 $pnpmake = $dat->{'general_mfg'} or $dat->{'pnp_mfg'} or
3371 $pnpmake = $dat->{'par_mfg'} or $pnpmake = $dat->{'usb_mfg'} or
3372 $pnpmake = $ieeemake or $pnpmake = $make;
3373 if ($ieee1284) {
3374 $ieee1284 =~ s/;(.)/;\n $1/gs;
3375 $ieee1284 = "*1284DeviceID: \"\n " . $ieee1284 . "\n\"\n*End";
3376 }
3377 my $filename = join('-',($dat->{'make'},
3378 $dat->{'model'},
3379 $dat->{'driver'}));;
3380 $filename =~ s![ /\(\)]!_!g;
3381 $filename =~ s![\+]!plus!g;
3382 $filename =~ s!__+!_!g;
3383 $filename =~ s!_$!!;
3384 $filename =~ s!_-!-!;
3385 $filename =~ s!^_!!;
3386 my $longname = "$filename.ppd";
3387
3388 my $drivername = $dat->{'driver'};
3389
3390 # Do we use the recommended driver?
3391 my $driverrecommended = "";
3392 if ($dat->{'driver'} eq $dat->{'recdriver'}) {
3393 $driverrecommended = " (recommended)";
3394 }
3395
3396 # evil special case.
3397 $drivername = "stp-4.0" if $drivername eq 'stp';
3398
3399 # Do not use "," or "+" in the *ShortNickName to make the Windows
3400 # PostScript drivers happy
3401 my $nickname =
3402 "$make $model Foomatic/$drivername$driverrecommended";
3403 my $modelname = "$make $model";
3404 # Remove forbidden characters (Adobe PPD spec 4.3 section 5.3)
3405 $modelname =~ s/[^A-Za-z0-9 \.\/\-\+]//gs;
3483 #$ieee1284 =~ s/;(.)/;\n $1/gs;
3484 #$ieee1284 = "*1284DeviceID: \"\n " . $ieee1284 . "\n\"\n*End";
3485 #$ieee1284 =~ s/;(.)/;\n $1/gs;
3486 $ieee1284 = "*1284DeviceID: \"" . $ieee1284 . "\"";
3487 }
34063488 # Do not use "," or "+" in the *ShortNickName to make the Windows
34073489 # PostScript drivers happy
34083490 my $shortnickname = "$make $model $drivername";
5353 'cups-ppds' => '$ENV{CUPS_PPDS}',
5454 'cups-filters' => '$ENV{CUPS_FILTERS}',
5555 'cups-backends' => '$ENV{CUPS_BACKENDS}',
56 'cups-driver' => '$ENV{LIB_CUPS}/driver',
5657 'cups-pconf' => '$ENV{CUPS_PCONF}',
5758 'cups-lpr' => '$ENV{CUPS_LPR}',
5859 'cups-lpq' => '$ENV{CUPS_LPQ}',
135136 'cups-ppds' => '$ENV{CUPS_PPDS}',
136137 'cups-filters' => '$ENV{CUPS_FILTERS}',
137138 'cups-backends' => '$ENV{CUPS_BACKENDS}',
139 'cups-driver' => '$ENV{LIB_CUPS}/driver',
138140 'cups-pconf' => '$ENV{CUPS_PCONF}',
139141 'cups-lpr' => '$ENV{CUPS_LPR}',
140142 'cups-lpq' => '$ENV{CUPS_LPQ}',