Gentoo Archives: gentoo-commits

From: Ronny Gutbrod <gentoo@××××××××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:master commit in: net-print/hpuld/
Date: Thu, 08 Sep 2022 01:46:46
Message-Id: 1662522899.fa253e9766d67697c3aa792425e49f8f7a0d1b28.tastytea@gentoo
1 commit: fa253e9766d67697c3aa792425e49f8f7a0d1b28
2 Author: Huang Rui <vowstar <AT> gmail <DOT> com>
3 AuthorDate: Wed Sep 7 03:54:59 2022 +0000
4 Commit: Ronny Gutbrod <gentoo <AT> tastytea <DOT> de>
5 CommitDate: Wed Sep 7 03:54:59 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=fa253e97
7
8 net-print/hpuld: fix 860336,860339
9
10 Add missing libusb RDEPEND
11
12 Closes: https://bugs.gentoo.org/860336
13 Closes: https://bugs.gentoo.org/860339
14 Signed-off-by: Huang Rui <vowstar <AT> gmail.com>
15
16 net-print/hpuld/hpuld-1.00.39.15.00.23-r1.ebuild | 111 +++++++++++++++++++++++
17 1 file changed, 111 insertions(+)
18
19 diff --git a/net-print/hpuld/hpuld-1.00.39.15.00.23-r1.ebuild b/net-print/hpuld/hpuld-1.00.39.15.00.23-r1.ebuild
20 new file mode 100644
21 index 000000000..e94749ba6
22 --- /dev/null
23 +++ b/net-print/hpuld/hpuld-1.00.39.15.00.23-r1.ebuild
24 @@ -0,0 +1,111 @@
25 +# Copyright 1999-2022 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI="8"
29 +
30 +MY_PV="$(ver_rs 4 _)"
31 +SANE_CONF_DIR="/etc/sane.d"
32 +
33 +DESCRIPTION="HP Unified Linux Driver (for samsung hardware)"
34 +HOMEPAGE="https://support.hp.com"
35 +
36 +SRC_URI="
37 + https://ftp.ext.hp.com/pub/softlib/software13/printers/LaserJet/M437_M443/ULDLINUX_HewlettPackard_V${MY_PV}.zip
38 +"
39 +
40 +S="${WORKDIR}/uld"
41 +
42 +LICENSE="all-rights-reserved"
43 +SLOT="0"
44 +KEYWORDS="~amd64 ~arm64 ~mips ~x86"
45 +
46 +IUSE="+scanner"
47 +
48 +RDEPEND="
49 + dev-libs/libusb
50 + net-print/cups
51 + scanner? (
52 + media-gfx/sane-backends
53 + )
54 +"
55 +
56 +DEPEND="
57 + ${RDEPEND}
58 +"
59 +
60 +BDEPEND="
61 + app-arch/unzip
62 +"
63 +
64 +# Do not complain about CFLAGS etc since it is binary package
65 +QA_FLAGS_IGNORED=".*"
66 +QA_PRESTRIPPED="${QA_FLAGS_IGNORED}"
67 +
68 +src_unpack() {
69 + default
70 +
71 + for f in ${WORKDIR}/*/*.tar.gz; do
72 + tar -zxf "$f" -C ${WORKDIR} || die
73 + done
74 +}
75 +
76 +src_install() {
77 + export AGREE_EULA="y"
78 + export CONTINUE_INSTALL="y"
79 + export PAGER="$(which cat)"
80 +
81 + # Fix printer install path
82 + sed -i "s#\"/opt\"#\"${D}/opt\"#g" noarch/package_utils || die
83 + sed -i "s#\"/opt\"#\"${D}/opt\"#g" noarch/pre_install.sh || die
84 + sed -i "s#\"\$INSTDIR_CUPS_BACKENDS\"#\"${D}/\$INSTDIR_CUPS_BACKENDS\"#g" noarch/printer.pkg || die
85 + sed -i "s#\"\$INSTDIR_CUPS_FILTERS\"#\"${D}/\$INSTDIR_CUPS_FILTERS\"#g" noarch/printer.pkg || die
86 + sed -i "s#\"\$INSTDIR_CUPS_PPD\"#\"${D}/\$INSTDIR_CUPS_PPD\"#g" noarch/printer-script.pkg || die
87 + sed -i "s#\"\$INSTDIR_LSB_PPD\"#\"${D}/\$INSTDIR_LSB_PPD\"#g" noarch/printer-script.pkg || die
88 + # Not use rpm and dpkg
89 + sed -i "s#which rpm#which not_found_command_${PN}#g" noarch/package_utils || die
90 + sed -i "s#which dpkg#which not_found_command_${PN}#g" noarch/package_utils || die
91 +
92 + # Fix scanner install path
93 + sed -i "s#SANE_DIR=/usr/lib\${LIBSFX}/sane#SANE_DIR=${D}/usr/lib\${LIBSFX}/sane#g" noarch/scanner.pkg || die
94 + sed -i "s#/usr/lib/sane#${D}/usr/lib\${LIBSFX}/sane#g" noarch/scanner.pkg || die
95 + sed -i "s#/usr/share/locale/\$i/LC_MESSAGES/#${D}//usr/share/locale/\$i/LC_MESSAGES#g" noarch/scanner.pkg || die
96 + sed -i "s#\$(sane_config)#${D}/\$(sane_config)#g" noarch/scanner-script.pkg || die
97 + sed -i "s#\$(udev_rules)#${D}/\$(udev_rules)#g" noarch/scanner-script.pkg || die
98 + sed -i "s#\$(hal_rules)#${D}/\$(hal_rules)#g" noarch/scanner-script.pkg || die
99 + sed -i "s#\${USERMAP}#${D}/\${USERMAP}#g" noarch/scanner-script.pkg || die
100 + sed -i "s# trigger_libusbscanner_hotplug##g" noarch/scanner-script.pkg || die
101 + mkdir -p "${D}"/etc/hotplug/usb || die
102 +
103 + if use scanner ; then
104 + echo "# Add support for the HP-ULD specific backend. Needs net-print/hpuld installed." > "${S}"/"${PN}".conf || die
105 + echo "smfp" > "${S}"/"${PN}".conf || die
106 + insinto ${SANE_CONF_DIR}/dll.d
107 + doins "${S}"/"${PN}".conf
108 +
109 + sh ./install.sh || die
110 + fperms 644 /etc/sane.d/smfp-hewlett-packard.conf
111 + else
112 + sh ./install-printer.sh || die
113 + fi
114 +}
115 +
116 +pkg_postinst() {
117 + if use scanner ; then
118 + ewarn "If you want to use the scanner,"
119 + ewarn "make sure the smfp is listed in ${SANE_CONF_DIR}/dll.d/"${PN}".conf."
120 + ewarn "If the geniusvp2 is listed in ${SANE_CONF_DIR}/dll.conf,"
121 + ewarn "please comment out it."
122 +
123 + ewarn "You should restart cupsd service after installed $P."
124 + ewarn "OpenRC: rc-service cupsd restart"
125 + ewarn "systemd: systemctl restart cups.service"
126 + fi
127 +}
128 +
129 +pkg_postrm() {
130 + if use scanner ; then
131 + ewarn "You should restart cupsd service after removed $P."
132 + ewarn "OpenRC: rc-service cupsd restart"
133 + ewarn "systemd: systemctl restart cups.service"
134 + fi
135 +}