cups freebsd

CUPS & Brother MFC1810 & AirPrint on FreeBSD

Installed before
1. Linux subsystem
2. Avahi
3. DBus

Install cups via ports (Source of Article)

I selected both Python and Perl bindings, and Avahi for advertisement (since we’ll be using Avahi to advertise the services anyway):

portmaster -dbH print/cups

Using the Brother driver (Source of Article)

Hopefully, I found possible to use the official Linux drivers provided by Brother on FreeBSD. This is made possible by the Linux emulation layer on FreeBSD.

Note the following:

CUPS should already be installed and running, and the printer should have been tested first using the generic driver as described above. Rationale: if the printer or the USB device somehow don’t work, the official driver can’t do anything about it. This has been tested on FreeBSD 7.0 for i386 (32bit). See notes below for some hints for the x86_64 architecture (64bit) and other versions of FreeBSD. Here are the steps:

  1. install the Linux compatibility libraries through port emulators/linux_base-fc7. Likely you need to set the Linux kernel version high enough prior to installing the port, using for example sysctl -w compat.linux.osrelease=2.6.9 (save to /etc/sysctl.conf to make the setting persistent).
  2. install print/psutils which contains pstops required by the Brother drivers.
  3. download the LPR driver and CUPS driver for your printer from Brother. Download specifically the Debian .deb files.
  4. extract manually the contents from the .deb files. They are .tar.bz2 files in disguise: use the command tar -xjf
  5. place manually the files in the appropriate FreeBSD directories:
    1. .so in /compat/linux/usr/lib
    2. bins in /usr/local/bin
    3. Brother-specific files in /usr/local/Brother
    4. CUPS data+filter in /usr/local/share/cups and /usr/local/libexec/cups
  6. edit all the script files included in the .deb and change the following:
    1. all references to files included in the .deb should be modified to point to their new FreeBSD location
    2. references to other tools (gs, pstops…) should be modified to point to /usr/local/bin instead of /usr/bin
    3. use path to USB device /dev/unlpt0 instead of /dev/usb/…
    4. the LPR installation script may contain commands to change the owner/group of files in /var/spool/lpd. Replace with user “root” and group “daemon” instead of the default “lp”.
  7. open the “postinst” scripts from both .debs and read what commands they use to setup the printer, and execute them manually (LPR driver first, then CUPS driver). This should register the Brother PPD file into CUPS and create the printer configuration.