spacepaste

  1.  
  2. # Description: Brother HL-L8250CDW Printer Driver
  3. # URL: http://support.brother.com/g/s/id/linux/en
  4. # Maintainer:
  5. # Depends on: cups
  6. name=brother-hl-l8250cdn
  7. version=1.1.2
  8. release=1
  9. source=(http://www.brother.com/pub/bsc/linux/packages/hll8250cdncupswrapper-$version-$release.i386.rpm
  10. http://www.brother.com/pub/bsc/linux/packages/hll8250cdnlpr-$version-$release.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 srcdir=$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 $SRC -type f -name 'setupPrintcap*'`
  41. cp -R $SRC/usr $PKG
  42. #We need to install the filter file to the cups filter path, so the PPD can find it
  43. mkdir -p $PKG/usr/lib/cups/filter
  44. cp $SRC/opt/brother/Printers/hll8250cdn/cupswrapper/brother_hll8250cdn_printer_en.ppd \
  45. $PKG/usr/lib/cups/filter
  46. if [ -d $SRC/opt ]; then
  47. cp -R $SRC/opt $PKG;
  48. fi
  49. }
  50.