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