You are not logged in.

#1 2014-08-28 08:22:16

D101101
Member
Registered: 2014-07-02
Posts: 36

driver for Brother DCP-1512/DCP-1510 printer

Can someone help me to port the driver from Ubuntu to Archlinux?
package from AUR doesn't work for me, I think the driver needs postinstall actions
I tried to create a .install file and now application finds the printer, but I still can't use it

post_install() {
	/opt/brother/Printers/DCP1510/inf/setupPrintcap DCP1510 -i USB
	/opt/brother/Printers/DCP1510/inf/braddprinter -i DCP1510
	systemctl restart cups.service
	if [ ! -e /usr/sbin/pstops ];then
	 PSTOPS=/usr/bin/pstops
	 if [ "`echo $PSTOPS | grep -i cups`" != "" ];then
	  PSTOPS=""
	 fi
	 if [ "$PSTOPS" != "" ];then
	   echo \[psconvert2\]   >>/opt/brother/Printers/DCP1510/inf/brDCP1510func
	   echo pstops=$PSTOPS >>/opt/brother/Printers/DCP1510/inf/brDCP1510func
	 fi
	fi

	ln -s /opt/brother/Printers/DCP1510/inf/brDCP1510rc       /etc/opt/brother/Printers/DCP1510/inf/brDCP1510rc

	if [ ! -e /usr/bin/brprintconflsr3_DCP1510 ];then
	 echo "#! /bin/sh"  > /usr/bin/brprintconflsr3_DCP1510
	 echo "/opt/brother/Printers/DCP1510/lpd/brprintconflsr3 -P DCP1510" '$''*'           >>/usr/bin/brprintconflsr3_DCP1510
	  chmod 755 /usr/bin/brprintconflsr3_DCP1510
	fi
#
#
	if [ -e /usr/lib/cups/filter ] &&    [ ! -e /usr/lib/cups/filter/brother_lpdwrapper_DCP1510 ];then 
	  ln -s /opt/brother/Printers/DCP1510/cupswrapper/brother_lpdwrapper_DCP1510      /usr/lib/cups/filter
	fi
	if [ -e /usr/lib32/cups/filter ] &&    [ ! -e /usr/lib32/cups/filter/brother_lpdwrapper_DCP1510 ];then 
	  ln -s /opt/brother/Printers/DCP1510/cupswrapper/brother_lpdwrapper_DCP1510      /usr/lib32/cups/filter
	fi

	if [ -e /usr/share/cups/model ];then
	  ln -s /opt/brother/Printers/DCP1510/cupswrapper/brother-DCP1510-cups-en.ppd      /usr/share/cups/model
	  PPDDIR=/usr/share/cups/model/
	fi
	if [ -e /usr/share/ppd ];then
	  if [ ! -e /usr/share/ppd/brother ];then
	    mkdir /usr/share/ppd/brother
	  fi
	  ln -s /opt/brother/Printers/DCP1510/cupswrapper/brother-DCP1510-cups-en.ppd      /usr/share/ppd/brother
	  PPDDIR=/usr/share/ppd/brother/
	fi
	uris=$(lpinfo -v)

	for uri in $uris
	do  
	  URI=$(echo $uri | grep DCP-1510 | grep usb)
	  if [ "$URI" != '' ];then
	    break;
	  fi
	done

	if [ "$URI" = '' ];then
	  for uri in $uris
	  do  
	    URI=$(echo $uri | grep DCP-1510)
	    if [ "$URI" != '' ];then
	      break;
	    fi
	  done
	fi

	if [ "$URI" = '' ];then
	  for uri in $uris
	  do
	    URI=$(echo $uri | grep -i Brother | grep usb)
	    if [ "$URI" != '' ];then
	      break;
	    fi
	  done
	fi
	if [ "$URI" = '' ];then
	  for uri in $uris
	  do
	    URI=$(echo $uri | grep usb)
	    if [ "$URI" != '' ];then
	      break;
	    fi
	  done
	fi

	if [ "$URI" = '' ];then
	  URI="usb://dev/usb/lp0"
	fi

	echo lpadmin -p DCP1510  -E -v $URI -P ${PPDDIR}brother-DCP1510-cups-en.ppd
	lpadmin -p DCP1510 -E -v $URI -P ${PPDDIR}brother-DCP1510-cups-en.ppd

	if [ "$(which semanage 2> /dev/null)" != '' ];then
	  semanage fcontext -a -t cupsd_rw_etc_t '/etc/opt/brother/Printers/DCP1510/inf(/.*)?'
	  semanage fcontext -a -t cupsd_rw_etc_t '/opt/brother/Printers/DCP1510/inf(/.*)?'
	  semanage fcontext -a -t bin_t          '/opt/brother/Printers/DCP1510/lpd(/.*)?'
	  semanage fcontext -a -t bin_t          '/opt/brother/Printers/DCP1510/cupswrapper(/.*)?'

	  if [ "$(which restorecon  2> /dev/null)" != '' ];then
	    restorecon -R /opt/brother/Printers/DCP1510
	    restorecon -R /etc/opt/brother/Printers/DCP1510
	  fi
	fi
}

post_upgrade() {
	/bin/true
}

