summaryrefslogtreecommitdiff
blob: 8d7786e5ddee3421ce90e27e78232407a12b5aff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit unpacker

MY_PV="${PV/_p/-}"

DESCRIPTION="CUPS wrapper for the Brother MFC-J6910DW LPR drivers"
HOMEPAGE="http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html"
SRC_URI="http://www.brother.com/pub/bsc/linux/dlf/${PN/-bin/}-${MY_PV}.i386.deb"

S="${WORKDIR}"

QA_PREBUILT=".*"

LICENSE="metapackage"
SLOT="0"
KEYWORDS="~amd64"
RESTRICT="mirror"

RDEPEND="
	net-print/cups
	net-print/cups-filters
	net-print/mfcj6910dwlpr-bin"

src_unpack() {
	unpack_deb ${A}
}

src_prepare() {
	epatch "${FILESDIR}/mfcj6910dwcupswrapper-3.0.0_p1-gentoo.patch"
	eapply_user
}

src_install() {
	cp -pPR opt "${ED}/opt/" || die
}

pkg_postinst() {
	einfo "Installing CUPS wrapper script..."
	/opt/brother/Printers/mfcj6910dw/cupswrapper/cupswrappermfcj6910dw
}

pkg_postrm() {
	einfo "Cleaning up live-installed files."
	local printer_model="mfcj6910dw"
	rm -f /usr/share/cups/model/Brother/brother_${printer_model}_printer_en.ppd
	rmdir --ignore-fail-on-non-empty /usr/share/cups/model/Brother
	rm -f /usr/share/ppd/Brother/brother_${printer_model}_printer_en.ppd
	rmdir --ignore-fail-on-non-empty /usr/share/ppd/Brother
	rm -f /usr/libexec/cups/filter/brother_lpdwrapper_${printer_model}
}