this is obsolete doc -- see http://doc.nethence.com/ instead

Setting up CUPS and Splix on a NetBSD system (draft) 

for Samsung and new-Xerox printers 

 

Introduction 

Versions used: 

- NetBSD 6.1.2 (GENERIC) amd64 

- pkgsrc 2013Q4 & wip-20140118 

 

Installing CUPS and Splix 

Install and start the CUPS daemon, 

pkg_info | egrep -i 'foomatic|ghost|a2ps|poppler|cups|lpr|splix'
#pkg_delete LPRng-core LPRng-doc LPRng
echo $PKG_PATH
pkg_add cups
cd /etc/
cp /usr/pkg/share/examples/rc.d/cupsd rc.d/
cat >> rc.conf <<EOF9
cupsd=yes
EOF9
rc.d/cupsd start
ps aux | grep cups

 

Make sure you've got pkgsrc 2013Q4 as /usr/pkgsrc/ so it doesn't conflict with the binaries you are using, 

cd /usr/
#rm -rf pkgsrc*
cvs -q -z2 -d anoncvs@anoncvs.fr.netbsd.org:/cvsroot checkout -r pkgsrc-2013Q4 -P pkgsrc

fetch and extract latest wip into that, 

cd pkgsrc/
wget ...
tar xzf pkgsrc-wip-20140118-snapshot.tar.gz

and install the additional Splix PPDs for your Samsung or new-Xerox printer, 

cd wip/splix/
make show-depends
make show-options
unset PKG_PATH
make
make install

 

Configuring CUPS 

Make sure the daemon is providing its web service, 

netstat -an -f inet | grep 631

 

Enable remote access to the CUPS web interface, 

cd /etc/
ln -s ../usr/pkg/etc/cups
cd cups/
cp cupsd.conf cupsd.conf.dist

change, 

Listen 0.0.0.0:631
<Location />
  Order allow,deny

Allow 192.168.0 

</Location>
<Location /admin>
  Order allow,deny

Allow 192.168.0 

</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny

Allow 192.168.0 

</Location>

and apply, 

cd ../
rc.d/cupsd restart

 

Configuring a printer 

Try to configure the printer through the web interface but you'll see it's a no go, 

Administration > Add a printer (identify as root)

or add the printer from the command line, 

lpadmin -p scx1 -v usb:/dev/ulpt0 -P /usr/pkg/share/cups/model/samsung/scx4200.ppd 
#lpadmin -p scx2 -v usb:/dev/ulpn0 -P /usr/pkg/share/cups/model/samsung/scx4200.ppd 

 

With libusb disabled (install binary cups pkg, then compile ghostscript with cups option, then instyou should see the USB devices provided by the kernel. With libusb enabled... (TODO) 

 

Additional notes 

To wipe out CUPS entirely from your NetBSD system, 

#pkg_delete poppler poppler-utils cups splix ghostscript ghostscript-fonts
pkg_delete cups splix ghostscript foomatic-filters-cups foomatic-filters ghostscript-gpl ghostscript-fonts
rm -rf /var/spool/cups/
rm -rf /var/run/cups/
rm -rf /var/log/cups/
rm -rf /var/cache/cups/
rm -rf /usr/pkg/etc/cups/
rm -f /etc/rc.d/cupsd
userdel -r lp
groupdel lp

and see what's left, 

pkg_info | egrep -i 'foomatic|ghost|a2ps|poppler|cups|lpr|splix'

 

Ready to go 

Try to print something either using the CUPS intercface (print test page) on the printer page, or on the command line with, 

echo line 1\\nline 2 | /usr/pkg/bin/lp

 

Troubleshooting 

If you get this error while trying to print something, e.g., 

/usr/pkg/bin/lp: Unsupported document-format "text/plain".

 

References -- Cups 

how to setup cups in netbsd: http://wiki.netbsd.org/tutorials/how_to_setup_cups_in_netbsd/ 

OpenPrinting/Database/CUPSDocumentation: https://wiki.linuxfoundation.org/en/OpenPrinting/Database/CUPSDocumentation 

PPD files vs printer drivers also LPD vs LPRng vs CUPS: http://lists.freebsd.org/pipermail/freebsd-questions/2007-November/162393.html 

Printing: https://wiki.gentoo.org/wiki/Printing 

New cups - no usb printers?!: http://forums.gentoo.org/viewtopic-t-833584-start-0.html 

 

References -- Splix 

SPL driver for UNIX: http://splix.ap2c.org/ 

The pkgsrc-wip project: http://pkgsrc-wip.sourceforge.net/