pre_remove() {
	/opt/brother/Printers/DCP1510/inf/setupPrintcap DCP1510 -e USB
	/opt/brother/Printers/DCP1510/inf/braddprinter -e DCP1510
	rm -fR /var/spool/lpd/DCP1510/* 2>/dev/null
	rm /etc/opt/brother/Printers/DCP1510/inf/brDCP1510rc 2>/dev/null

	if [ -e /usr/bin/brprintconflsr3_DCP1510 ];then
	 rm /usr/bin/brprintconflsr3_DCP1510
	fi
#
#
	lpadmin -x DCP1510

	if [ -e /usr/lib/cups/filter/brother_lpdwrapper_DCP1510  ];then
	  rm   /usr/lib/cups/filter/brother_lpdwrapper_DCP1510 
	fi
	if [ -e /usr/lib32/cups/filter/brother_lpdwrapper_DCP1510 ];then
	  rm   /usr/lib32/cups/filter/brother_lpdwrapper_DCP1510
	fi
	if [ -e /usr/lib64/cups/filter/brother_lpdwrapper_DCP1510 ];then
	  rm   /usr/lib64/cups/filter/brother_lpdwrapper_DCP1510
	fi
	if [ -e /usr/libexec/cups/filter/brother_lpdwrapper_DCP1510 ];then
	  rm   /usr/libexec/cups/filter/brother_lpdwrapper_DCP1510
	fi
	if [ -e /usr/share/ppd/brother/brother-DCP1510-cups-en.ppd ];then
	  rm /usr/share/ppd/brother/brother-DCP1510-cups-en.ppd
	  rmdir /usr/share/ppd/brother 2> /dev/null
	fi
	if [ -e /usr/share/cups/model/brother-DCP1510-cups-en.ppd ];then
	  rm /usr/share/cups/model/brother-DCP1510-cups-en.ppd
	fi
}

post_remove(){
	systemctl restart cups.service
#
#
	if [ "$(which semanage 2> /dev/null)" != '' ];then
	  semanage fcontext -d -t cupsd_rw_etc_t '/opt/brother/Printers/DCP1510/inf(/.*)?'
	  semanage fcontext -d -t cupsd_rw_etc_t '/etc/opt/brother/Printers/DCP1510/inf(/.*)?'
	  semanage fcontext -d -t bin_t          '/opt/brother/Printers/DCP1510/lpd(/.*)?'
	  semanage fcontext -d -t bin_t          '/opt/brother/Printers/DCP1510/cupswrapper(/.*)?'

	  if [ "$(which restorecon  2> /dev/null)" != '' ];then
	    restorecon -R /opt/brother/Printers/DCP1510
	    restorecon -R /etc/opt/brother/Printers/DCP1510
	  fi
	fi
}

my first post
brother-dcp1510 package
drivers for Ubuntu

Offline

#2 2014-08-30 09:31:30

D101101
Member
Registered: 2014-07-02
Posts: 36

Re: driver for Brother DCP-1512/DCP-1510 printer

any help..?
I don't want to install Ubuntu

Offline

#3 2014-08-30 11:31:01

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,562

Re: driver for Brother DCP-1512/DCP-1510 printer

Where did you get the content of that .install file from ?

Doesn't really matter, with references in it to stuff like /ect/opt , it's very unlikely that will work with AL.
remove the brother driver package, revert everything that .install did .

The re-install the original aur package.

Read the archwiki cups page.

decide which method you want to use to configure cups to work with your printer :
cups webinterface, command-line , or desktop environment printer setup tool.
(cups webinterface is imo the easiest / best way).


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#4 2014-08-30 12:53:24

D101101
Member
Registered: 2014-07-02
Posts: 36

Re: driver for Brother DCP-1512/DCP-1510 printer

...
ok
I reinstalled the original aur package

[sergey@Arch ~]$ pacman -Qm | grep brother
brother-dcp1510 3.0.1-1

[sergey@Arch ~]$ lsusb | grep Brother
Bus 001 Device 003: ID 04f9:02d0 Brother Industries, Ltd

[sergey@Arch ~]$ ls /dev/usb/lp*
/dev/usb/lp0

[sergey@Arch ~]$ lpc status

[sergey@Arch ~]$ id sergey
uid=1000(sergey) gid=1000(sergey) groups=1000(sergey),6(disk),7(lp),10(wheel),91(video),92(audio),96(scanner),1001(sudo),1003(sambashare),1005(autologin),1006(printadmin)

[sergey@Arch ~]$ cat /etc/cups/cups-files.conf | grep SystemGroup
SystemGroup sys root printadmin

[sergey@Arch ~]$ systemctl -a | grep cups
  cups.path                                                                                                  loaded    active   waiting   CUPS Printer Service Spool
  cups.service                                                                                               loaded    active   running   CUPS Printing Service
  cups.socket                                                                                                loaded    active   running   CUPS Printing Service Sockets

Libreoffice
105710851080108410861082110110821088107210851072-30082014-164659.png
http://localhost:631/admin/ - add printer
105710851080108410861082110110821088107210851072-30082014-164815.png

Offline

#5 2014-08-30 12:58:25

D101101
Member
Registered: 2014-07-02
Posts: 36

Re: driver for Brother DCP-1512/DCP-1510 printer

Lone_Wolf wrote:

Where did you get the content of that .install file from ?

I wrote it based on the files(postinst,prerm,postrm) of the .deb packages

Offline

#6 2014-08-30 15:06:35

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,562

Re: driver for Brother DCP-1512/DCP-1510 printer

I've just looked at the aur package, and that PKGBUILD is low quality.
(I wonder if it has ever worked at all)

I will be hard to get it working, starting  a new package from scratch has a beter chance to succeed imo.

Many brother printer drivers in AUR appear to be outdated, orphaned, bad quality etc.

searching for recently updated brother pacakges, led me to this one :
https://aur.archlinux.org/packages/brother-hl2140/

It's PKGBUILD looks ok to me, maybe you could use it as a starting point.

I suggest you create  a new thread in AUR Issues, Discussion & PKGBUILD Requests or Creating & Modifying Packages, as those are the subforums where you're likely to get help with writing  a package.

(i maintain an aur package for canon printers , but know nothing about brother printer drivers.)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB