Printing on Gentoo

My printer is connected via USB to a MacBook. As the vendor provides PPD files for that printer, installation on the MacBook was pretty simple. In order to access the printer from my Gentoo Linux box, I did the following:

  1. Added some USE flags to my /etc/portage/make.conf:
    USE="... dbus cups avahi zeroconf mdnsresponder-compat"
  2. Installed avahi, nss-mdns, and cups:
    # emerge avahi nss-mdns cups
  3. Added mdns4_minimal to the hosts section of my /etc/nsswitch.conf, e.g.:
    hosts:	files mdns4_minimal dns
  4. Set avahi, dbus, and cups to automatically boot during system startup:
    # rc-update add avahi-daemon default
    # rc-update add dbus default
    # rc-update add cupsd default
    # rc-update add cups-browsed default
    
  5. Started these services:
    # rc-service dbus start
    # rc-service avahi-daemon start
    # rc-service cupsd start
    # rc-service cups-browsed start
    
  6. Powered on my Mac and printer
  7. Opened System Preferences and then Printers & Scanners on my Mac
  8. Selected my printer and activated Share this printer on the network
  9. Opened a webbrowser on my Gentoo box and opened http://localhost:631/
  10. Clicked on Printers in the top navigation bar, checked that my printer showed up, and copied its queue name (in my case that's Kyocera_FS_1010)
  11. Opened a terminal window and set that name as the default printer queue:
    $ lpoptions -d Kyocera_FS_1010
    
    Instead of calling lpoptions, you can manually write to ~/.cups/lpoptions:
    Default Kyocera_FS_1010
    
  12. Printed some fancy stuff by either calling
    $ lpr /girl/friend.jpg
    $ lp /girl/friend.jpg    # for you System V guys
    
    or by pressing CTRL+P in a webbrowser