spacepaste

  1.  
  2. # Description: Brother HL-L8250CDW Printer Driver
  3. # URL: http://support.brother.com/g/s/id/linux/en
  4. # Maintainer: Brian Madonna, Bmadonnaster at gmail dot com
  5. # Depends on: cups
  6. name=brother-hl8250
  7. version=1.1.2
  8. release=1
  9. source=(http://www.brother.com/pub/bsc/linux/packages/hll8250cdncupswrapper-$version-1.i386.rpm
  10. http://www.brother.com/pub/bsc/linux/packages/hll8250cdnlpr-$version-1.i386.rpm)
  11. build() {
  12. # do not install in '/usr/local'
  13. if [ -d $SRC/usr/local/Brother ]; then
  14. install -d $SRC/usr/share
  15. mv $SRC/usr/local/Brother/ $SRC/usr/share/brother
  16. rm -rf $SRC/usr/local
  17. sed -i 's|/usr/local/Brother|/usr/share/brother|g' `grep -lr '/usr/local/Brother' ./`
  18. fi
  19. # setup cups-directories
  20. install -d $SRC/usr/share/cups/model
  21. install -d $SRC/usr/lib/cups/filter
  22. # go to the cupswrapper directory and find the source file from wich to generate a ppd- and wrapper-file
  23. cd `find . -type d -name 'cupswrapper'`
  24. if [ -f cupswrapper* ]; then
  25. _wrapper_source=`ls cupswrapper*`
  26. sed -i '/^\/etc\/init.d\/cups/d' $_wrapper_source
  27. sed -i '/^sleep/d' $_wrapper_source
  28. sed -i '/^lpadmin/d' $_wrapper_source
  29. sed -i 's|/usr|$SRC/usr|g' $_wrapper_source
  30. sed -i 's|/opt|$SRC/opt|g' $_wrapper_source
  31. sed -i 's|/model/Brother|/model|g' $_wrapper_source
  32. sed -i 's|lpinfo|echo|g' $_wrapper_source
  33. export src=$SRC
  34. ./$_wrapper_source
  35. sed -i 's|$SRC||' $SRC/usr/lib/cups/filter/*lpdwrapper*
  36. sed -i "s|$SRC||" $SRC/usr/lib/cups/filter/*lpdwrapper*
  37. rm $_wrapper_source
  38. fi
  39. # /etc/printcap is managed by cups
  40. rm `find $srcdir -type f -name 'setupPrintcap*'`
  41. }
  42. cp -R $SRC/usr $PKG
  43. #We need to install the filter file to the cups filter path, so the PPD can find it
  44. mkdir -p $PKG/usr/lib/cups/filter
  45. cp $SRC/opt/brother/Printers/hll8250cdn/cupswrapper/brother_hll8250cdn_printer_en.ppd \
  46. $PKG/usr/lib/cups/filter
  47. if [ -d $SRC/opt ]; then
  48. cp -R $SRC/opt $PKG;
  49. fi
  50. # install -m 644 -D cupswrapper-license.txt $pkgdir/usr/share/licenses/${pkgname}/cupswrapper-licence.txt
  51. # install -m 644 -D lpr-license.txt $pkgdir/usr/share/licenses/${pkgname}/lpr-licence.txt
  52. }
  53.