You are not logged in.

#1 2015-06-20 21:01:25

rehono
Member
Registered: 2015-06-15
Posts: 16

Missing package() function brother mfc-j470dw

I can't install the printer driver brother mfc-j470dw from AUR: https://aur.archlinux.org/packages/brother-mfc-j470dw/

The aur is so odd, it is the latest version avalible on brother's website but is marked old.
The person i think confused mfc-j470dw with mfc-j4710dw as he mentions the correct model number in comments here:  https://aur.archlinux.org/packages/brother-mfc-j4510dw/

Anyways, if anyone knows how to fix the package please let me know.

Offline

#2 2015-06-20 21:53:47

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Missing package() function brother mfc-j470dw

It could also be marked out-of-date because it doesn't have a package() function (that used to be optional).

I don't see any actual building in the build() function, so you can probably make it work by renaming it to package() (although it would be cleaner to split it into prepare() and package()).

Offline

#3 2015-06-20 21:56:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,517
Website

Re: Missing package() function brother mfc-j470dw

prepare() {
    deb2targz *.deb
    rm -f *.deb
}

package() {
    cd $srcdir
    [ -d "mfc${_model}" ] || (mkdir mfc${_model}
    for i in *.tar.gz; do
        tar xfz $i -C mfc${_model};
    done
    cd mfc${_model}/opt/brother/Printers/mfc${_model}
    perl -i -pe 's#/etc/init.d#/etc/rc.d#g' ./cupswrapper/cupswrappermfc${_model}
    perl -i -pe 's#printcap\.local#printcap#g' $srcdir/mfc${_model}/opt/brother/Printers/mfc${_model}/inf/setupPrintcapij
    cp -rf $srcdir/mfc${_model}/usr/ $pkgdir/
    cp -rf $srcdir/mfc${_model}/opt/ $pkgdir/
}

This is a proper version of what is already there (replace the build function with this) - though it looks pretty horrendous still - I haven't tested it.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2015-06-21 02:34:34

rehono
Member
Registered: 2015-06-15
Posts: 16

Re: Missing package() function brother mfc-j470dw

yeah i wish it used rmp since deb2targz is abandoned project as well. I will give it a try. thx

Offline

#5 2015-06-21 03:58:48

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: Missing package() function brother mfc-j470dw

deb2targz is useless here since makepkg will have already extracted the deb with bsdtar/libarchive.

Offline

#6 2015-06-21 04:18:35

rehono
Member
Registered: 2015-06-15
Posts: 16

Re: Missing package() function brother mfc-j470dw

Scimmia wrote:

deb2targz is useless here since makepkg will have already extracted the deb with bsdtar/libarchive.

sudo pacman -R deb2targz 
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: brother-mfc-j470dw: requires deb2targz

hmm

just an update: the modifications by Trilby work great and I am able to print documents. But I do see two duplicate drivers for mfc-j470dw and one of the driver gives error but the other one works fine.
I don't know how to remove the non working driver. I tired removing printer but still has two drivers to choose from in localhost:631 with same name and only one works.
The two drivers are still present after I remove the brother-mfc-j470dw package.

Last edited by rehono (2015-06-21 04:34:08)

Offline

#7 2015-06-21 04:42:16

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: Missing package() function brother mfc-j470dw

Of course you have to edit the deps, too. That's a given.

Offline

#8 2015-06-23 03:30:58

rehono
Member
Registered: 2015-06-15
Posts: 16

Re: Missing package() function brother mfc-j470dw

Just another update, I found why there are three drivers for Brother printer, I had three ppd files:

lpinfo -m

/usr/share/cups/model/Brother/brother_mfcj470dw_printer_en.ppd
/opt/brother/Printers/mfcj470dw/cupswrapper/brother_mfcj470dw_printer_en.ppd 
/usr/share/ppd/Brother/brother_mfcj470dw_printer_en.ppd

I realised to just extract the ppd file from the cups deb with bsdtar and remove a line in ppd file I am going to reinstall all and see if I can just use the ppd file and update.

edit: i see /usr/lib/cups/filter/brother_lpdwrapper_mfcj470dw points to /usr/share/cups/model/Brother/brother_mfcj470dw_printer_en.ppd and uses /opt/brother/Printers/mfcj470dw/inf/brmfcj470dwrc
so i guess all the lpr deb files in opt need to be extracted to /opt and and i need to edit
/opt/brother/Printers/mfcj470dw/cupswrapper/cupswrappermfcj470dw file with sed or perl in this case
perl -i -pe 's#/etc/init.d#/etc/rc.d#g' cupswrappermfcj470dw

and /opt/brother/Printers/mfcj470dw/setupPrintcapij file
perl -i -pe 's#printcap\.local#printcap#g' setupPrintcapij

and then run /opt/brother/Printers/mfcj470dw/cupswrapper/cupswrappermfcj470dw file as root.

oh i also copied the /usr/bin/brprintconf_mfcj470dw file from deb package.

edit: just tested and it works really well.

Last edited by rehono (2015-06-23 05:53:58)

Offline

#9 2015-09-08 20:53:36

zago2015
Member
Registered: 2015-09-08
Posts: 1

Re: Missing package() function brother mfc-j470dw

I had a similar problem and I wrote a pkgbuild for this package, based on written by Florian Engel
this work on manjaro and archlinux 64bits, on wifi connection

 # Maintainer: Florian Engel <florian.engel@adletec.de>
# Copied from the MFC-J5910DW package created by Libernux <dutchman55@gmx.com>
pkgname="brother-mfc-j470dw"
_model="j470dw"
pkgver="3.0.0"
pkgrel=1
pkgdesc="LPR and CUPS driver for the Brother MFC-J470DW"
arch=('i686' 'x86_64')
url="http://solutions.brother.com/linux/en_us/"
license=('custom:brother commercial license')
depends=('cups')
install="$pkgname.install"
source=(
	"http://www.brother.com/pub/bsc/linux/dlf/mfc${_model}lpr-$pkgver-$pkgrel.i386.rpm"
	"http://www.brother.com/pub/bsc/linux/dlf/mfc${_model}cupswrapper-$pkgver-$pkgrel.i386.rpm"
)
md5sums=(
        'eab34a8277bc57239cd155079ed36152'
        '63d2f82f46592c876b49387b2ea4d797'
)
if test "$CARCH" == x86_64; then
  depends+=('lib32-glibc')
fi
prepare() {
#  do not install in '/usr/local'
	if [ -d $srcdir/usr/local/Brother ]; then
		install -d $srcdir/usr/share
		mv $srcdir/usr/local/Brother/ $srcdir/usr/share/brother
		rm -rf $srcdir/usr/local
	        sed -i 's|/usr/local/Brother|/usr/share/brother|g' `grep -lr '/usr/local/Brother' ./`
        fi
# setup cups-directories
	install -d $srcdir/usr/share/cups/model
	install -d $srcdir/usr/lib/cups/filter
#  go to the cupswrapper directory and find the source file from which to generate a ppd- and wrapper-file
	cd `find . -type d -name 'cupswrapper'`
	if [ -f cupswrapper* ]; then
		_wrapper_source=`ls cupswrapper*`
		sed -i '/^\/etc\/init.d\/cups/d' $_wrapper_source
		sed -i '/^sleep/d' $_wrapper_source
		sed -i '/^lpadmin/d' $_wrapper_source
		sed -i 's|/usr|$srcdir/usr|g' $_wrapper_source
		sed -i 's|/opt|$srcdir/opt|g' $_wrapper_source
		sed -i 's|/model/Brother|/model|g' $_wrapper_source
		sed -i 's|lpinfo|echo|g' $_wrapper_source
		export srcdir=$srcdir
		./$_wrapper_source
		sed -i 's|$srcdir||' $srcdir/usr/lib/cups/filter/*lpdwrapper*
		sed -i "s|$srcdir||" $srcdir/usr/lib/cups/filter/*lpdwrapper*
		rm $_wrapper_source
	fi
#  /etc/printcap is managed by cups
	rm `find $srcdir -type f -name 'setupPrintcap*'`
}
package() {
	cp -R $srcdir/usr $pkgdir
	if [ -d $srcdir/opt ]; then cp -R $srcdir/opt $pkgdir; fi
}

another pkgbuild with deb instead of rpm, based on written by  Kevin Sarendranath

 
# Maintainer: Kevin Sarendranath k.sarendranath@gmail.com
# Based on brother-mfc-j4510dw package from AUR

_model="j470dw"
pkgname="brother-mfc-$_model"
pkgver="3.0.0"
pkgrel=1
_revision=1
pkgdesc="LPR and CUPS driver for the Brother MFC-J470DW. Based on the brother-mfc-j4510dw package, all credit goes to raudi"
url="http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html"
arch=('i686' 'x86_64')
license='unknown'
install="brother-mfc-${_model}.install"
depends=('tcsh' 'deb2targz' 'perl' 'a2ps')
source=("http://www.brother.com/pub/bsc/linux/dlf/mfc${_model}lpr-${pkgver}-${_revision}.i386.deb"
    "http://www.brother.com/pub/bsc/linux/dlf/mfc${_model}cupswrapper-${pkgver}-${_revision}.i386.deb")
md5sums=('20b923565536e94732a946e91ac3719f'
         '5bf2fed1702e94a06e3b9332d9c29bf1')


build() {
    deb2targz *.deb >/dev/null || return 1
    rm -f *.deb || return 1
    cd $srcdir || return 1
    [ -d "mfc${_model}" ] || (mkdir mfc${_model} || return 1)
    for i in *.tar.gz;do tar xfz $i -C mfc${_model};done || return 1
    cd mfc${_model} || return 1
    cd opt/brother/Printers/mfc${_model} || return 1
    perl -i -pe 's#/etc/init.d#/etc/rc.d#g' ./cupswrapper/cupswrappermfc${_model} || return 1
    perl -i -pe 's#printcap\.local#printcap#g' $srcdir/mfc${_model}/opt/brother/Printers/mfc${_model}/inf/setupPrintcapij || return 1
    cp -rf $srcdir/mfc${_model}/usr/ $pkgdir/ || return 1
    cp -rf $srcdir/mfc${_model}/opt/ $pkgdir/ || return 1
}

Offline

Board footer

Powered by FluxBB