diff options
author | 2017-08-12 02:32:43 +0300 | |
---|---|---|
committer | 2017-09-06 12:58:31 +0200 | |
commit | 8aa2232c76f14cc548f443c5a85baa771630d957 (patch) | |
tree | 62849bd1baab2a018da78843d2b8c62b6ed35ba8 /net-print/kyocera-1x2x-mfp-driver/kyocera-1x2x-mfp-driver-1.1203-r1.ebuild | |
parent | net-irc/atheme-services: Revbump to 7.2.9-r1 (diff) | |
download | gentoo-8aa2232c76f14cc548f443c5a85baa771630d957.tar.gz gentoo-8aa2232c76f14cc548f443c5a85baa771630d957.tar.bz2 gentoo-8aa2232c76f14cc548f443c5a85baa771630d957.zip |
net-print/kyocera-1x2x-mfp-driver: New ebuild
This ebuild installs proprietary PPDs and filter program which make CUPS
work with old Kyocera printers of 1x2x MFP family:
- Kyocera FS-1020MFP
- Kyocera FS-1025MFP
- Kyocera FS-1040
- Kyocera FS-1060DN
- Kyocera FS-1120MFP
- Kyocera FS-1125MFP
Closes: https://bugs.gentoo.org/627802
Closes: https://github.com/gentoo/gentoo/pull/5416
Signed-off-by: Pavel Kretov <firegurafiku@gmail.com>
Diffstat (limited to 'net-print/kyocera-1x2x-mfp-driver/kyocera-1x2x-mfp-driver-1.1203-r1.ebuild')
-rw-r--r-- | net-print/kyocera-1x2x-mfp-driver/kyocera-1x2x-mfp-driver-1.1203-r1.ebuild | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/net-print/kyocera-1x2x-mfp-driver/kyocera-1x2x-mfp-driver-1.1203-r1.ebuild b/net-print/kyocera-1x2x-mfp-driver/kyocera-1x2x-mfp-driver-1.1203-r1.ebuild new file mode 100644 index 000000000000..a235beae8bdc --- /dev/null +++ b/net-print/kyocera-1x2x-mfp-driver/kyocera-1x2x-mfp-driver-1.1203-r1.ebuild @@ -0,0 +1,129 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +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_} )" + +RDEPEND="net-print/cups" +DEPEND="app-arch/unzip" +RESTRICT="fetch mirror" +QA_PREBUILT="/usr/libexec/cups/filter/rastertokpsl" + +get_tarball_name() { + # Note the capitalization inconsistency. Don't "fix" that. + case "$1" in + ar) echo arabic ;; + cs) echo czech ;; + de) echo German ;; + el) echo greek ;; + en) echo English ;; + es) echo Spanish ;; + fr) echo French ;; + he) echo hebrew ;; + hu) echo hungarian ;; + it) echo Italian ;; + ko) echo Korean ;; + pl) echo polish ;; + pt) echo Portuguese ;; + ro) echo romanian ;; + ru) echo russian ;; + th) echo thai ;; + tr) echo turkish ;; + vi) echo vietnamese ;; + zh-CN) echo simplified ;; + zh-TW) echo traditional ;; + *) die ;; + esac +} + +pkg_nofetch() { + einfo "Please, navigate your browser to the following URL and manually" + einfo "download the file named '${A}', then put it into your DISTDIR." + einfo "https://www.kyoceradocumentsolutions.eu/index/service/dlc.false.driver.FS1025MFP._.EN.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." +} |