iscan-plugin-gt-x770-2.1.2.1-r3.ebuild 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit rpm versionator multilib
  5. MY_PV="$(get_version_component_range 1-3)"
  6. MY_PVR="$(replace_version_separator 3 -)"
  7. DESCRIPTION="Epson Perfection V500 scanner plugin for SANE 'epkowa' backend"
  8. HOMEPAGE="http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX"
  9. SRC_URI="
  10. x86? ( https://dev.gentoo.org/~flameeyes/avasys/${PN}/${MY_PV}/${PN}-${MY_PVR}.i386.rpm )
  11. amd64? ( https://dev.gentoo.org/~flameeyes/avasys/${PN}/${MY_PV}/${PN}-${MY_PVR}.x86_64.rpm )
  12. "
  13. LICENSE="AVASYS"
  14. SLOT="0"
  15. KEYWORDS="-* ~amd64 ~x86"
  16. IUSE=""
  17. DEPEND=">=media-gfx/iscan-2.21.0
  18. !!<media-gfx/iscan-plugin-gt-x770-2.1.2.1-r2"
  19. RDEPEND="${DEPEND}"
  20. S="${WORKDIR}"
  21. QA_PREBUILT="/opt/iscan/esci/libesint7C.so*"
  22. src_configure() { :; }
  23. src_compile() { :; }
  24. src_install() {
  25. # install scanner firmware
  26. insinto /usr/share/iscan
  27. doins "${WORKDIR}/usr/share/iscan/"*
  28. dodoc usr/share/doc/*/*
  29. # install scanner plugins
  30. exeinto /opt/iscan/esci
  31. doexe "${WORKDIR}/usr/$(get_libdir)/iscan/"*
  32. }
  33. pkg_setup() {
  34. basecmds=(
  35. "iscan-registry --COMMAND interpreter usb 0x04b8 0x0130 /opt/iscan/esci/libesint7C /usr/share/iscan/esfw7C.bin"
  36. )
  37. }
  38. pkg_postinst() {
  39. elog
  40. elog "Firmware file esfw41.bin for Epson Perfection V500"
  41. elog "has been installed in /usr/share/iscan."
  42. elog
  43. [[ -n ${REPLACING_VERSIONS} ]] && return
  44. # Needed for scanner to work properly.
  45. if [[ ${ROOT} == "/" ]]; then
  46. for basecmd in "${basecmds[@]}"; do
  47. eval ${basecmd/COMMAND/add}
  48. done
  49. else
  50. ewarn "Unable to register the plugin and firmware when installing outside of /."
  51. ewarn "execute the following command yourself:"
  52. for basecmd in "${basecmds[@]}"; do
  53. ewarn "${basecmd/COMMAND/add}"
  54. done
  55. fi
  56. }
  57. pkg_prerm() {
  58. [[ -n ${REPLACED_BY_VERSION} ]] && return
  59. if [[ ${ROOT} == "/" ]]; then
  60. for basecmd in "${basecmds[@]}"; do
  61. eval ${basecmd/COMMAND/remove}
  62. done
  63. else
  64. ewarn "Unable to de-register the plugin and firmware when installing outside of /."
  65. ewarn "execute the following command yourself:"
  66. for basecmd in "${basecmds[@]}"; do
  67. ewarn "${basecmd/COMMAND/remove}"
  68. done
  69. fi
  70. }