diff options
author | Igor Muzyka | 2016-01-24 13:26:38 +0600 |
---|---|---|
committer | Igor Muzyka | 2016-01-24 13:26:38 +0600 |
commit | ee9a1e02f01dad5a20be8bb28a51450745f48d07 (patch) | |
tree | 5e118b3af5b14c1de8b4a885f95ba844957e32c5 | |
download | aur-ee9a1e02f01dad5a20be8bb28a51450745f48d07.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | PKGBUILD | 37 | ||||
-rw-r--r-- | install | 148 |
3 files changed, 205 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..c855fb774d95 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +# Generated by mksrcinfo v8 +# Sun Jan 24 07:11:34 UTC 2016 +pkgbase = brother-dcp1510 + pkgdesc = Brother cups and lpr driver for DCP-1510, DCP-1510r, DCP-1511, DCP-1512, DCP-1512r, DCP-1518 + pkgver = 3.0.1 + pkgrel = 1 + url = http://support.brother.com/g/s/id/linux/en/download_prn.html + install = install + arch = i686 + arch = x86_64 + license = GPL + depends = psutils + depends = cups + source = http://www.brother.com/pub/bsc/linux/dlf/dcp1510lpr-3.0.1-1.i386.deb + source = http://www.brother.com/pub/bsc/linux/dlf/dcp1510cupswrapper-3.0.1-1.i386.deb + md5sums = 20aad8606e54516346348702ff137701 + md5sums = 15a01c13ef18510b5b40576505cd016e + +pkgname = brother-dcp1510 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..c9db23a869e1 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,37 @@ +# Maintainer: Igor Muzyka <muzyka-iv@mail.ru> + +pkgname=brother-dcp1510 +pkgver=3.0.1 +pkgrel=1 +pkgdesc="Brother cups and lpr driver for DCP-1510, DCP-1510r, DCP-1511, DCP-1512, DCP-1512r, DCP-1518" +arch=('i686' 'x86_64') +url="http://support.brother.com/g/s/id/linux/en/download_prn.html" +license=('GPL') + +if [ "$(uname -m)" = "x86_64" ]; then + depends=('lib32-libstdc++5' 'psutils' 'cups') +else + depends=('psutils' 'cups') +fi + +source=(http://www.brother.com/pub/bsc/linux/dlf/dcp1510lpr-$pkgver-1.i386.deb + http://www.brother.com/pub/bsc/linux/dlf/dcp1510cupswrapper-$pkgver-1.i386.deb) + +md5sums=('20aad8606e54516346348702ff137701' + '15a01c13ef18510b5b40576505cd016e') + +install=install + +package() { +cd $srcdir +mkdir dcp1510lpr +mkdir dcp1510cupswrapper +cd dcp1510lpr +ar x ../dcp1510lpr-$pkgver-1.i386.deb +cd ../dcp1510cupswrapper +ar x ../dcp1510cupswrapper-$pkgver-1.i386.deb +cd $pkgdir +tar xvfp $srcdir/dcp1510lpr/data.tar.gz +tar xvfp $srcdir/dcp1510cupswrapper/data.tar.gz +sed -i '/chown/d' ./opt/brother/Printers/DCP1510/inf/setupPrintcap +} diff --git a/install b/install new file mode 100644 index 000000000000..a1ec8c06fe59 --- /dev/null +++ b/install @@ -0,0 +1,148 @@ +post_install() { +/opt/brother/Printers/DCP1510/inf/setupPrintcap DCP1510 -i USB +/opt/brother/Printers/DCP1510/inf/braddprinter -i DCP1510 +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/lib64/cups/filter ] && [ ! -e /usr/lib64/cups/filter/brother_lpdwrapper_DCP1510 ];then + ln -s /opt/brother/Printers/DCP1510/cupswrapper/brother_lpdwrapper_DCP1510 /usr/lib64/cups/filter +fi +if [ -e /usr/libexec/cups/filter ] && [ ! -e /usr/libexec/cups/filter/brother_lpdwrapper_DCP1510 ];then + ln -s /opt/brother/Printers/DCP1510/cupswrapper/brother_lpdwrapper_DCP1510 /usr/libexec/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 +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 + +echo "Start your cups service:" +echo ">>> systemctl start org.cups.cupsd" +echo "and add your printer in http://localhost:631/admin" +} + +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 + +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() { +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 +} |