summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven-Hendrik Haase2017-04-07 20:45:51 +0200
committerSven-Hendrik Haase2017-04-07 20:45:51 +0200
commit30426849107af16d96b7565458072846f21b05cc (patch)
treed7da18fc20f4ddb32ca5428dc0f333f01b851a82
parent7331d81e71d08292407c18e38f48c3a55250d4a0 (diff)
downloadaur-30426849107af16d96b7565458072846f21b05cc.tar.gz
Fix up package
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD25
-rw-r--r--wrapper.patch193
3 files changed, 212 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9079e03de554..050adda36b57 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -11,8 +11,10 @@ pkgbase = brother-dcp-l8450cdw
depends = lib32-glibc
source = http://download.brother.com/welcome/dlf101082/dcpl8450cdwlpr-1.1.2-1.i386.rpm
source = http://download.brother.com/welcome/dlf101083/dcpl8450cdwcupswrapper-1.1.3-1.i386.rpm
+ source = wrapper.patch
sha512sums = 3669f81f0624da3ca0bde93c79dd6350b27fd311052babc5db5e8c6968299da5cbc38f4833ef284e39e66aa895e0213ef99990c3d7cde9d04e5cb5f5513c19a3
sha512sums = 9648a92e69ecf2086cf766ff67717f7e030d1613517f23304490bd4560431ecdeceeb11af99be47c306990559464b3bc99cfd4da2b61d5fcfeb0a752d3552455
+ sha512sums = 56f0a77158294641cba9540fc01ea40569eaec13b19986ab12babd99860ad20beeabefd8b8e405112427a1c6cc664a2d8c34fe2212143d31a48a8b2edc10aec9
pkgname = brother-dcp-l8450cdw
diff --git a/PKGBUILD b/PKGBUILD
index 9212b7a97f81..aac86078198a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,19 +9,28 @@ license=('GPL2' 'custom:Brother EULA')
depends=('cups')
depends_x86_64=('lib32-glibc')
source=("http://download.brother.com/welcome/dlf101082/dcpl8450cdwlpr-1.1.2-1.i386.rpm"
- "http://download.brother.com/welcome/dlf101083/dcpl8450cdwcupswrapper-1.1.3-1.i386.rpm")
+ "http://download.brother.com/welcome/dlf101083/dcpl8450cdwcupswrapper-1.1.3-1.i386.rpm"
+ wrapper.patch)
sha512sums=('3669f81f0624da3ca0bde93c79dd6350b27fd311052babc5db5e8c6968299da5cbc38f4833ef284e39e66aa895e0213ef99990c3d7cde9d04e5cb5f5513c19a3'
- '9648a92e69ecf2086cf766ff67717f7e030d1613517f23304490bd4560431ecdeceeb11af99be47c306990559464b3bc99cfd4da2b61d5fcfeb0a752d3552455')
+ '9648a92e69ecf2086cf766ff67717f7e030d1613517f23304490bd4560431ecdeceeb11af99be47c306990559464b3bc99cfd4da2b61d5fcfeb0a752d3552455'
+ '56f0a77158294641cba9540fc01ea40569eaec13b19986ab12babd99860ad20beeabefd8b8e405112427a1c6cc664a2d8c34fe2212143d31a48a8b2edc10aec9')
+
+prepare() {
+ cd ${srcdir}/opt/brother/Printers/dcpl8450cdw/cupswrapper
+ patch < ${srcdir}/wrapper.patch
+}
package() {
install -Dm755 ${srcdir}/usr/bin/brprintconf_dcpl8450cdw ${pkgdir}/usr/bin/brprintconf_dcpl8450cdw
cp -r ${srcdir}/opt ${pkgdir}/opt
- install -Dm644 \
- ${srcdir}/opt/brother/Printers/dcpl8450cdw/cupswrapper/brother_dcpl8450cdw_printer_en.ppd \
- ${pkgdir}/usr/share/cups/model/brother_dcpl8450cdw_printer_en
+ mkdir -p ${pkgdir}/usr/share/cups/model/Brother
+ mkdir -p ${pkgdir}/usr/lib/cups/filter
+
+ sh ${srcdir}/opt/brother/Printers/dcpl8450cdw/cupswrapper/cupswrapperdcpl8450cdw > ${pkgdir}/usr/lib/cups/filter/brother_lpdwrapper_dcpl8450cdw
+ chmod 755 ${pkgdir}/usr/lib/cups/filter/brother_lpdwrapper_dcpl8450cdw
- install -Dm755 \
- ${srcdir}/opt/brother/Printers/dcpl8450cdw/cupswrapper/cupswrapperdcpl8450cdw \
- ${pkgdir}/usr/lib/cups/filter/brother_lpdwrapper_dcpl8450cdw
+ ln -s \
+ /opt/brother/Printers/dcpl8450cdw/cupswrapper/brother_dcpl8450cdw_printer_en.ppd \
+ ${pkgdir}/usr/share/cups/model/Brother/
}
diff --git a/wrapper.patch b/wrapper.patch
new file mode 100644
index 000000000000..1e3ebb9c2606
--- /dev/null
+++ b/wrapper.patch
@@ -0,0 +1,193 @@
+--- cupswrapperdcpl8450cdw 2017-04-07 19:59:22.664351637 +0200
++++ cupswrapperdcpl8450cdw-new 2017-04-07 20:15:30.442138326 +0200
+@@ -23,90 +23,13 @@
+ device_name=`echo $printer_name | eval sed -e 's/MFC/MFC-/' -e 's/DCP/DCP-/' -e 's/HL/HL-/' -e 's/FAX/FAX-/'`
+ pcfilename=`echo $printer_name | tr -d '[A-Z]'`
+ device_model="Printers"
+-tmp_filter=/var/tmp/brother_lpdwrapper_${printer_model}
+-
+-if [ -d "/usr/share/cups/model" ]; then
+- mkdir -p /usr/share/cups/model/Brother
+-else
+- mkdir -p /usr/share/ppd/Brother
+-fi
+-
+-if [ -d "/usr/share/ppd" ]; then
+- mkdir -p /usr/share/ppd/Brother
+-else
+- mkdir -p /usr/share/cups/model/Brother
+-fi
+-
+-
+-
+-if [ "$1" = '-e' ]; then
+- lpadmin -x ${printer_name}
+- rm -f /usr/share/cups/model/Brother/brother_${printer_model}_printer_en.ppd
+- rm -f /usr/share/ppd/Brother/brother_${printer_model}_printer_en.ppd
+- rm -f /usr/lib/cups/filter/brother_lpdwrapper_${printer_model}
+- rm -f /usr/lib64/cups/filter/brother_lpdwrapper_${printer_model}
+- rm -f /opt/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1
+-# 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
+-if [ "$1" = "help" ] || [ "$1" = "-h" ]; then
+- echo 'option -h : help'
+- echo ' -i : install'
+- echo ' -e : uninstall'
+- echo ' -r : remove printer'
+- exit 0
+-fi
+-#mkdir -p /usr/local/Brother/${device_model}/${printer_model}/filter
+-#mkdir -p /usr/lib/cups/filter
+-
+-if [ -e "/opt/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/Brother/brother_${printer_model}_printer_en.ppd
+-if [ -d "/usr/share/cups/model" ]; then
+- ppd_file_name=/usr/share/cups/model/Brother/brother_${printer_model}_printer_en.ppd
+-else
+- ppd_file_name=/usr/share/ppd/Brother/brother_${printer_model}_printer_en.ppd
+-fi
+-
+-if [ -e "/opt/brother/${device_model}/${printer_model}/cupswrapper/brother_${printer_model}_printer_en.ppd" ]; then
+-cp "/opt/brother/${device_model}/${printer_model}/cupswrapper/brother_${printer_model}_printer_en.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/Brother/brother_${printer_model}_printer_en.ppd
+- chmod 644 /usr/share/ppd/Brother/brother_${printer_model}_printer_en.ppd
+-fi
+-fi
++tmp_filter=/tmp/brother_lpdwrapper_${printer_model}
+
+ #
+ # create temporary CUPS Filter
+ #
+
+-cat <<!ENDOFWFILTER! >$tmp_filter
++cat <<!ENDOFWFILTER!
+ #! /bin/sh
+ #
+ # Copyright (C) 2005-2016 Brother. Industries, Ltd.
+@@ -260,97 +183,3 @@
+ exit $errorcode
+
+ !ENDOFWFILTER!
+-
+-chmod 755 $tmp_filter
+-
+-#
+-# check /usr/lib/cups/filter
+-#
+-if [ -d /usr/lib/cups/filter ]; then
+- brotherlpdwrapper=/usr/lib/cups/filter/brother_lpdwrapper_${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/brother_lpdwrapper_${printer_model}
+- rm -f $brotherlpdwrapper64
+- cp $tmp_filter $brotherlpdwrapper64
+-fi
+-
+-#
+-# remove temporary script file
+-#
+-rm -f $tmp_filter
+-
+-#chmod a+w /opt/brother/${device_model}/${printer_model}/inf/br${printer_model}rc
+-#chmod a+w /opt/brother/${device_model}/${printer_model}/inf
+-if [ -e /etc/init.d/lpd ]; then
+- /etc/init.d/lpd stop
+-fi
+-if [ -e /etc/init.d/lprng ]; then
+- /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
+- /etc/init.d/cupsys restart
+-fi
+-
+-sleep 2s
+-
+-uris=$(lpinfo -v)
+-
+-for uri in $uris
+-do
+- URI=$(echo $uri | grep ${device_name} | grep usb)
+- if [ "$URI" != '' ];then
+- break;
+- fi
+-done
+-
+-if [ "$URI" = '' ];then
+- for uri in $uris
+- do
+- URI=$(echo $uri | grep ${device_name} )
+- if [ "$URI" != '' ];then
+- break;
+- fi
+- done
+-fi
+-
+-if [ "$URI" = '' ];then
+- for uri in $uris
+- do
+- URI=$(echo $uri | grep -i Brother | grep usb )
+- if [ "$URI" != '' ];then
+- break;
+- fi
+- done
+-fi
+-
+-if [ "$URI" = '' ];then
+- for uri in $uris
+- do
+- URI=$(echo $uri | grep usb )
+- if [ "$URI" != '' ];then
+- break;
+- fi
+- done
+-fi
+-
+-
+-if [ "$URI" = '' ];then
+- URI="usb://dev/usb/lp0"
+-fi
+-
+-echo lpadmin -p ${printer_name} -E -v $URI -P $ppd_file_name
+-lpadmin -p ${printer_name} -E -v $URI -P $ppd_file_name
+-
+-exit 0
+-