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