summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastiaan Lokhorst2015-09-11 11:53:58 +0200
committerSebastiaan Lokhorst2015-09-11 11:53:58 +0200
commit4a5b82140adc65f7b82b7c95a5f3141b4b3d01cf (patch)
tree8a967221043067de0d98e0e43961f6be6ba994d3
downloadaur-4a5b82140adc65f7b82b7c95a5f3141b4b3d01cf.tar.gz
Initial import
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD43
-rw-r--r--brother-hl2040.install34
-rw-r--r--brother-hl2040.patch123
4 files changed, 221 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..82005352ee32
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = brother-hl2040
+ pkgdesc = Brother HL-2040 CUPS driver
+ pkgver = 2.0.1
+ pkgrel = 1
+ url = http://www.brother.com
+ install = brother-hl2040.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ source = brother-hl2040.patch
+ source = brother-hl2040.install
+ source = http://download.brother.com/welcome/dlf005842/cupswrapperHL2040-2.0.1-1.i386.rpm
+ source = http://download.brother.com/welcome/dlf005840/brhl2040lpr-2.0.1-1.i386.rpm
+ md5sums = c162975d1764145bf3a73befdb4f5df3
+ md5sums = 5400480b3988184f2a675a8a29e82baf
+ md5sums = 82f57a91f1d4f2d51d37758a0c6a2673
+ md5sums = 72930935ddb2ed7ba49fe1f5b4479e16
+ depends_x86_64 = lib32-glibc
+
+pkgname = brother-hl2040
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..6daf68fb2703
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer: Sebastiaan Lokhorst <sebastiaanlokhorst@gmail.com>
+# Contributor: Aerion (emile [at] aerion [dot] co [dot] uk
+# Contributor: Jaroslaw Rosiek <jaroslaw.rosiek@interia.pl>
+
+pkgname=brother-hl2040
+pkgver=2.0.1
+pkgrel=1
+pkgdesc="Brother HL-2040 CUPS driver"
+url="http://www.brother.com"
+license=('GPL')
+install="brother-hl2040.install"
+arch=('i686' 'x86_64')
+depends_x86_64=('lib32-glibc')
+
+source=(brother-hl2040.patch
+ brother-hl2040.install
+ http://download.brother.com/welcome/dlf005842/cupswrapperHL2040-$pkgver-1.i386.rpm
+ http://download.brother.com/welcome/dlf005840/brhl2040lpr-$pkgver-1.i386.rpm)
+md5sums=('c162975d1764145bf3a73befdb4f5df3'
+ '5400480b3988184f2a675a8a29e82baf'
+ '82f57a91f1d4f2d51d37758a0c6a2673'
+ '72930935ddb2ed7ba49fe1f5b4479e16')
+
+prepare() {
+ cd "$srcdir/usr/" || return 1
+ patch -p1 < ../brother-hl2040.patch
+
+ cd "$srcdir" || return 1
+ "$srcdir/usr/local/Brother/cupswrapper/cupswrapperHL2040-$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"
+
+ rm "$pkgdir/usr/share/brother/cupswrapper/cupswrapperHL2040-$pkgver"
+ rm "$pkgdir/usr/share/brother/inf/setupPrintcap"
+
+ install -m 644 -D ppd_file "$pkgdir/usr/share/cups/model/HL2040.ppd"
+ install -m 755 -D wrapper "$pkgdir/usr/lib/cups/filter/brlpdwrapperHL2040"
+}
diff --git a/brother-hl2040.install b/brother-hl2040.install
new file mode 100644
index 000000000000..c26ab911fd78
--- /dev/null
+++ b/brother-hl2040.install
@@ -0,0 +1,34 @@
+post_install() {
+ __port2=`lpinfo -v | grep -i 'usb://Brother/HL-2040' | 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 HL2040 -E -v $__port -P /usr/share/cups/model/HL2040.ppd
+ echo "If CUPS is not running now, start it after installation"
+ echo "and type command:"
+ echo " lpadmin -p HL2040 -E -v URL -P /usr/share/cups/model/HL2040.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 HL2040
+}
+
+
+op=$1
+shift
+
+$op "$@"
+
diff --git a/brother-hl2040.patch b/brother-hl2040.patch
new file mode 100644
index 000000000000..6572595db40a
--- /dev/null
+++ b/brother-hl2040.patch
@@ -0,0 +1,123 @@
+diff -ur old_usr/local/Brother/cupswrapper/cupswrapperHL2040-2.0.1 usr/local/Brother/cupswrapper/cupswrapperHL2040-2.0.1
+--- old_usr/local/Brother/cupswrapper/cupswrapperHL2040-2.0.1 2007-12-06 00:36:39.000000000 +0100
++++ usr/local/Brother/cupswrapper/cupswrapperHL2040-2.0.1 2007-12-06 00:36:54.000000000 +0100
+@@ -17,7 +17,7 @@
+ # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ # Place, Suite 330, Boston, MA 02111-1307 USA
+ #
+-
++if /bin/false; then
+ if [ "$1" = '-e' ]; then
+ lpadmin -x HL2040
+ rm -f /usr/share/cups/model/HL2040.ppd
+@@ -60,7 +60,8 @@
+ rm -f /usr/share/cups/model/HL2040.ppd
+ ppd_file_name=/usr/share/cups/model/HL2040.ppd
+
+-cat <<ENDOFPPDFILE >$ppd_file_name
++fi
++cat <<ENDOFPPDFILE > ppd_file
+ *PPD-Adobe: "4.3"
+ *%================================================
+ *% Copyright(C) 2006 Brother Industries, Ltd.
+@@ -333,15 +334,16 @@
+ ENDOFPPDFILE
+
+
++if /bin/false; then
+ brotherlpdwrapper=/usr/lib/cups/filter/brlpdwrapperHL2040
+ brotherlpdwrapper64=/usr/lib64/cups/filter/brlpdwrapperHL2040
+ rm -f $brotherlpdwrapper
+
+-
+-cat <<!ENDOFWFILTER! >$brotherlpdwrapper
++fi
++cat <<!ENDOFWFILTER! > wrapper
+ #! /bin/sh
+ #
+-# Brother Print filter >> $brotherlpdwrapper
++# Brother Print filter
+ # Copyright (C) 2005 Brother. Industries, Ltd.
+ # Ver1.00
+
+@@ -467,25 +469,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
+@@ -501,7 +503,7 @@
+
+ !ENDOFWFILTER!
+
+-
++if /bin/false; then
+ chmod a+x $brotherlpdwrapper
+ if [ -e /usr/lib64/cups/filter ]; then
+ cp $brotherlpdwrapper $brotherlpdwrapper64
+@@ -532,3 +534,4 @@
+ fi
+ lpadmin -p HL2040 -E -v $port -P /usr/share/cups/model/HL2040.ppd
+ exit 0
++fi
+diff -ur old_usr/local/Brother/inf/brHL2040func usr/local/Brother/inf/brHL2040func
+--- old_usr/local/Brother/inf/brHL2040func 2007-12-06 00:36:39.000000000 +0100
++++ usr/local/Brother/inf/brHL2040func 2007-12-06 00:36:58.000000000 +0100
+@@ -24,3 +24,5 @@
+ Sleep={PrinterDefault,"1-99"}
+ Toner Save Mode={ON,OFF}
+
++[psconvert2]
++pstops=/usr/lib/cups/filter/pstops
+diff -ur old_usr/local/Brother/lpd/filterHL2040 usr/local/Brother/lpd/filterHL2040
+--- old_usr/local/Brother/lpd/filterHL2040 2007-12-06 00:36:39.000000000 +0100
++++ usr/local/Brother/lpd/filterHL2040 2007-12-06 00:36:50.000000000 +0100
+@@ -21,7 +21,7 @@
+ PRINTER="HL2040"
+ 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,11 +109,9 @@
+ 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
++if ! [ -e "$PSTOPSFILTER" ];then
+ PSTOPSFILTER=''
+ fi
+