summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngelo Theodorou2015-07-07 22:11:44 +0100
committerAngelo Theodorou2015-07-07 22:11:44 +0100
commit4a86946d3f02089fd829b6310426e63d4ddf53b0 (patch)
treef5bfce0513721202889a9b404afcd253d337539f
downloadaur-brother-dcp350c.tar.gz
Initial import
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD41
-rw-r--r--brother-dcp350c.changelog5
-rw-r--r--brother-dcp350c.install33
-rw-r--r--brother-dcp350c.patch117
5 files changed, 215 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..17272dda6a2d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = brother-dcp350c
+ pkgdesc = Brother DCP-350C CUPS driver
+ pkgver = 1.0.1
+ pkgrel = 2
+ url = http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html
+ install = brother-dcp350c.install
+ changelog = brother-dcp350c.changelog
+ arch = i686
+ license = custom:Brother Industries
+ makedepends = rpmextract
+ source = brother-dcp350c.patch
+ source = http://www.brother.com/pub/bsc/linux/dlf/dcp350clpr-1.0.1-1.i386.rpm
+ source = http://www.brother.com/pub/bsc/linux/dlf/dcp350ccupswrapper-1.0.1-1.i386.rpm
+ md5sums = edba49be34b7a7006f6cf9151ed29365
+ md5sums = 1faa2bc86558bb6150e8affbd265b7dc
+ md5sums = c6118a2d600199b31950bec3f6082643
+
+pkgname = brother-dcp350c
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..a98fe4273d0b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,41 @@
+# Contributor: Angelo Theodorou <encelo@users.sourceforge.net>
+pkgname=brother-dcp350c
+pkgver=1.0.1
+pkgrel=2
+pkgdesc="Brother DCP-350C CUPS driver"
+arch=('i686')
+url="http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html"
+license=('custom:Brother Industries')
+makedepends=('rpmextract')
+changelog=brother-dcp350c.changelog
+install=brother-dcp350c.install
+source=(brother-dcp350c.patch
+ http://www.brother.com/pub/bsc/linux/dlf/dcp350clpr-1.0.1-1.i386.rpm
+ http://www.brother.com/pub/bsc/linux/dlf/dcp350ccupswrapper-1.0.1-1.i386.rpm)
+md5sums=('edba49be34b7a7006f6cf9151ed29365' '1faa2bc86558bb6150e8affbd265b7dc' 'c6118a2d600199b31950bec3f6082643')
+
+build()
+{
+ cd $srcdir
+ for i in *.rpm; do
+ rpmextract.sh "$i" || return 1
+ done
+
+ patch -p0 < ../brother-dcp350c.patch || return 1
+
+ $srcdir/usr/local/Brother/Printer/dcp350c/cupswrapper/cupswrapperdcp350c
+}
+
+package()
+{
+ mkdir -p $pkgdir/usr/share
+ cp -R $srcdir/usr/bin $pkgdir/usr
+ cp -R $srcdir/usr/local/Brother/Printer/dcp350c $pkgdir/usr/share/brother
+
+ rm $pkgdir/usr/share/brother/cupswrapper/cupswrapperdcp350c
+ rm $pkgdir/usr/share/brother/inf/setupPrintcapij
+
+ install -m 644 -D ppd_file $pkgdir/usr/share/cups/model/brdcp350c.ppd
+ install -m 755 -D wrapper $pkgdir/usr/lib/cups/filter/brlpdwrapperdcp350c
+}
+
diff --git a/brother-dcp350c.changelog b/brother-dcp350c.changelog
new file mode 100644
index 000000000000..fce5882432a2
--- /dev/null
+++ b/brother-dcp350c.changelog
@@ -0,0 +1,5 @@
+2014-01-06 Angelo "Encelo" Theodorou <encelo@users.sourceforge.net>
+
+ * PKGBUILD:i
+ Source and homesite URLs updated
+ Added a package() function
diff --git a/brother-dcp350c.install b/brother-dcp350c.install
new file mode 100644
index 000000000000..8cce165af798
--- /dev/null
+++ b/brother-dcp350c.install
@@ -0,0 +1,33 @@
+post_install() {
+ __port2=`lpinfo -v | grep -i 'usb://Brother/DCP-350C' | 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 DCP350C -E -v $__port -P /usr/share/cups/model/brdcp350c.ppd
+ echo "If CUPS is not running now, start it after installation"
+ echo "and type command:"
+ echo " lpadmin -p DCP350C -E -v URL -P /usr/share/cups/model/brdcp350c.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 DCP350C
+}
+
+
+op=$1
+shift
+
+$op "$@"
diff --git a/brother-dcp350c.patch b/brother-dcp350c.patch
new file mode 100644
index 000000000000..222d3fcc7f94
--- /dev/null
+++ b/brother-dcp350c.patch
@@ -0,0 +1,117 @@
+diff -ruN old_usr/local/Brother/Printer/dcp350c/cupswrapper/cupswrapperdcp350c usr/local/Brother/Printer/dcp350c/cupswrapper/cupswrapperdcp350c
+--- old_usr/local/Brother/Printer/dcp350c/cupswrapper/cupswrapperdcp350c 2008-01-24 04:04:00.000000000 +0200
++++ usr/local/Brother/Printer/dcp350c/cupswrapper/cupswrapperdcp350c 2008-12-25 01:53:06.000000000 +0200
+@@ -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
+@@ -65,8 +66,8 @@
+ fi
+ 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"
+
+ *%================================================
+@@ -256,7 +257,7 @@
+ ENDOFPPDFILE1
+
+ if [ $printer_model = "mfc5860cn" ]; then
+- cat <<ENDOFPPDFILE_2 >>$ppd_file_name
++ cat <<ENDOFPPDFILE_2 >>ppd_file
+ *%=== Media Type ================================
+ *OpenUI *BRInputSlot/Paper Feed: PickOne
+ *OrderDependency: 13 AnySetup *BRInputSlot
+@@ -270,7 +271,7 @@
+ fi
+
+
+-cat <<ENDOFPPDFILE_END >>$ppd_file_name
++cat <<ENDOFPPDFILE_END >>ppd_file
+ *%=== Media Type ================================
+ *OpenUI *BRColorMediaType/Media Type: PickOne
+ *OrderDependency: 16 AnySetup *BRColorMediaType
+@@ -669,6 +670,7 @@
+
+ ENDOFPPDFILE_END
+
++if /bin/false; then
+ chmod 644 $ppd_file_name
+
+ if [ -d /usr/share/ppd ]
+@@ -690,8 +692,8 @@
+ rm -f $brotherlpdwrapper
+ #echo 'rm -f /usr/lib/cups/filter/brlpdwrapper${printer_model}'
+
+-
+-cat <<!ENDOFWFILTER! >$brotherlpdwrapper
++fi
++cat <<!ENDOFWFILTER! >wrapper
+ #! /bin/sh
+ #
+ # Copyright (C) 2005 Brother. Industries, Ltd.
+@@ -798,25 +800,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/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/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/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/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/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/lpd/filter${printer_model} "\$\$" "CUPS" "USB"
+
+ if [ \$LOGLEVEL -gt 2 ]; then
+ if [ \$LOGFILE != "/dev/null" ]; then
+@@ -832,6 +834,7 @@
+
+ !ENDOFWFILTER!
+
++if /bin/false; then
+ chmod 755 $brotherlpdwrapper
+ #if [ -e /usr/lib64/cups/backend ]; then
+ # cp $brotherlpdwrapper $brotherlpdwrapper64
+@@ -872,4 +875,4 @@
+ lpadmin -p ${printer_name} -E -v $port -m br${printer_model}.ppd
+
+ exit 0
+-
++fi
+diff -ruN old_usr/local/Brother/Printer/dcp350c/lpd/filterdcp350c usr/local/Brother/Printer/dcp350c/lpd/filterdcp350c
+--- old_usr/local/Brother/Printer/dcp350c/lpd/filterdcp350c 2008-01-03 09:45:22.000000000 +0200
++++ usr/local/Brother/Printer/dcp350c/lpd/filterdcp350c 2008-12-25 01:48:13.000000000 +0200
+@@ -21,7 +21,7 @@
+ PRINTER="dcp350c"
+ 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/
+ 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