summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO24
-rw-r--r--0001-brother-hl4150cdn.patch196
-rw-r--r--Brother.license47
-rw-r--r--PKGBUILD60
-rw-r--r--brother-hl4150cdn.install50
5 files changed, 377 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..3cadef96ec39
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = brother-hl4150cdn
+ pkgdesc = Brother HL-4150CDN CUPS printer driver
+ pkgver = 1.1.1
+ pkgrel = 5
+ url = http://support.brother.com/g/b/downloadlist.aspx?c=de&lang=de&prod=hl4150cdn_all&os=127&flang=English
+ install = brother-hl4150cdn.install
+ arch = i686
+ arch = x86_64
+ license = custom:Brother
+ license = GPL
+ makedepends = libarchive
+ depends = a2ps
+ depends = cups
+ source = 0001-brother-hl4150cdn.patch
+ source = Brother.license
+ source = http://download.brother.com/welcome/dlf005939/hl4150cdnlpr-1.1.1-5.i386.rpm
+ source = http://download.brother.com/welcome/dlf005941/hl4150cdncupswrapper-1.1.1-5.i386.rpm
+ md5sums = 7c21a135c11c7ac3e868e263a6807163
+ md5sums = 58796468c65d77c835e5959970b91f36
+ md5sums = 433c0a17c9d4ada74892072cc71bf042
+ md5sums = 8f21d5054fb80bb148174a7a597b8fd0
+
+pkgname = brother-hl4150cdn
+
diff --git a/0001-brother-hl4150cdn.patch b/0001-brother-hl4150cdn.patch
new file mode 100644
index 000000000000..1a2f4bfe8af9
--- /dev/null
+++ b/0001-brother-hl4150cdn.patch
@@ -0,0 +1,196 @@
+--- src/usr/local/Brother/Printer/hl4150cdn/cupswrapper/cupswrapperhl4150cdn 2010-08-04 22:36:49.000000000 -0500
++++ new/usr/local/Brother/Printer/hl4150cdn/cupswrapper/cupswrapperhl4150cdn 2011-09-29 08:37:00.000000000 -0500
+@@ -17,75 +17,45 @@
+ # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ # Place, Suite 330, Boston, MA 02111-1307 USA
+ #
++if [ -z "$DRIVER_PREFIX" ]; then
++ DRIVER_PREFIX=/usr/local/Brother
++fi
+
+ printer_model=""hl4150cdn""
+ printer_name=`echo $printer_model | tr '[a-z]' '[A-Z]'`
+ 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"
+-tmp_filter=/var/tmp/brlpdwrapper${printer_model}
+-if [ "$1" = '-e' ]; then
+- lpadmin -x ${printer_name}
+- rm -f /usr/share/cups/model/br${printer_model}.ppd
+- rm -f /usr/share/ppd/br${printer_model}.ppd
+- rm -f /usr/lib/cups/filter/brlpdwrapper${printer_model}
+- rm -f /usr/lib64/cups/filter/brlpdwrapper${printer_model}
+- rm -f /usr/local/Brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1
+-if [ -e /etc/init.d/cups ]; then
+- /etc/init.d/cups restart
+-elif [ -e /etc/init.d/cupsys ]; then
+- /etc/init.d/cupsys restart
+-fi
+-# /etc/init.d/cups restart
+- exit 0
+-fi
+-if [ "$1" = "-r" ]; then
+- lpadmin -x ${printer_name}
+-if [ -e /etc/init.d/cups ]; then
+- /etc/init.d/cups restart
+-elif [ -e /etc/init.d/cupsys ]; then
+- /etc/init.d/cupsys restart
+-fi
+-# /etc/init.d/cups restart
+- exit 0
+-fi
++tmp_filter=$PKGDIR/brlpdwrapper${printer_model}
++ppd_file_name=$DESTDIR/usr/share/cups/model/$printer_model.ppd
++brotherlpdwrapper=$DESTDIR/usr/lib/cups/filter/brlpdwrapper$printer_model
++brotherlpdwrapper64=$DESTDIR/usr/lib64/cups/filter/brlpdwrapper$printer_model
++
+ if [ "$1" = "help" ] || [ "$1" = "-h" ]; then
+ echo 'option -h : help'
+ echo ' -i : install'
+ echo ' -e : uninstall'
+ echo ' -r : remove printer'
++ echo ' -s : simple install (Do not touch services)'
+ exit 0
+ fi
+ #mkdir -p /usr/local/Brother/${device_model}/${printer_model}/filter
+ #mkdir -p /usr/lib/cups/filter
++mkdir -p $DESTDIR/usr/lib/cups/filter
++mkdir -p $DESTDIR/usr/share/cups/model
+
+-if [ -e "/usr/local/Brother/${device_model}/${printer_model}/lpd/filter${printer_model}" ]; then
++if [ -e "$SRCDIR/usr/local/Brother/${device_model}/${printer_model}/lpd/filter${printer_model}" ]; then
+ :
+ else
+ echo "ERROR : Brother LPD filter is not installed."
+ fi
+-rm -f /usr/share/cups/model/br${printer_model}.ppd
+-if [ -d "/usr/share/cups/model" ]; then
+- ppd_file_name=/usr/share/cups/model/br${printer_model}.ppd
+-else
+- ppd_file_name=/usr/share/ppd/br${printer_model}.ppd
+-fi
+
+-if [ -e "/usr/local/Brother/${device_model}/${printer_model}/cupswrapper/${printer_model}.ppd" ]; then
+-cp "/usr/local/Brother/${device_model}/${printer_model}/cupswrapper/${printer_model}.ppd" $ppd_file_name
++if [ -e "$SRCDIR/usr/local/Brother/${device_model}/${printer_model}/cupswrapper/${printer_model}.ppd" ]; then
++cp "$SRCDIR/usr/local/Brother/${device_model}/${printer_model}/cupswrapper/${printer_model}.ppd" $ppd_file_name
+ fi
+
+ chmod 644 $ppd_file_name
+
+-if [ -d /usr/share/ppd ]
+-then
+-if [ -d /usr/share/cups/model ]
+-then
+- cp $ppd_file_name /usr/share/ppd/br${printer_model}.ppd
+- chmod 644 /usr/share/ppd/br${printer_model}.ppd
+-fi
+-fi
+-
+ #
+ # create temporary CUPS Filter
+ #
+@@ -198,25 +168,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/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
+@@ -235,30 +205,27 @@
+ chmod 755 $tmp_filter
+
+ #
+-# check /usr/lib/cups/filter
+-#
+-if [ -d /usr/lib/cups/filter ]; then
+- brotherlpdwrapper=/usr/lib/cups/filter/brlpdwrapper${printer_model}
+- rm -f $brotherlpdwrapper
+- cp $tmp_filter $brotherlpdwrapper
+-fi
+-
+-#
+ # check /usr/lib64/cups/filter
+ #
+-if [ -e /usr/lib64/cups/filter ]; then
+- brotherlpdwrapper64=/usr/lib64/cups/filter/brlpdwrapper${printer_model}
++if [ -e $DESTDIR/usr/lib64/cups/filter ]; then
++ brotherlpdwrapper64=$DESTDIR/usr/lib64/cups/filter/brlpdwrapper${printer_model}
+ rm -f $brotherlpdwrapper64
+ cp $tmp_filter $brotherlpdwrapper64
+ fi
+
++if [ -d $DESTDIR/usr/lib/cups/filter ]; then
++ brotherlpdwrapper=$DESTDIR/usr/lib/cups/filter/brlpdwrapper${printer_model}
++ rm -f $brotherlpdwrapper
++ cp $tmp_filter $brotherlpdwrapper
++fi
++
+ #
+ # remove temporary script file
+ #
+ rm -f $tmp_filter
+
+-chmod a+w /usr/local/Brother/${device_model}/${printer_model}/inf/br${printer_model}rc
+-chmod a+w /usr/local/Brother/${device_model}/${printer_model}/inf
++chmod a+w $DESTDIR/usr/share/Brother/${device_model}/${printer_model}/inf/br${printer_model}rc
++chmod a+w $DESTDIR/usr/share/Brother/${device_model}/${printer_model}/inf
+ if [ -e /etc/init.d/lpd ]; then
+ /etc/init.d/lpd stop
+ fi
+@@ -266,7 +233,6 @@
+ /etc/init.d/lprng stop
+ fi
+
+-
+ if [ -e /etc/init.d/cups ]; then
+ /etc/init.d/cups restart
+ elif [ -e /etc/init.d/cupsys ]; then
+@@ -275,22 +241,5 @@
+
+ sleep 2s
+
+-
+-port2=`lpinfo -v | grep -i 'usb://Brother/${device_name}' | head -1`
+-if [ "$port2" = '' ];then
+- port2=`lpinfo -v | grep 'usb://Brother' | head -1`
+-fi
+-
+-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 ${printer_name} -E -v $port -m br${printer_model}.ppd
+-lpadmin -p ${printer_name} -E -v $port -P $ppd_file_name
+-
+ exit 0
+
diff --git a/Brother.license b/Brother.license
new file mode 100644
index 000000000000..33aa1597624f
--- /dev/null
+++ b/Brother.license
@@ -0,0 +1,47 @@
+Source: http://www.brother.com/cgi-bin/agreement/agreement.cgi?dlfile=http://solutions.brother.com/Library/sol/printer/linux/dlf/brhl2140lpr-2.0.2-1.i386.rpm&lang=English_lpr
+
+License Agreement
+
+This Agreement provides terms and conditions for license grant from
+Brother Industries, Ltd ("Broher"). Brother, who owns all copyrights to
+the software that is distributed with this Agreement ("Software") to
+recipients thereof ("User"), for use of the Software. User shall have
+the right to use the Software only in accordance with the terms and
+conditions of this Agreement. Any use by User of the Software shall be
+deemed as its agreement hereto.
+
+Brother retains any and all copyrights to the Software. In no case this
+Agreement shall be construed to assign or otherwise transfer from
+Brother to User any copyrights or other intellectual property rights to
+whole or any part of the Software.
+
+Brother grants User a non-exclusive license: to reproduce and/or
+distribute (via Internet or in any other manner) the Software. Further,
+Brother grants User a non-exclusive license to modify, alter, translate
+or otherwise prepare derivative works of the Software and to reproduce
+and distribute (via Internet or in any other manner) such modification,
+alteration, translation or other derivative works for any purpose.
+
+The license of the Software from Brother hereunder is granted "AS IS."
+BROTHER HEREBY DISCLAIMS ANY WARRANTIES WITH RESPECT TO THE SOFTWARE,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTY FOR THE
+QUALITY, MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE OR
+NON-INFRINGEMENT.
+
+Brother shall have no liability in contract, tort (including negligence
+or breach of statutory duty) or otherwise for any interruption of use,
+loss of data, or for any indirect, incidental, punitive or consequential
+loss or damage, or for any loss of profit, revenue, data, goodwill or
+anticipated savings that arises under, out of, or in contemplation of
+this Agreement or otherwise arises due to any error, inaccuracy or
+defect in the Software even if Brother has been advised of the
+possibility of such loss or damage.
+
+Further, Brother shall have no liability to disclose and/or distribute
+the source cord of the Software to User under any circumstances. In no
+case shall the above license by Brother to modify, alter, translate or
+otherwise prepare derivative works of the Software be construed as
+Brother's implied agreement or undertakings to disclose and/or
+distribute the source cord of the Software.
+
+All Rights Reserved Copyright (C) Brother Industries, Ltd.
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..1eac929204d0
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,60 @@
+# Maintainer: Frederik Schwan <frederik dot schwan at linux dot com>
+# orphaned: Maintainer: Samuel Kesterson <arch@k-labs.com>
+
+pkgname=brother-hl4150cdn
+pkgver=1.1.1
+pkgrel=5
+pkgdesc="Brother HL-4150CDN CUPS printer driver"
+url="http://support.brother.com/g/b/downloadlist.aspx?c=de&lang=de&prod=hl4150cdn_all&os=127&flang=English"
+license=('custom:Brother' 'GPL')
+depends=('a2ps' 'cups')
+makedepends=('libarchive')
+install="brother-hl4150cdn.install"
+arch=('i686' 'x86_64')
+
+if [[ "$CARCH" == "x86_64" ]]; then
+ depends+=('lib32-glibc')
+fi
+
+source=(0001-brother-hl4150cdn.patch
+ Brother.license
+ http://download.brother.com/welcome/dlf005939/hl4150cdnlpr-${pkgver}-${pkgrel}.i386.rpm
+ http://download.brother.com/welcome/dlf005941/hl4150cdncupswrapper-${pkgver}-${pkgrel}.i386.rpm)
+md5sums=('7c21a135c11c7ac3e868e263a6807163'
+ '58796468c65d77c835e5959970b91f36'
+ '433c0a17c9d4ada74892072cc71bf042'
+ '8f21d5054fb80bb148174a7a597b8fd0')
+
+
+build() {
+ cd $srcdir
+ for n in *.rpm; do
+ bsdtar xf "$n"
+ done
+
+ patch -p1 < 0001-brother-hl4150cdn.patch
+}
+
+package() {
+ install -d "$pkgdir/usr/share"
+ cp -R usr/bin "$pkgdir/usr";
+ cp -R usr/local/Brother "$pkgdir/usr/share/Brother"
+
+ echo Fixing paths...
+ find $pkgdir -type f -exec sed -i s#/usr/local/Brother#/usr/share/Brother#g {} \;
+
+ echo "Installing PPD."
+ mkdir -p $pkgdir/usr/share/cups/model/
+
+ PKGDIR=$pkgdir SRCDIR=$srcdir DESTDIR=$pkgdir DRIVER_PREFIX=/usr/share/Brother \
+ usr/local/Brother/Printer/hl4150cdn/cupswrapper/cupswrapperhl4150cdn -s
+
+ rm $pkgdir/usr/share/Brother/Printer/hl4150cdn/cupswrapper/cupswrapperhl4150cdn
+ rm $pkgdir/usr/share/Brother/Printer/hl4150cdn/inf/setupPrintcapij
+
+ chown root:lp $pkgdir/usr/share/Brother/Printer/hl4150cdn/inf
+ chmod 775 $pkgdir/usr/share/Brother/Printer/hl4150cdn/inf
+ chown daemon:lp $pkgdir/usr/share/Brother/Printer/hl4150cdn/inf/brhl4150cdnrc
+ chmod 664 $pkgdir/usr/share/Brother/Printer/hl4150cdn/inf/brhl4150cdnrc
+ install -Dm644 Brother.license $pkgdir/usr/share/licenses/$pkgname/LICENSE
+}
diff --git a/brother-hl4150cdn.install b/brother-hl4150cdn.install
new file mode 100644
index 000000000000..39ddba9de039
--- /dev/null
+++ b/brother-hl4150cdn.install
@@ -0,0 +1,50 @@
+MODEL=hl4150cdn
+
+advisorymsg() {
+ cat <<EOM
+ The usblp kernel module must be disabled before CUPS can detect the
+ printer.
+
+ Start CUPS after installation and type the command:
+ lpadmin -p $MODEL -E -v \$URL -P /usr/share/cups/model/$MODEL.ppd
+ where \$URL can be found using the command:
+ lpinfo -v | grep -i 'Brother'
+ You can also register the new printer using web interface at:
+ http://localhost:631/
+
+ You may have to add "$MODEL" to /usr/share/Brother/inf/brPrintList for
+ proper operation and extended printing options.
+EOM
+}
+
+post_install() {
+ _port=`lpinfo -v | grep -i 'usb://Brother/' | head -1 | sed 's/direct //g'`
+
+ if [ "$_port" = '' ];then
+ _port="usb:/dev/usb/lp0"
+ fi
+ echo ""
+ echo "Added $MODEL configuration defaults to /usr/share/Brother/inf/brPrintList"
+ echo ""
+ cat /usr/share/Brother/Printer/hl4150cdn/inf/brhl4150cdnrc >> /usr/share/Brother/Printer/hl4150cdn/inf/brPrintList
+
+# echo $MODEL >> /usr/share/Brother/inf/brPrintList
+# lpadmin -p $MODEL -E -v $_port -P /usr/share/cups/model/$MODEL.ppd
+
+ advisorymsg
+}
+
+post_upgrade() {
+ advisorymsg
+}
+
+pre_remove() {
+ echo "Remember to unregister the $MODEL:"
+ echo " lpadmin -x $MODEL"
+ echo "Or visit the CUPS web interface at:"
+ echo " http://localhost:631/"
+ # lpadmin -x $MODEL
+
+ # Reverse this
+ # echo $MODEL >> /usr/share/Brother/inf/brPrintList
+}