net-print/epson-inkjet-printer/epson-inkjet-printer-1.0.0.ebuild (view raw)
1# Copyright 1999-2021 Gentoo Authors
2# Distributed under the terms of the GNU General Public License v2
3
4EAPI=8
5
6inherit autotools
7inherit rpm
8
9DESCRIPTION="Epson Inkjet Printer Driver (ESC/P)"
10HOMEPAGE="https://download.ebz.epson.net/dsc/search/01/search/?OSC=LX"
11SRC_URI="http://download.ebz.epson.net/dsc/f/01/00/01/87/87/4bb10f016a8e2e3ec39d55ff72b636c0a340365c/${PN}-201207w-${PV}-1lsb3.2.src.rpm"
12
13S="${WORKDIR}/${PN}-filter-${PV}"
14
15# don't know if it's ok to specify custom variables, but why not
16
17_printer_dir="${WORKDIR}/${PN}-201207w-${PV}"
18_cups_libexec_dir="/usr/libexec/cups"
19
20LICENSE="GPL-2 EPSON-EULA"
21SLOT="0"
22KEYWORDS="amd64"
23IUSE="abi_x86_32"
24
25DEPEND="net-print/cups"
26RDEPEND="${DEPEND}"
27
28PATCHES=(
29 "${FILESDIR}/${P}-cups-libexec-dir.patch"
30 "${FILESDIR}/${P}-resource-dir.patch"
31 "${FILESDIR}/${P}-raster.patch"
32 "${FILESDIR}/${P}-usrdoc.patch"
33)
34
35src_unpack() {
36 rpm_src_unpack "${A}"
37}
38
39src_prepare() {
40 default
41 eautoreconf
42
43 sed -i -e "/^\*cupsFilter/ s:/opt/${PN}-201207w/cups/lib:${_cups_libexec_dir}:" \
44 -e "s:/opt/${PN}-201207w:/usr/share/${PN}:" \
45 ${_printer_dir}/ppds/*.ppd
46}
47
48src_configure() {
49 econf LDFLAGS="${LDFLAGS} -Wl,--no-as-needed" --enable-debug
50}
51
52src_install() {
53 default
54
55 if use abi_x86_32; then
56 dolib.so "${_printer_dir}/lib/libEpson_201207w.MT.so.1.0.0" \
57 "${_printer_dir}/lib/libEpson_201207w.so.1.0.0"
58 else
59 dolib.so "${_printer_dir}/lib64/libEpson_201207w.MT.so.1.0.0" \
60 "${_printer_dir}/lib64/libEpson_201207w.so.1.0.0"
61 fi
62
63 insinto "/usr/share/${PN}"
64 doins -r "${_printer_dir}/resource/" \
65 "${_printer_dir}/watermark/"
66
67 insinto "/usr/share/ppd/${PN}"
68 doins ${_printer_dir}/ppds/*.ppd
69
70}