Brother DCP-J525W

From Gentoo-en
Jump to: navigation, search

The license and generic instructions for installing this printer in Linux can be found below:

http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_prn.html#DCP-J525W

Notes

Only network access to this printer has been tested.

The ebuild is based on http://gpo.zugaina.org/Overlays/foo-overlay/net-print/brother-dcp-j315w-drivers

Driver Installation

1. If you already have a local portage overlay, skip to 2. If not, follow the instructions to enable your Local Overlay.
2. Go to your overlay directory (usually /usr/local/portage) and create a directory for the package:

cd /usr/local/portage && mkdir -p net-print/brother-dcp-j525w-drivers/

3. Paste the ebuild included below into the brother-dcp-j525w-drivers-1.ebuild file.
4. Generate the Mainfest file by running:

ebuild brother-dcp-j525w-drivers-1.ebuild digest

5. Emerge the driver package:

emerge net-print/brother-dcp-j525w-drivers

6. Restart CUPS:

/etc/init.d/cupsd restart
File: /usr/local/portage/net-print/brother-dcp-j525w-drivers/brother-dcp-j525w-drivers-1.ebuild
EAPI=4

inherit rpm multilib

DESCRIPTION="Brother DCP-J525W LPR+cupswrapper drivers"
HOMEPAGE="http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_prn.html#DCP-J525W"
SRC_URI="http://pub.brother.com/pub/com/bsc/linux/dlf/dcpj525wlpr-1.1.2-1.i386.rpm
         http://pub.brother.com/pub/com/bsc/linux/dlf/dcpj525wcupswrapper-1.1.2-1.i386.rpm"

LICENSE="GPL"
SLOT="0"
KEYWORDS="x86 amd64"
IUSE=""
RESTRICT="strip"

DEPEND="net-print/cups
                app-text/a2ps"
RDEPEND="${DEPEND}"

S="${WORKDIR}" # Portage will bitch about missing $S so lets pretend that we have vaild $S.

src_unpack() {
        rpm_unpack ${A}
}

src_install() {
        has_multilib_profile && ABI=x86

        dosbin "${WORKDIR}/usr/bin/brprintconf_dcpj525w"

        mkdir -p ${D}/opt/brother || die
        cp -r ${WORKDIR}/opt/brother/* ${D}/opt/brother/ || die

        mkdir -p ${D}/usr/libexec/cups/filter || die
        ( cd ${D}/usr/libexec/cups/filter && ln -s ../../../../opt/brother/Printers/dcpj525w/lpd/filterdcpj525w brlpdwrapperdcpj525w ) || die


        mkdir -p ${D}/usr/share/cups/model || die
        ( cd ${D}/usr/share/cups/model && ln -s ../../../../opt/brother/Printers/dcpj525w/cupswrapper/brother_dcpj525w_printer_en.ppd ) || die
}

pkg_postinst () {
        ewarn "You really wanna read this."
        elog "You need to use brprintconf_dcpj525w to change printer options"
        elog "For example, you should set paper type to A4 right after instalation"
        elog "or your prints will be misaligned!"
        elog
        elog "Set A4 Paper type:"
        elog "          brprintconf_dcpj525w -pt A4"
        elog
        elog "For more options just execute brprintconf_dcpj525w as root"
        elog "You can check current settings in:"
        elog "          /opt/brother/Printers/dcpj525w/inf/brdcpj525wrc"
        elog
        elog "To acces the printer via network:"
        elog "  1. Choose 'LPD/LPR Host or Printer'"
        elog "  2. As connection address, use 'lpd://<printer_ip>/binary_p1'"
}

# TODO: Write alternative to filterdcpj525w or patch it for the security manner.


Printer Installation

As the message states, you need to choose "LPD Printer" type and "lpd://<printer_ip>/binary_p1" address to get the printer working