diff options
author | Matt Kline | 2016-09-14 07:35:38 -0700 |
---|---|---|
committer | Matt Kline | 2016-09-15 07:41:54 -0700 |
commit | e03de7e10b46efd5628d310b72f128d9befa87f3 (patch) | |
tree | db93ffd3a43a1843648b81b7ec41bf00d361aac3 | |
parent | 1bfcaa2cd59de52da978fe33e5cf2b50098b1db8 (diff) | |
download | aur-e03de7e10b46efd5628d310b72f128d9befa87f3.tar.gz |
Place driver in /opt/brother/...
I originally tried to follow the Arch packaging standards,
but they seem unworkable for this driver.
After some more digging, I have a better understanding of how the CUPS
wrapper works:
1. The CUPS filter script (brother_lpdwrapper_hl3180cdw) copies the
default settings (from .../inf/brhl3180cdwrc) into a temporary file.
2. brcupsconfpt1 is invoked, which, in turn, invokes
brprintconf_hl3180cdw (through the shell, for some reason)
once per option being set.
3. The PostScript is piped into ../lpd/filterhl3180cdw,
which continues the printing process.
Step 2 was the most problematic here. Though brprintconf_hl3180cdw takes
some paths as command line args, /opt/brother/Printer/... seems to be
hard-coded into it. Patching the binary to modify those paths doesn't
seem worth the effort at this point.
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 21 |
2 files changed, 12 insertions, 13 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Wed Sep 14 06:14:27 UTC 2016 +# Thu Sep 15 01:40:21 UTC 2016 pkgbase = brother-hl3180cdw pkgdesc = LPR and CUPS driver for the Brother HL-3180CDW pkgver = 1.1.4 - pkgrel = 2 + pkgrel = 3 url = http://support.brother.com/g/b/downloadtop.aspx?c=us&lang=en&prod=hl3180cdw_us_as install = brother-hl3180cdw.install arch = i686 @@ -1,7 +1,7 @@ # Maintainer: Matt Kline <matt at bitbashing dot io> pkgname='brother-hl3180cdw' pkgver=1.1.4 -pkgrel=2 +pkgrel=3 pkgdesc="LPR and CUPS driver for the Brother HL-3180CDW" arch=('any') url='http://support.brother.com/g/b/downloadtop.aspx?c=us&lang=en&prod=hl3180cdw_us_as' @@ -24,24 +24,23 @@ md5sums=('14bd3e7abdc7783b6c7ad2ced3707b8c' prepare() { cd "$srcdir/opt/" || return 1 patch -p1 < ../brother-hl3180cdw.patch - # Replace /opt/brother/Printers/ with /usr/share/brother - cd "$srcdir/opt/brother/Printers/hl3180cdw" || return 1 - sed -i 's%opt/brother/\(Printers\|${device_model}\)%usr/share/brother%g' \ - cupswrapper/cupswrapperhl3180cdw inf/setupPrintcapij lpd/filterhl3180cdw cd "$srcdir" || return 1 "$srcdir/opt/brother/Printers/hl3180cdw/cupswrapper/cupswrapperhl3180cdw" } package() { - # Copy over drivers, cups wrapper files, and the config program - mkdir -p "$pkgdir/usr/share" - cp -r "$srcdir/opt/brother/Printers" "$pkgdir/usr/share/brother" - cp -r "$srcdir/usr/bin" "$pkgdir/usr/" + # Copy everything over. + # Unfortunately, we can't place files according to Arch packaging guidelines, + # as several programs in the driver use "/opt/brother/Printers/hl3180cdw/..." + # hard-coded paths. + # Short of binary patching the drivers (which seems flaky), there's not much + # we can do. + cp -a "$srcdir/opt" "$srcdir/usr" "$pkgdir" # Strip out the script we just ran and the PPD - rm "$pkgdir/usr/share/brother/hl3180cdw/cupswrapper/cupswrapperhl3180cdw" - mv "$pkgdir/usr/share/brother/hl3180cdw/cupswrapper/brother_hl3180cdw_printer_en.ppd" ppd_file + rm "$pkgdir/opt/brother/Printers/hl3180cdw/cupswrapper/cupswrapperhl3180cdw" + mv "$pkgdir/opt/brother/Printers/hl3180cdw/cupswrapper/brother_hl3180cdw_printer_en.ppd" ppd_file # Install the PPD, the filter, and the license. install -m 644 -D ppd_file "$pkgdir/usr/share/cups/model/brother_hl3180cdw_printer_en.ppd" |