Want more features on Pastebin? Sign Up, it's FREE!
Guest

brother-hl2270dw PKGBUILD

By: a guest on Oct 6th, 2012  |  syntax: Bash  |  size: 2.39 KB  |  views: 35  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print  |  QR code  |  clone
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Maintainer: Jonathan Doman <jonathan.doman@gmail.com>
  2.  
  3. pkgname=brother-hl2270dw
  4. _cupswrappername=cupswrapperHL2270DW
  5. pkgver=2.0.4_2
  6. pkgrel=3
  7. pkgdesc="Brother HL-2270DW CUPS Driver"
  8. arch=('i686' 'x86_64')
  9. url='http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html'
  10. license=('GPL')
  11. depends=('a2ps' 'cups' 'lib32-glibc')
  12. source=("http://www.brother.com/pub/bsc/linux/dlf/hl2270dwlpr-2.1.0-1.i386.rpm"
  13.         "http://www.brother.com/pub/bsc/linux/dlf/${_cupswrappername}-${pkgver//_/-}.i386.rpm")
  14. md5sums=('69c1987c0636a64fb48f3c6826a3ae28'
  15.          '5a7cc60cafaf60d722d9bce3f2751164')
  16.  
  17. package() {
  18.   _cupswrapperFile="$srcdir/usr/local/Brother/Printer/HL2270DW/cupswrapper/${_cupswrappername}-2.0.4"
  19.  
  20.   sed -i -e '/^!ENDOFWFILTER!/ q' "${_cupswrapperFile}"
  21.   sed -i -e 's#/usr#$srcdir/usr#' "${_cupswrapperFile}"
  22.  
  23.   sed -i -e 's#/usr/local#/usr/share#' "$srcdir/usr/local/Brother/Printer/HL2270DW/lpd/filterHL2270DW"
  24.  
  25.   mkdir -p "$srcdir/usr/share/cups/model/"
  26.  
  27.   # Run the install script to extract the PPD file
  28.   . "${_cupswrapperFile}"
  29.  
  30.   # Remove unnecessary files
  31.   rm "$srcdir/usr/local/Brother/Printer/HL2270DW/inf/setupPrintcap2"
  32.   rm "${_cupswrapperFile}"
  33.  
  34.   # Change the PPD description to match other listing for Brother printers in CUPS
  35.   sed -i -e 's/Brother HL2270DW for CUPS/Brother HL-2270DW/' "$srcdir/usr/share/cups/model/HL2270DW.ppd"
  36.  
  37.   # Replace references to $srcdir
  38.   sed -i -e "s#$srcdir/usr#/usr#" "$srcdir/usr/lib/cups/filter/brlpdwrapperHL2270DW"
  39.   sed -i -e "s#/usr/local#/usr/share#" "$srcdir/usr/lib/cups/filter/brlpdwrapperHL2270DW"
  40.  
  41.   chmod +x "$srcdir/usr/lib/cups/filter/brlpdwrapperHL2270DW"
  42.  
  43.   # Changing the default paper size to letter seems to result in better positioning when
  44.   # printing on letter. Sorry to A4 users!
  45.   sed -i -e "s/PaperType=A4/PaperType=Letter/" "$srcdir/usr/local/Brother/Printer/HL2270DW/inf/brHL2270DWrc"
  46.  
  47.   # Change the path for pstops
  48.   sed -i -e "s#/usr/sbin/pstops#/usr/lib/cups/filter/pstops#" "$srcdir/usr/local/Brother/Printer/HL2270DW/lpd/psconvert2"
  49.   sed -i -e "s#/usr/bin/pstops#/usr/lib/cups/filter/pstops#" "$srcdir/usr/local/Brother/Printer/HL2270DW/lpd/filterHL2270DW"
  50.  
  51.   # Copy the src tree into the pkg tree
  52.   cp -R "$srcdir/usr/" "$pkgdir/"
  53.   cp -R "$srcdir/var/" "$pkgdir/"
  54.  
  55.   mv "$pkgdir/usr/local/Brother" "$pkgdir/usr/share/"
  56.   rmdir "$pkgdir/usr/local"
  57. }
  58.  
  59. # vim:set ts=2 sw=2 et:
clone this paste RAW Paste Data