diff options
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | PKGBUILD | 43 | ||||
-rw-r--r-- | brother-mfc-7840w.install | 37 | ||||
-rw-r--r-- | brother-mfc-7840w.patch | 124 |
4 files changed, 227 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..a95e37a2b796 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = brother-mfc-7840w + pkgdesc = CUPS driver for Brother MFC-7840W printer + pkgver = 2.0.2 + pkgrel = 3 + url = http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html + install = brother-mfc-7840w.install + arch = i686 + arch = x86_64 + license = GPL + depends = cups + depends = ghostscript + depends = gsfonts + depends = foomatic-filters + source = http://www.brother.com/pub/bsc/linux/dlf/brmfc7840wlpr-2.0.2-1.i386.rpm + source = http://www.brother.com/pub/bsc/linux/dlf/cupswrapperMFC7840W-2.0.2-1.i386.rpm + source = brother-mfc-7840w.patch + sha256sums = 334c492d26abf59e83db4f0d16297956f53e5c71eb4ae315d59ded562f883fb1 + sha256sums = 1d8f4c17f6ec3bdfe5940afc703856b16e78e4e72e4c9452a8529f337ae7ad27 + sha256sums = 136b48610f92661dcad54698d3e09707b820f55fd6c076d02ef075c726864849 + depends_x86_64 = lib32-glibc + +pkgname = brother-mfc-7840w + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..23d417e0a4c5 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,43 @@ +# Maintainer: Nick Milosevic <nick000 at gmail dot com> +# Contributor: Igor Mosyagin <c6h10o5 at gmail dot com> +pkgname=brother-mfc-7840w +pkgver=2.0.2 +pkgrel=3 +pkgdesc="CUPS driver for Brother MFC-7840W printer" +arch=('i686' 'x86_64') +url="http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html" +license=('GPL') +depends=('cups' 'ghostscript' 'gsfonts' 'foomatic-filters') +depends_x86_64=('lib32-glibc') +install="brother-mfc-7840w.install" +source=(http://www.brother.com/pub/bsc/linux/dlf/brmfc7840wlpr-$pkgver-1.i386.rpm + http://www.brother.com/pub/bsc/linux/dlf/cupswrapperMFC7840W-$pkgver-1.i386.rpm + brother-mfc-7840w.patch) + +sha256sums=('334c492d26abf59e83db4f0d16297956f53e5c71eb4ae315d59ded562f883fb1' + '1d8f4c17f6ec3bdfe5940afc703856b16e78e4e72e4c9452a8529f337ae7ad27' + '136b48610f92661dcad54698d3e09707b820f55fd6c076d02ef075c726864849') + +prepare() { + # patch files to adhere arch packaging standard + patch -p0 < "${srcdir}"/brother-mfc-7840w.patch +} + +build() { + # generate ppd and wrapper file + "${srcdir}"/usr/local/Brother/cupswrapper/cupswrapperMFC7840W-$pkgver +} + +package() { + mkdir -p "${pkgdir}"/usr/share + cp -r "${srcdir}"/usr/bin "${pkgdir}"/usr + cp -r "${srcdir}"/usr/lib "${pkgdir}"/usr + cp -r "${srcdir}"/usr/local/Brother "${pkgdir}"/usr/share/brother + cp -r "${srcdir}"/var "${pkgdir}"/ + + install -Dm644 ppd_file "${pkgdir}"/usr/share/cups/model/MFC7840W.ppd + install -Dm755 wrapper "${pkgdir}"/usr/lib/cups/filter/brlpdwrapperMFC7840W + + rm "${pkgdir}"/usr/share/brother/cupswrapper/cupswrapperMFC7840W-$pkgver + rm "${pkgdir}"/usr/share/brother/inf/setupPrintcap +} diff --git a/brother-mfc-7840w.install b/brother-mfc-7840w.install new file mode 100644 index 000000000000..ecece459b490 --- /dev/null +++ b/brother-mfc-7840w.install @@ -0,0 +1,37 @@ +# orig name brother-mfc-8870dw.install +post_install() { + __port2=`lpinfo -v | grep -i 'usb://Brother/MFC-7840W' | head -1` + if [ "$__port2" = '' ];then + __port2=`lpinfo -v | grep 'usb://' | head -1` + fi + __port=`echo $__port2| sed s/direct//g` + if [ "$__port" = '' ];then + __port="usb:/dev/usb/lp0" + fi + + lpadmin -p MFC7840W -E -v $__port -P /usr/share/cups/model/MFC7840W.ppd + echo "If CUPS is not running now, start it after installation" + echo "and type command:" + echo " lpadmin -p MFC7840W -E -v URL -P /usr/share/cups/model/MFC7840W.ppd" + echo "where URL can be found using command:" + echo " lpinfo -v | grep -i 'Brother'" + echo "in case of a network printer, take URL:" + echo " socket://ipaddress:9100/" + echo "You can also register the new printer using web interface at:" + echo " http://localhost:631/" +} + +post_upgrade() { + /bin/true +} + +pre_remove() { + lpadmin -x HL2030 +} + + +op=$1 +shift + +$op "$@" + diff --git a/brother-mfc-7840w.patch b/brother-mfc-7840w.patch new file mode 100644 index 000000000000..50d6cee40b41 --- /dev/null +++ b/brother-mfc-7840w.patch @@ -0,0 +1,124 @@ +diff -ur old_usr/local/Brother/cupswrapper/cupswrapperMFC7840W-2.0.2 usr/local/Brother/cupswrapper/cupswrapperMFC7840W-2.0.2 +--- usr/local/Brother/cupswrapper/cupswrapperMFC7840W-2.0.2.orig 2008-01-25 05:29:51.000000000 +0300 ++++ usr/local/Brother/cupswrapper/cupswrapperMFC7840W-2.0.2 2012-01-27 15:05:45.796578436 +0400 +@@ -18,6 +18,7 @@ + # Place, Suite 330, Boston, MA 02111-1307 USA + # + ++if /bin/false; then + if [ "$1" = '-e' ]; then + lpadmin -x MFC7840W + rm -f /usr/share/cups/model/MFC7840W.ppd +@@ -61,8 +62,8 @@ + fi + rm -f /usr/share/cups/model/MFC7840W.ppd + ppd_file_name=/usr/share/cups/model/MFC7840W.ppd +- +-cat <<ENDOFPPDFILE >$ppd_file_name ++fi ++cat <<ENDOFPPDFILE > ppd_file + *PPD-Adobe: "4.3" + *%================================================ + *% Copyright(C) 2006 Brother Industries, Ltd. +@@ -338,13 +339,13 @@ + if [ -e '/usr/share/ppd' ];then + cp $ppd_file_name /usr/share/ppd + fi +- ++if /bin/false; then + brotherlpdwrapper=/usr/lib/cups/filter/brlpdwrapperMFC7840W + brotherlpdwrapper64=/usr/lib64/cups/filter/brlpdwrapperMFC7840W + rm -f $brotherlpdwrapper + +- +-cat <<!ENDOFWFILTER! >$brotherlpdwrapper ++fi ++cat <<!ENDOFWFILTER! > wrapper + #! /bin/sh + # + # Brother Print filter >> $brotherlpdwrapper +@@ -473,25 +474,25 @@ + fi + + +-if [ -e "/usr/local/Brother/lpd/filter\$PRINTER" ]; then ++if [ -e "/usr/share/brother/lpd/filter\$PRINTER" ]; then + : + else +- echo "ERROR: /usr/local/Brother/lpd/filter\$PRINTER does not exist" >>\$LOGFILE ++ echo "ERROR: /usr/share/brother/lpd/filter\$PRINTER does not exist" >>\$LOGFILE + errorcode=30 + exit $errorcode + fi + +-if [ -e "/usr/local/Brother/cupswrapper/brcupsconfig3" ]; then ++if [ -e "/usr/share/brother/cupswrapper/brcupsconfig3" ]; then + if [ \$DEBUG = 0 ]; then +- /usr/local/Brother/cupswrapper/brcupsconfig3 \$PRINTER \$PPD 0 "\$options" >> /dev/null ++ /usr/share/brother/cupswrapper/brcupsconfig3 \$PRINTER \$PPD 0 "\$options" >> /dev/null + else +- /usr/local/Brother/cupswrapper/brcupsconfig3 \$PRINTER \$PPD \$LOGCLEVEL "\$options" >>\$LOGFILE ++ /usr/share/brother/cupswrapper/brcupsconfig3 \$PRINTER \$PPD \$LOGCLEVEL "\$options" >>\$LOGFILE + fi + fi + + + if [ \$DEBUG -le 2 ]; then +- cat \$INPUT_TEMP_PS | /usr/local/Brother/lpd/filter\$PRINTER ++ cat \$INPUT_TEMP_PS | /usr/share/brother/lpd/filter\$PRINTER + fi + + if [ \$DEBUG -ge 2 ]; then +@@ -507,7 +508,7 @@ + + !ENDOFWFILTER! + +- ++if /bin/false; then + chmod 755 $brotherlpdwrapper + if [ -e /usr/lib64/cups/filter ]; then + cp $brotherlpdwrapper $brotherlpdwrapper64 +@@ -538,3 +539,4 @@ + fi + lpadmin -p MFC7840W -E -v $port -P /usr/share/cups/model/MFC7840W.ppd + exit 0 ++fi + +diff -ur old_usr/local/Brother/inf/brMFC7840Wfunc usr/local/Brother/inf/brMFC7840Wfunc +--- old_usr/local/Brother/inf/brMFC7840Wfunc 2007-04-06 01:31:14.000000000 +0200 ++++ usr/local/Brother/inf/brMFC7840Wfunc 2009-04-19 16:10:05.010695023 +0200 +@@ -24,3 +24,6 @@ + Sleep={PrinterDefault,"1-99"} + Toner Save Mode={ON,OFF} + ++[psconvert2] ++pstops=/usr/lib/cups/filter/pstops ++ +diff -ur old_usr/local/Brother/lpd/filterMFC7840W usr/local/Brother/lpd/filterMFC7840W +--- old_usr/local/Brother/lpd/filterMFC7840W 2007-04-06 01:31:14.000000000 +0200 ++++ usr/local/Brother/lpd/filterMFC7840W 2009-04-19 16:19:57.909802658 +0200 +@@ -21,7 +21,7 @@ + PRINTER="MFC7840W" + PRINTER_TMP=$(echo $PRINTER | sed -e 's/ //g' -e 's/-//g') + +-BR_PRT_PATH=/usr/local/Brother ++BR_PRT_PATH=/usr/share/brother + RCFILE=`eval echo $BR_PRT_PATH/inf/brPRINTERrc | eval sed 's/PRINTER/"$PRINTER_TMP"/'` + PAPER_INF=$BR_PRT_PATH/inf/paperinf + PSCONV=$BR_PRT_PATH/lpd/psconvert2 +@@ -109,12 +109,10 @@ + cat $INPUT_TEMP1| $prefilter >$INPUT_TEMP + fi + +-#PSTOPSFILTER=`which pstops` ++PSTOPSFILTER='/usr/lib/cups/filter/pstops' + +-if [ -e '/usr/bin/pstops' ];then +- PSTOPSFILTER='/usr/bin/pstops' +-else +- PSTOPSFILTER='' ++if ! [ -e "$PSTOPSFILTER" ];then ++ PSTOPSFILTER='' + fi + + |