stefan-langenmaier / brother-overlay

Portage overlay for Brother printer and scanner software
GNU General Public License v3.0
34 stars 41 forks source link

missing Brother DCP-J715W #95

Open zz64 opened 3 years ago

zz64 commented 3 years ago

Hi, there is a chance to add this model Brother DCP-J715W ? https://support.brother.com/g/b/downloadtop.aspx?c=fr&lang=fr&prod=dcpj715w_eu_as Found: dcpj715w_cupswrapper_GPL_source_1.1.3-1.tar.gz

Thanks.

stefan-langenmaier commented 3 years ago

Hello @zz64 ,

thanks for your input. As I don't own this model I won't be able to test it. It's best if you create the ebuild. I'll be happy to help you in creating it.

I suggest you take the binary packages

and this ebuild as template: net-print/brother-dcp9022cdw-bin/brother-dcp9022cdw-bin-1.1.3.ebuild

If you are more ambitous you can also look into this ebuild, which is partially build from source: net-print/brother-dcpj4120dw-bin/brother-dcpj4120dw-bin-3.0.1-r1.ebuild

zz64 commented 3 years ago

i get working the printer now, by extracting debian package in to /opt/brother... but is required extract "brlpdwrapperdcpj715w" shell script from installer. and this script need some modification...

/usr/libexec/cups/filter/brlpdwrapperdcpj715w link to --> /opt/brother/Printers/dcpj715w/cupswrapper/brlpdwrapperdcpj715w

#! /bin/sh
#
# Brother Print filter  >>
# Copyright (C) 2005-2011 Brother. Industries, Ltd.
#                                    Ver1.10

# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA  02111-1307  USA
#

#set -x

LOGFILE="/dev/null"
LOGLEVEL="1"
LOGCLEVEL="7"
DEBUG=1
NUPENABLE=1
LOG_LATESTONLY=1
errorcode=0
printer_model=dcpj715w
printer_name=DCPJ715W
device_name=DCP-J715W
pcfilename=715
device_model=Printers

if [ ${DEBUG} != 0 ]; then
    LOGFILE=/tmp/br_cupsfilter_dcpj715w_debug_log
fi

#PPDC=\`printenv | grep "PPD="\`
#PPDC=\`echo \$PPDC | sed -e 's/PPD=//'\`

#if [ "\$PPDC" = "" ]; then
    PPDC="/usr/share/cups/model/Brother/brother_${printer_model}_printer_en.ppd"
#fi

if [ ${LOGFILE} != "/dev/null" ]; then
  if [ ${LOG_LATESTONLY} == "1" ]; then
    rm -f ${LOGFILE}
    date                                                           >${LOGFILE}
  else
    if [ -e ${LOGFILE} ]; then
            date                                                        >>${LOGFILE}
    else
            date                                                        >${LOGFILE}
    fi
  fi
    echo "arg0 = ${0}"                                           >>${LOGFILE}
    echo "arg1 = ${1}"                                           >>${LOGFILE}
    echo "arg2 = ${2}"                                           >>${LOGFILE}
    echo "arg3 = ${3}"                                           >>${LOGFILE}
    echo "arg4 = ${4}"                                           >>${LOGFILE}
    echo "arg5 = ${5}"                                           >>${LOGFILE}
    echo "arg6 = ${6}"                                           >>${LOGFILE}
    echo "PPD  = ${PPD}"                                         >>${LOGFILE}
fi

INPUT_TEMP_PS=$(mktemp /tmp/br_input_ps.XXXXXX)

