blob: ee73cd5036fba51d70c7438cb5355dacf1f3b9d9 (
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION="Printer descriptions (PPDs) and filters for Kyocera 1x2x MFP"
HOMEPAGE="http://www.kyoceradocumentsolutions.eu"
SRC_URI="LinuxDrv_${PV}_FS-1x2xMFP.zip"
LICENSE="GPL-2 kyocera-mita-ppds"
SLOT="0"
KEYWORDS="-* ~amd64"
IUSE_L10N=( en ar cs de el es fr he hu it ko pl pt ro ru th tr vi zh-CN zh-TW )
IUSE="+rastertokpsl-fix +${IUSE_L10N[@]/#/l10n_}"
REQUIRED_USE="|| ( ${IUSE_L10N[@]/#/l10n_} )"
RESTRICT="fetch mirror"
RDEPEND="net-print/cups"
BDEPEND="app-arch/unzip"
QA_PREBUILT="/usr/libexec/cups/filter/rastertokpsl"
get_tarball_name() {
# Note the capitalization inconsistency. Don't "fix" that.
declare -A animals=(
[ar]=arabic [cs]=czech [de]=German [el]=greek [en]=English
[es]=Spanish [fr]=French [he]=hebrew [hu]=hungarian [it]=Italian
[ko]=Korean [pl]=polish [pt]=Portuguese [ro]=romanian [ru]=russian
[th]=thai [tr]=turkish [vi]=vietnamese [zh-CN]=simplified [zh-TW]=traditional
)
echo "${animals[$1]}"
}
pkg_nofetch() {
einfo "Please, navigate your browser to the following URL, select"
einfo "'Support - Downloads' in the menu, select 'FS-1025MFP',"
einfo "select 'Linux print driver (${PV})', accept EULA, and manually"
einfo "download the file named '${A}', then put it into your DISTDIR."
einfo "https://www.kyoceradocumentsolutions.eu/en/support/downloads.name-L2V1L2VuL21mcC9GUzExMjVNRlA=.html"
einfo
einfo "Consider keeping a local copy of the file since there're chances"
einfo "the company is going to eventually stop hosting it for whatever"
einfo "reason."
}
src_unpack() {
unpack ${A}
S="${WORKDIR}/Linux/$(usex amd64 64bit 32bit)/Global"
cd "${S}" || die
local l10n
for l10n in ${L10N}; do
local language="$(get_tarball_name "${l10n}")"
unpack "./${language}.tar.gz"
done
}
src_prepare() {
eapply_user
# Original PPD files need patching, since they expect their filter
# program to reside under /usr/lib, but Gentoo uses /usr/libexec.
local orig="/usr/lib/cups/filter/rastertokpsl"
local repl="/usr/libexec/cups/filter/rastertokpsl"
if use rastertokpsl-fix; then
repl+="-fix.sh"
fi
sed -i "s|${orig}|${repl}|g" ./*/Kyocera*.ppd || die
}
src_install() {
insinto /usr/share/cups/model/KyoceraMita
install_with_l10n_suffix() {
local l10n="$1"; shift
local file
for file; do
local bn="${file}"
bn="${bn##*/}"
bn="${bn%.ppd}"
newins "${file}" "${bn}_${l10n}.ppd"
done
}
local l10n
for l10n in ${L10N}; do
local language="$(get_tarball_name "${l10n}")"
install_with_l10n_suffix "${l10n}" "./${language}"/Kyocera*.ppd
done
exeinto /usr/libexec/cups/filter
# Each unpacked tarball contains an exact copy of 'rastertokpsl',
# just take any of them.
local rasterfile="$(find -name rastertokpsl -print -quit)"
[[ $? -eq 0 && -n "${rasterfile}" ]] || die
doexe "${rasterfile}"
if use rastertokpsl-fix; then
doexe "${FILESDIR}/rastertokpsl-fix.sh"
fi
dodoc ../../Readme.htm
elog "This packages installs Kyocera's 'Readme.htm' file (see package"
elog "documentation directory) which lists several common problems and"
elog "workarounds. You might want to have a look on it."
elog "(Merging the package with 'rastertokpsl-fix' USE flag can save you"
elog "from getting some of these problems.)"
elog
elog "Hint: try socket:// protocol when configuring network printing."
}
|