hplip-plugin-3.16.3.ebuild 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="6"
  4. inherit udev unpacker
  5. DESCRIPTION="Proprietary plugins and firmware for HPLIP"
  6. HOMEPAGE="http://hplipopensource.com/hplip-web/index.html"
  7. SRC_URI="http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-${PV}-plugin.run"
  8. LICENSE="hplip-plugin"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE=""
  12. RDEPEND="
  13. ~net-print/hplip-${PV}
  14. virtual/udev
  15. "
  16. DEPEND=""
  17. S=${WORKDIR}
  18. HPLIP_HOME=/usr/share/hplip
  19. # Binary prebuilt package
  20. QA_PRESTRIPPED="
  21. /usr/share/hplip/fax/plugins/fax_marvell.so
  22. /usr/share/hplip/prnt/plugins/hbpl1.so
  23. /usr/share/hplip/prnt/plugins/lj.so
  24. /usr/share/hplip/scan/plugins/bb_marvell.so
  25. /usr/share/hplip/scan/plugins/bb_soapht.so
  26. /usr/share/hplip/scan/plugins/bb_soap.so
  27. "
  28. # License does not allow us to redistribute the "source" package
  29. RESTRICT="mirror"
  30. src_unpack() {
  31. unpack_makeself "hplip-${PV}-plugin.run"
  32. }
  33. src_install() {
  34. local hplip_arch=$(use amd64 && echo 'x86_64' || echo 'x86_32')
  35. insinto "${HPLIP_HOME}"/data/firmware
  36. doins *.fw.gz
  37. for plugin in *-${hplip_arch}.so; do
  38. local plugin_type=prnt
  39. case "${plugin}" in
  40. fax_*) plugin_type=fax ;;
  41. bb_*) plugin_type=scan ;;
  42. esac
  43. exeinto "${HPLIP_HOME}"/${plugin_type}/plugins
  44. newexe ${plugin} ${plugin/-${hplip_arch}}
  45. done
  46. mkdir -p "${ED}/var/lib/hp/"
  47. cat >> "${ED}/var/lib/hp/hplip.state" <<-_EOF_
  48. [plugin]
  49. installed = 1
  50. eula = 1
  51. version = ${PV}
  52. _EOF_
  53. }