summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD42
-rw-r--r--brother-hl2030.install34
-rw-r--r--brother-hl2030.patch123
4 files changed, 218 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..694446eeedc3
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = brother-hl2030
+ pkgdesc = Brother HL-2030 CUPS driver
+ pkgver = 2.0.1
+ pkgrel = 6
+ url = http://www.brother.com
+ install = brother-hl2030.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ source = brother-hl2030.patch
+ source = http://download.brother.com/welcome/dlf005837/cupswrapperHL2030-2.0.1-1.i386.rpm
+ source = http://download.brother.com/welcome/dlf005835/brhl2030lpr-2.0.1-1.i386.rpm
+ md5sums = e81a2b369368fb8fa56a08c3341097b2
+ md5sums = 29e4d9dfd44ee8fc1629b9cfdadfb896
+ md5sums = 29d20e3925e29779260dbbcd0d1fc29e
+ depends_x86_64 = lib32-glibc
+
+pkgname = brother-hl2030
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c2f8d0766edb
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Aerion (emile [at] aerion [dot] co [dot] uk
+# Contributor: Jaroslaw Rosiek <jaroslaw.rosiek@interia.pl>
+
+pkgname="brother-hl2030"
+pkgver="2.0.1"
+pkgrel="6"
+pkgdesc="Brother HL-2030 CUPS driver"
+url="http://www.brother.com"
+license=('GPL')
+install="brother-hl2030.install"
+arch=('i686' 'x86_64')
+depends_x86_64=('lib32-glibc')
+md5sums=('e81a2b369368fb8fa56a08c3341097b2'
+ '29e4d9dfd44ee8fc1629b9cfdadfb896'
+ '29d20e3925e29779260dbbcd0d1fc29e')
+
+source=(
+ brother-hl2030.patch \
+ http://download.brother.com/welcome/dlf005837/cupswrapperHL2030-2.0.1-1.i386.rpm
+ http://download.brother.com/welcome/dlf005835/brhl2030lpr-2.0.1-1.i386.rpm
+)
+
+prepare() {
+ cd "$srcdir/usr/" || return 1
+ patch -p1 < ../brother-hl2030.patch
+
+ cd "$srcdir" || return 1
+ "$srcdir/usr/local/Brother/cupswrapper/cupswrapperHL2030-2.0.1"
+}
+
+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/cupswrapperHL2030-2.0.1"
+ rm "$pkgdir/usr/share/brother/inf/setupPrintcap"
+
+ install -m 644 -D ppd_file "$pkgdir/usr/share/cups/model/HL2030.ppd"
+ install -m 755 -D wrapper "$pkgdir/usr/lib/cups/filter/brlpdwrapperHL2030"
+}
diff --git a/brother-hl2030.install b/brother-hl2030.install
new file mode 100644
index 000000000000..7888a1928fb3
--- /dev/null
+++ b/brother-hl2030.install
@@ -0,0 +1,34 @@
+post_install() {
+ __port2=`lpinfo -v | grep -i 'usb://Brother/HL-2030' | 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 HL2030 -E -v $__port -P /usr/share/cups/model/HL2030.ppd
+ echo "If CUPS is not running now, start it after installation"
+ echo "and type command:"
+ echo " lpadmin -p HL2030 -E -v URL -P /usr/share/cups/model/HL2030.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 HL2030
+}
+
+
+op=$1
+shift
+
+$op "$@"
+
diff --git a/brother-hl2030.patch b/brother-hl2030.patch
new file mode 100644
index 000000000000..6e28f05e6358
--- /dev/null
+++ b/brother-hl2030.patch
@@ -0,0 +1,123 @@
+diff -ur old_usr/local/Brother/cupswrapper/cupswrapperHL2030-2.0.1 usr/local/Brother/cupswrapper/cupswrapperHL2030-2.0.1
+--- old_usr/local/Brother/cupswrapper/cupswrapperHL2030-2.0.1 2007-12-06 00:36:39.000000000 +0100
++++ usr/local/Brother/cupswrapper/cupswrapperHL2030-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 HL2030
+ rm -f /usr/share/cups/model/HL2030.ppd
+@@ -60,7 +60,8 @@
+ rm -f /usr/share/cups/model/HL2030.ppd
+ ppd_file_name=/usr/share/cups/model/HL2030.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/brlpdwrapperHL2030
+ brotherlpdwrapper64=/usr/lib64/cups/filter/brlpdwrapperHL2030
+ 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 HL2030 -E -v $port -P /usr/share/cups/model/HL2030.ppd
+ exit 0
++fi
+diff -ur old_usr/local/Brother/inf/brHL2030func usr/local/Brother/inf/brHL2030func
+--- old_usr/local/Brother/inf/brHL2030func 2007-12-06 00:36:39.000000000 +0100
++++ usr/local/Brother/inf/brHL2030func 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/filterHL2030 usr/local/Brother/lpd/filterHL2030
+--- old_usr/local/Brother/lpd/filterHL2030 2007-12-06 00:36:39.000000000 +0100
++++ usr/local/Brother/lpd/filterHL2030 2007-12-06 00:36:50.000000000 +0100
+@@ -21,7 +21,7 @@
+ PRINTER="HL2030"
+ 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
+