System :: cups-1.3.5



So... I compiled hplip-2.8.2 separately from cups-1.3.5 - the only thing hplip does as far as cups is concerned is add two backends, hp & hpfax.

Once these have been added however, the cups browser interface automatically detects the printer (uri=hp:/usb/OfficeJet_K80?serial=ES0911401VOH) and the cups test page prints without problems - using the copies of gs, foomatic-rip and hpijs I compiled with cups...

I'm kind of at a loss to understand why the usb backend will not print to a usb printer when the hp backend will print to a usb printer - hplip requires usb headers/libs to compile whereas cups doesn't, but then the cups usb backend manages to query the printer correctly anyway...

OK, so leaving aside the issue of why I cannot print via the usb backend to a usb port, I'd like to make the cups extension a little more user friendly than the one inside the hplip extension...

The idea would be that a script(s) in the extension would:

1. Create the various directories required in /var (unless they already exist)
2. Copy the various .conf files required to /etc (unless they already exist)
3. Prompt the user to enter a root password (unless it is already set)
4. Start the cups scheduler (unless it is already running)
5. Start firefox & load the cups browser interface http://localhost:631 (unless it is already open)

Writing the script(s) is one issue, but probably the bigger issue is if it is OK, dsl-wise, to have a uci extension creating a bunch of folders/files that will not be removed when it is unloaded. I've tried to think of another way to do this - does anybody have a better idea?

Is there a script that would automatically run when a uci is loaded, or would I have to run the above script(s) from an icon/menu item?

There is (currently) no "autorun" feature.  It would be best to have the scripts to be manually invoked, and perhaps have the option of executing a script that will uninstall those files and then unload the extension.
OK, so I finally got cups-1.3.5 to print after I realised my OfficeJetG85/OfficeJetK80 would need hpoj as well as hpijs. Now I can print from a 2.4MB extension (cups+hpijs+hpoj+foomatic) as opposed to a 20MB extension (cups+hplip+libusb+foomatic+epsgs, plus python, plus...).

In case anybody is interested, the trick is:
Code Sample
$ sudo /opt/cups-1.3.5/sbin/ptal-init setup
Probe for USB-connected devices ([y]/n)?  

Probing "/dev/usb/lp0"...  
   Found "OfficeJet G85"
   with serial number "SGG13E0C49VL".
Starting the HP OfficeJet Linux driver.
   mlc:usb:OfficeJet_G85

$ sudo /opt/cups-1.3.5/lib/cups/backend/ptal      
direct ptal:/mlc:usb:OfficeJet_G85 "Hewlett-Packard OfficeJet G85" "PTAL mlc:usb:OfficeJet_G85"

...and now on restarting cups admin, the printer is found automatically

Device URI: ptal:/mlc:usb:OfficeJet_G85.

I've started to set up an extension named cups-1.3.5.uci with a menu item/icon that calls a script that creates the folders cups requires (or else it will not work) in /var.

The next thing I would like the script to do is:

IF /etc/cups does not exist
THEN create /etc/cups and copy cupsd.conf to it
ELSE IF /etc/cups/cupsd.conf does not exist
THEN copy cupsd.conf to /etc/cups

and

IF cupsd is not running
THEN start cupsd [maybe it should be restarted anyway?]

I be grateful if somebody could spare me several hours of messing around with bash, trying to figure out how to do this  :)

the "exists" test is -e.. So

IF /etc/cups does not exist
would be
if [ ! -e /etc/cups ]; then

And cupsd not running:
if ! ps | grep cupsd; then

Next Page...
original here.