summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEldon Mathias2016-02-24 22:26:03 -0600
committerEldon Mathias2016-02-24 22:26:03 -0600
commit8c0cedb458d1bf12043eeee2f477c5bf5df9036a (patch)
tree3cb5fe1a3fecb7b943c936a668797df83b5a8d9c
downloadaur-8c0cedb458d1bf12043eeee2f477c5bf5df9036a.tar.gz
initial import
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD40
-rw-r--r--brother-mfc240c.install35
-rw-r--r--brother-mfc240c.patch136
4 files changed, 232 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..0cf7a933ec0
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+# Generated by makepkg 5.0.0
+# Thu Feb 25 04:25:11 UTC 2016
+pkgbase = brother-mfc240c
+ pkgdesc = Brother MFC-240C CUPS driver
+ pkgver = 1.0.1
+ pkgrel = 1
+ url = http://www.brother.com
+ install = brother-mfc240c.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ depends = lib32-glibc
+ source = brother-mfc240c.patch
+ source = http://www.brother.com/pub/bsc/linux/dlf/mfc240ccupswrapper-1.0.1-1.i386.rpm
+ source = http://www.brother.com/pub/bsc/linux/dlf/mfc240clpr-1.0.1-1.i386.rpm
+ md5sums = 2856ad6fbe41b6ce01b1c0af3c7f94ef
+ md5sums = 207cf1eb6bbab8d2ecafd8a2b5bc8f4b
+ md5sums = e2564327cb7fc6501ca9657080855322
+
+pkgname = brother-mfc240c
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..1aa61745161
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,40 @@
+# Maintainer: Eldon Mathias <eldon@emathias.com>
+pkgname="brother-mfc240c"
+pkgver="1.0.1"
+pkgrel="1"
+pkgdesc="Brother MFC-240C CUPS driver"
+url="http://www.brother.com"
+license=('GPL')
+install="brother-mfc240c.install"
+arch=('i686' 'x86_64')
+depends_x86_64=('lib32-glibc')
+md5sums=('2856ad6fbe41b6ce01b1c0af3c7f94ef'
+ '207cf1eb6bbab8d2ecafd8a2b5bc8f4b'
+ 'e2564327cb7fc6501ca9657080855322')
+
+source=(
+ brother-mfc240c.patch \
+ http://www.brother.com/pub/bsc/linux/dlf/mfc240ccupswrapper-1.0.1-1.i386.rpm
+ http://www.brother.com/pub/bsc/linux/dlf/mfc240clpr-1.0.1-1.i386.rpm
+)
+
+prepare() {
+ cd "$srcdir/usr/" || return 1
+ patch -p1 < ../brother-mfc240c.patch
+
+ cd "$srcdir" || return 1
+ "$srcdir/usr/local/Brother/Printer/mfc240c/cupswrapper/cupswrappermfc240c"
+}
+
+package() {
+ mkdir -p "$pkgdir/usr/share"
+ cp -R "$srcdir/usr/bin" "$pkgdir/usr"
+ cp -R "$srcdir/usr/local/Brother" "$pkgdir/usr/share/brother"
+
+ rm "$pkgdir/usr/share/brother/Printer/mfc240c/cupswrapper/cupswrappermfc240c"
+ rm "$pkgdir/usr/share/brother/Printer/mfc240c/inf/setupPrintcapij"
+
+ install -m 644 -D ppd_file "$pkgdir/usr/share/cups/model/MFC240C.ppd"
+ install -m 755 -D wrapper "$pkgdir/usr/lib/cups/filter/brlpdwrappermfc240c"
+}
+
diff --git a/brother-mfc240c.install b/brother-mfc240c.install
new file mode 100644
index 00000000000..f0af866b5df
--- /dev/null
+++ b/brother-mfc240c.install
@@ -0,0 +1,35 @@
+post_install() {
+ __port2=`lpinfo -v | grep -i 'usb://Brother/MFC-240C' | 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 MFC240C -E -v $__port -P /usr/share/cups/model/MFC240C.ppd
+ echo "If CUPS is not running now, start it after installation"
+ echo "and type command:"
+ echo " lpadmin -p MFC240C -E -v URL -P /usr/share/cups/model/MFC240C.ppd"
+ echo "where URL can be found using command:"
+ echo " lpinfo -v | grep -i 'Brother'"
+ echo "You can also register new printer using web interface at:"
+ echo " http://localhost:631/"
+}
+
+post_upgrade() {
+ /bin/true
+}
+
+pre_remove() {
+ lpadmin -x MFC240C
+}
+
+
+op=$1
+shift
+
+$op "$@"
+
+
diff --git a/brother-mfc240c.patch b/brother-mfc240c.patch
new file mode 100644
index 00000000000..61d4e9bd41d
--- /dev/null
+++ b/brother-mfc240c.patch
@@ -0,0 +1,136 @@
+--- old_usr/local/Brother/Printer/mfc240c/cupswrapper/cupswrappermfc240c 2016-02-24 21:02:31.352003704 -0600
++++ usr/local/Brother/Printer/mfc240c/cupswrapper/cupswrappermfc240c 2016-02-24 21:23:16.875313191 -0600
+@@ -23,6 +23,7 @@
+ device_name=`echo $printer_name | eval sed -e 's/MFC/MFC-/' -e 's/DCP/DCP-/' -e 's/FAX/FAX-/'`
+ pcfilename=`echo $printer_name | tr -d '[A-Z]'`
+ device_model="Printer"
++if /bin/false; then
+ if [ "$1" = '-e' ]; then
+ lpadmin -x ${printer_name}
+ rm -f /usr/share/cups/model/br${printer_model}.ppd
+@@ -66,7 +67,8 @@
+ rm -f /usr/share/cups/model/br${printer_model}.ppd
+ ppd_file_name=/usr/share/cups/model/br${printer_model}.ppd
+
+-cat <<ENDOFPPDFILE1 >$ppd_file_name
++fi
++cat <<ENDOFPPDFILE1 > ppd_file
+ *PPD-Adobe: "4.3"
+
+ *%================================================
+@@ -253,24 +255,6 @@
+ *BRSlowDrying ON/ON: ""
+ *CloseUI: *BRSlowDrying
+
+-ENDOFPPDFILE1
+-
+-if [ $printer_model = "mfc5860cn" ]; then
+- cat <<ENDOFPPDFILE_2 >>$ppd_file_name
+-*%=== Media Type ================================
+-*OpenUI *BRInputSlot/Paper Feed: PickOne
+-*OrderDependency: 13 AnySetup *BRInputSlot
+-*DefaultBRInputSlot: AUTO
+-*BRInputSlot AUTO/Auto Select: " "
+-*BRInputSlot Tray1/Tray 1: " "
+-*BRInputSlot Tray2/Tray 2: " "
+-*CloseUI: *BRInputSlot
+-
+-ENDOFPPDFILE_2
+-fi
+-
+-
+-cat <<ENDOFPPDFILE_END >>$ppd_file_name
+ *%=== Media Type ================================
+ *OpenUI *BRColorMediaType/Media Type: PickOne
+ *OrderDependency: 16 AnySetup *BRColorMediaType
+@@ -665,10 +649,9 @@
+ *UIConstraints: *BRColorMediaType Transparencies *Resolution Photo
+ *UIConstraints: *BRColorMediaType Transparencies *Resolution Highest
+
+-
+-
+-ENDOFPPDFILE_END
++ENDOFPPDFILE1
+
++if /bin/false; then
+ chmod 644 $ppd_file_name
+
+ if [ -d /usr/share/ppd ]
+@@ -690,8 +673,10 @@
+ rm -f $brotherlpdwrapper
+ #echo 'rm -f /usr/lib/cups/filter/brlpdwrapper${printer_model}'
+
++fi
++
++cat <<!ENDOFWFILTER! > wrapper
+
+-cat <<!ENDOFWFILTER! >$brotherlpdwrapper
+ #! /bin/sh
+ #
+ # Copyright (C) 2005 Brother. Industries, Ltd.
+@@ -798,25 +783,25 @@
+ cat > \$INPUT_TEMP_PS
+ fi
+ fi
+-if [ -e "/usr/local/Brother/${device_model}/${printer_model}/lpd/filter${printer_model}" ]; then
++if [ -e "/usr/share/brother/${device_model}/${printer_model}/lpd/filter${printer_model}" ]; then
+ :
+ else
+- echo "ERROR: /usr/local/Brother/${device_model}/${printer_model}/lpd/filter${printer_model} does not exist" >>\$LOGFILE
++ echo "ERROR: /usr/share/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/BrChain/Chain/' -e 's/BrBrightness/Brightness/' -e 's/BrContrast/Contrast/' -e 's/BrHalfCut/HalfCut/' -e 's/BrAutoTapeCut/AutoCut/' -e 's/BrMirror/Mirror/' -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 "/usr/local/Brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1" ]; then
++if [ -e "/usr/share/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1" ]; then
+ if [ \$DEBUG = 0 ]; then
+- /usr/local/Brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1 ${printer_name} \$PPDC 0 "\$CUPSOPTION" "${printer_model}">> /dev/null
++ /usr/share/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1 ${printer_name} \$PPDC 0 "\$CUPSOPTION" "${printer_model}">> /dev/null
+ else
+- /usr/local/Brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1 ${printer_name} \$PPDC \$LOGCLEVEL "\$CUPSOPTION" "${printer_model}">>\$LOGFILE
++ /usr/share/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 | /usr/local/Brother/${device_model}/${printer_model}/lpd/filter${printer_model} "\$\$" "CUPS" "USB"
++ cat \$INPUT_TEMP_PS | /usr/share/brother/${device_model}/${printer_model}/lpd/filter${printer_model} "\$\$" "CUPS" "USB"
+
+ if [ \$LOGLEVEL -gt 2 ]; then
+ if [ \$LOGFILE != "/dev/null" ]; then
+@@ -832,6 +817,7 @@
+
+ !ENDOFWFILTER!
+
++if /bin/false; then
+ chmod 755 $brotherlpdwrapper
+ #if [ -e /usr/lib64/cups/backend ]; then
+ # cp $brotherlpdwrapper $brotherlpdwrapper64
+@@ -872,4 +858,4 @@
+ lpadmin -p ${printer_name} -E -v $port -m br${printer_model}.ppd
+
+ exit 0
+-
++fi
+--- old_usr/local/Brother/Printer/mfc240c/inf/brmfc240cfunc 2016-02-24 21:02:31.348670372 -0600
++++ usr/local/Brother/Printer/mfc240c/inf/brmfc240cfunc 2016-02-24 20:49:04.062019161 -0600
+@@ -46,3 +46,6 @@
+
+ [Constraint]
+
++[psconvert2]
++pstops=/usr/lib/cups/filter/pstops
++
+--- old_usr/local/Brother/Printer/mfc240c/lpd/filtermfc240c 2016-02-24 21:02:31.348670372 -0600
++++ usr/local/Brother/Printer/mfc240c/lpd/filtermfc240c 2016-02-24 20:52:02.742015740 -0600
+@@ -21,7 +21,7 @@
+ PRINTER="mfc240c"
+ PRINTER_TMP=$(echo $PRINTER | sed -e 's/ //g' -e 's/-//g')
+
+-BR_PRT_PATH=/usr/local/Brother/Printer/${PRINTER}
++BR_PRT_PATH=/usr/share/brother/Printer/${PRINTER}
+ RCFILE=`eval echo $BR_PRT_PATH/inf/brPRINTERrc | eval sed 's/PRINTER/"$PRINTER_TMP"/'`
+ PAPER_INF=$BR_PRT_PATH/inf/paperinfij2
+ PSCONV=$BR_PRT_PATH/lpd/psconvertij2