Bug 73067 - CUPS printer support
CUPS printer support
Status: CLOSED CURRENTRELEASE
Product: Red Hat Raw Hide
Classification: Retired
Component: openoffice.org (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Dan Williams
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-08-30 07:03 EDT by Toralf
Modified: 2007-04-18 12:46 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-02-27 10:47:09 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
CUPS-to-psprint; an alternative to spadmin etc. (3.31 KB, text/plain)
2002-08-30 07:05 EDT, Toralf
no flags Details
Example psprint.conf (generated) (784 bytes, patch)
2002-08-30 09:50 EDT, Toralf
no flags Details | Diff
Updated CUPS-to-psprint (3.62 KB, text/plain)
2003-09-11 03:51 EDT, Toralf
no flags Details

  None (edit)
Description Toralf 2002-08-30 07:03:16 EDT
I have a C++ program that will generate psprint.conf based on current printer
setting in CUPS. It will be attached here; please feel free to include it in
your distribution.

Of course, OOo should do something like this internally, rather that having all
this psprint stuff in the first place. I have also submitted a version of the
program to OpenOffice.org, but not received a lot of feedback.
Comment 1 Toralf 2002-08-30 07:05:01 EDT
Created attachment 73938 [details]
CUPS-to-psprint; an alternative to spadmin etc.
Comment 2 Jakub Jelinek 2002-08-30 09:32:19 EDT
Bero/Tim, can you please check this out?
ATM I'm generating psprint.conf when user first time starts /usr/bin/ooffice,
but just use the defaults and lpr as command. It would be certainly possible
to run a program like this at that time if CUPS is configured and modify
the default psprint.conf, can one of you send me a sample psprint.conf it
generates when CUPS is configured (I don't use CUPS at all)?
Comment 3 Tim Waugh 2002-08-30 09:41:36 EDT
(Neither do I, yet.)  
  
It will be weird if OOo automatically groks CUPS printers but not LPRng ones,  
since LPRng is still the default spooler for this release.
Comment 4 Toralf 2002-08-30 09:50:08 EDT
Created attachment 73965 [details]
Example psprint.conf (generated)
Comment 5 Toralf 2002-08-30 09:54:18 EDT
Example of generated file has been attached. Corresponding 'lpstat' output is
included below.

Surely, it is quite simple to do the same thing for LPRng. I woudn't really know
, though, as I've never used it; I started replacing lpr on our Red Hat
installations with CUPS when we were on release 5.2 or so.

% lpstat -t
scheduler is running
system default destination: magritte
device for dali: lpd://dali/dali
device for fax: fax://ioserv/fax
device for magritte: ipp://magritte:631/ipp
device for pdf: pdf:~/printout.pdf
dali accepting requests since Jan 01 00:00
fax accepting requests since Jan 01 00:00
magritte accepting requests since Jan 01 00:00
pdf accepting requests since Jan 01 00:00
printer dali is idle.  enabled since Jan 01 00:00
printer fax is idle.  enabled since Jan 01 00:00
printer magritte is idle.  enabled since Jan 01 00:00
printer pdf is idle.  enabled since Jan 01 00:00


Comment 6 Jakub Jelinek 2002-08-30 10:22:57 EDT
So basically all you query are the printer queue names, model name and which
one is the default. Tim, how can this be queried for LPRng (ideally from shell
script)?
Comment 7 Tim Waugh 2002-08-30 10:28:53 EDT
LPRng's 'lpstat -s' gives output like this: 
 
scheduler is running 
system default destination: stylus 
system for stylus: localhost 
system for deskjet: localhost 
system for stylus-hi: localhost 
system for deskjet-duplex: localhost 
system for stylus-raw: localhost 
system for deskjet-raw: localhost 
 
All that's missing is the model name, and I guess 'generic postscript' would 
be fine.
Comment 8 Jakub Jelinek 2002-08-30 10:57:48 EDT
Actually, the program copies the PPD file too, if available.
Is lpdomatic for this or how can it be queried?
Comment 9 Tim Waugh 2002-08-30 11:05:23 EDT
LPRng doesn't use PPD files. 
 
The kind of information you need is in the output of printconf-tui --Xexport, 
but you need to be root for that (for good reason). 
Comment 10 Toralf 2002-08-30 15:25:00 EDT
Actually, this only makes sense if you can find a PPD file specific to the
printer. "Generic" entries for the configured printers are added automatically,
at least when CUPS is being used.

I'm running the program as root, by the way, actually I've a "run-parts" job for
it to make sure everything stays consistent. Output is to <OO install
dir>/share/psprint/psprint.conf. We are using a slightly different wrapper that
will _remove_ files like psprint.conf from the user's setup, and configure
everything so that the "global" versions are used instead. The only sensible
way, IMO. I'd prefer switching to the Red Hat version of OOo, though, as I'm not
really interested in maintaining packages of my own.
Comment 11 Toralf 2003-09-11 03:51:59 EDT
Created attachment 94408 [details]
Updated CUPS-to-psprint

Here is a new version of the psprint.conf generator. It still updates shared
psprint.conf, and I start it from run-parts in order to keep printers in sync.
I've been wondering if I should modify it to create *user* psprint.conf after
all, though, and execute it (from the wrapper) on every OOo startup. That would
increase startup time a bit, though. (But maybe it would be possible to check
if CUPS printers have changed since last time, and issue the program if, and
only if, they have.)
Comment 12 Toralf 2003-09-11 04:01:56 EDT
The wrapper might perhaps to


(cd $OOHOME/user/psprint
 if [ ! -r psprint.conf -o /etc/cups/printers.conf -nt psprint.conf ]
 then
   openoffice-cups
 fi
)

with openoffice-cups modified to write config to "psprint.conf" on current
directory, and store PPD in "driver" (relative to current dir.)
Comment 13 Dan Williams 2004-02-27 10:47:09 EST
Current OOO >= 1.1.0-20 use CUPS to discover printers.

Note You need to log in before you can comment on or make changes to this bug.