nup="cat"
if [ "$(echo ${5} | grep 'Nup=')" != '' ] && [ ${NUPENABLE} != 0 ]; then

        if   [ "$(echo ${5} | grep 'Nup=64')" != '' ]; then
                nup="psnup -64"
        elif [ "$(echo ${5} | grep 'Nup=32')" != '' ]; then
                nup="psnup -32"
        elif [ "$(echo ${5} | grep 'Nup=25')" != '' ]; then
                nup="psnup -25"
        elif [ "$(echo ${5} | grep 'Nup=16')" != '' ]; then
                nup="psnup -16"
        elif [ "$(echo ${5} | grep 'Nup=8')" != '' ]; then
                nup="psnup -8"
        elif [ "$(echo ${5} | grep 'Nup=6')" != '' ]; then
                nup="psnup -6"
        elif [ "$(echo ${5} | grep 'Nup=4')" != '' ]; then
                nup="psnup -4"
        elif [ "$(echo ${5} | grep 'Nup=2')" != '' ]; then
                nup="psnup -2"
        elif [ "$(echo ${5} | grep 'Nup=1')" != '' ]; then
                nup="cat"
        fi
        echo   "NUP=${nup}"                                      >>${LOGFILE}
   if [ -e /usr/bin/psnup ]; then
       if [ ${#} -ge 7 ]; then
               cat ${6}  | ${nup} > ${INPUT_TEMP_PS}
       else
               cat       | ${nup} > ${INPUT_TEMP_PS}
       fi
   else
       if [ ${#} -ge 7 ]; then
               cp ${6}  ${INPUT_TEMP_PS}
       else
               cat    > ${INPUT_TEMP_PS}
       fi
   fi
else
   if [ ${#} -ge 7 ]; then
      cp ${6}  ${INPUT_TEMP_PS}
   else
      cat    > ${INPUT_TEMP_PS}
   fi
fi
if [ -e "/opt/brother/${device_model}/${printer_model}/lpd/filter${printer_model}" ]; then
       :
else
    echo "ERROR: /opt/brother/${device_model}/${printer_model}/lpd/filter${printer_model} does not exist"   >>${LOGFILE}
    errorcode=30
    exit
fi

CUPSOPTION=$(echo "${5} Copies=${4}" | sed -e 's/BrMirror=OFF/MirrorPrint=OFF/' -e 's/BrMirror=ON/MirrorPrint=ON/' -e 's/BrChain/Chain/' -e 's/BrBrightness/Brightness/' -e 's/BrContrast/Contrast/' -e 's/BrHalfCut/HalfCut/' -e 's/BrAutoTapeCut/AutoCut/' -e 's/BrHalftonePattern/Halftone/' -e 's/Binary/Binary/' -e 's/Dither/Dither/' -e 's/ErrorDiffusion/ErrorDiffusion/' -e 's/PageSize/media/' -e 's/BrSheets/Sheets/' -e 's/multiple-document-handling/Collate/' -e 's/separate-documents-collated-copies/ON/' -e 's/separate-documents-uncollated-copies/OFF/')
if [ -e "/opt/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1" ]; then
  if [ ${DEBUG} = 0 ]; then
     /opt/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1  ${printer_name}  ${PPDC} 0 "\$CUPSOPTION" "${printer_model}">> /dev/null
  else
     /opt/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1  ${printer_name}  ${PPDC} ${LOGCLEVEL} "${CUPSOPTION}" "${printer_model}">>${LOGFILE}
  fi
fi

if [ ${DEBUG} -lt 10 ]; then
    cat    ${INPUT_TEMP_PS} | /opt/brother/${device_model}/${printer_model}/lpd/filter${printer_model} "\$\$" "CUPS" "USB"

    if [ ${LOGLEVEL} -gt 2 ];  then
           if [ ${LOGFILE} != "/dev/null" ]; then
             echo ""                                                    >>${LOGFILE}
             echo "    ------PostScript Data-------"                    >>${LOGFILE}
             cat    ${INPUT_TEMP_PS}                                     >>${LOGFILE}
           fi
    fi
fi
rm -f  ${INPUT_TEMP_PS}

exit ${errorcode}

directory tree:

/opt/brother/Printers/dcpj715w
├── bin
│   └── brprintconf_dcpj715w
├── cupswrapper
│   ├── brcupsconfpt1
│   ├── brlpdwrapperdcpj715w
│   ├── brother_dcpj715w_printer_en.ppd
│   └── cupswrapperdcpj715w
├── inf
│   ├── brdcpj715wfunc
│   ├── brdcpj715wrc
│   ├── ImagingArea
│   ├── lut
│   │   ├── brio08ba.bcm
│   │   ├── brio08bb.bcm
│   │   ├── brio08bc.bcm
│   │   ├── brio08be.bcm
│   │   ├── brio08bf.bcm
│   │   ├── brio08bg.bcm
│   │   └── brio08bk.bcm
│   ├── paperinfij2
│   └── setupPrintcapij
├── infos.txt
└── lpd
    ├── brdcpj715wfilter
    ├── filterdcpj715w
    └── psconvertij2

i have no idea how to make gentoo .ebuild with this modification :\ i can provide archive folder with script to make symbolic link to /usr... cups ppd and others.

stefan-langenmaier commented 3 years ago

Sorry for my late response. In case you are still interested you can test the new ebuild and compare it with your directory structure.

I used the rpm file to stay consistent with the other ebuild.