Gentoo Archives: gentoo-commits

From: Rui Huang <vowstar@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: net-print/hpuld/
Date: Fri, 24 Jun 2022 11:38:23
Message-Id: 1656070682.1bee2aa4d91e033cc1d575822dbca7fe79bad3f2.vowstar@gentoo
1 commit: 1bee2aa4d91e033cc1d575822dbca7fe79bad3f2
2 Author: Huang Rui <vowstar <AT> gmail <DOT> com>
3 AuthorDate: Fri Jun 24 11:37:31 2022 +0000
4 Commit: Rui Huang <vowstar <AT> gmail <DOT> com>
5 CommitDate: Fri Jun 24 11:38:02 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=1bee2aa4
7
8 net-print/hpuld: fix install error when have rpm
9
10 Signed-off-by: Huang Rui <vowstar <AT> gmail.com>
11
12 net-print/hpuld/hpuld-1.00.39.15.00.23.ebuild | 37 ++++++++++-----------------
13 net-print/hpuld/metadata.xml | 2 +-
14 2 files changed, 15 insertions(+), 24 deletions(-)
15
16 diff --git a/net-print/hpuld/hpuld-1.00.39.15.00.23.ebuild b/net-print/hpuld/hpuld-1.00.39.15.00.23.ebuild
17 index ead2296e6..1d31577a8 100644
18 --- a/net-print/hpuld/hpuld-1.00.39.15.00.23.ebuild
19 +++ b/net-print/hpuld/hpuld-1.00.39.15.00.23.ebuild
20 @@ -4,6 +4,7 @@
21 EAPI="8"
22
23 MY_PV="$(ver_rs 4 _)"
24 +SANE_CONF_DIR="/etc/sane.d"
25
26 DESCRIPTION="HP Unified Linux Driver (for samsung hardware)"
27 HOMEPAGE="https://support.hp.com"
28 @@ -63,6 +64,9 @@ src_install() {
29 sed -i "s#\"\$INSTDIR_CUPS_FILTERS\"#\"${D}/\$INSTDIR_CUPS_FILTERS\"#g" noarch/printer.pkg || die
30 sed -i "s#\"\$INSTDIR_CUPS_PPD\"#\"${D}/\$INSTDIR_CUPS_PPD\"#g" noarch/printer-script.pkg || die
31 sed -i "s#\"\$INSTDIR_LSB_PPD\"#\"${D}/\$INSTDIR_LSB_PPD\"#g" noarch/printer-script.pkg || die
32 + # Not use rpm and dpkg
33 + sed -i "s#which rpm#which not_found_command_${PN}#g" noarch/package_utils || die
34 + sed -i "s#which dpkg#which not_found_command_${PN}#g" noarch/package_utils || die
35
36 # Fix scanner install path
37 sed -i "s#SANE_DIR=/usr/lib\${LIBSFX}/sane#SANE_DIR=${D}/usr/lib\${LIBSFX}/sane#g" noarch/scanner.pkg || die
38 @@ -76,25 +80,13 @@ src_install() {
39 mkdir -p "${D}"/etc/hotplug/usb || die
40
41 if use scanner ; then
42 - local SCDIR="/etc/sane.d"
43 -
44 - if [ -f ${SCDIR}/dll.conf ] ; then
45 - mkdir -p ${D}/${SCDIR} || die
46 - cat ${SCDIR}/dll.conf > ${D}/${SCDIR}/dll.conf || die
47 - if ! grep -q '^smfp$' ${D}/${SCDIR}/dll.conf ; then
48 - echo "# Add support for the HP-ULD specific backend. Needs net-print/hpuld installed." >> ${D}/${SCDIR}/dll.conf || die
49 - echo "smfp" >> ${D}/${SCDIR}/dll.conf || die
50 - fi
51 - if grep -q '^geniusvp2' ${D}/${SCDIR}/dll.conf ; then
52 - # Comment out geniusvp2 backend
53 - sed -i 's/geniusvp2/#geniusvp2/' > ${D}/${SCDIR}/dll.conf || die
54 - fi
55 - else
56 - echo "smfp" >> ${D}/${SCDIR}/dll.conf || die
57 - fi
58 - chmod 664 ${D}/${SCDIR}/dll.conf
59 + echo "# Add support for the HP-ULD specific backend. Needs net-print/hpuld installed." > "${S}"/"${PN}".conf || die
60 + echo "smfp" > "${S}"/"${PN}".conf || die
61 + insinto ${SANE_CONF_DIR}/dll.d
62 + doins "${S}"/"${PN}".conf
63
64 sh ./install.sh || die
65 + fperms 644 /etc/sane.d/smfp-hewlett-packard.conf
66 else
67 sh ./install-printer.sh || die
68 fi
69 @@ -103,8 +95,8 @@ src_install() {
70 pkg_postinst() {
71 if use scanner ; then
72 ewarn "If you want to use the scanner,"
73 - ewarn "make sure the smfp is listed in /etc/sane.d/dll.conf."
74 - ewarn "If the geniusvp2 is listed in /etc/sane.d/dll.conf,"
75 + ewarn "make sure the smfp is listed in ${SANE_CONF_DIR}/dll.d/"${PN}".conf."
76 + ewarn "If the geniusvp2 is listed in ${SANE_CONF_DIR}/dll.conf,"
77 ewarn "please comment out it."
78
79 ewarn "You should restart cupsd service after installed $P."
80 @@ -115,9 +107,8 @@ pkg_postinst() {
81
82 pkg_postrm() {
83 if use scanner ; then
84 - ewarn "After you removed $P,"
85 - ewarn "if the smfp is listed in /etc/sane.d/dll.conf"
86 - ewarn "you should remove it to keep clean."
87 - ewarn "If you are just reinstalling, ignore this message."
88 + ewarn "You should restart cupsd service after removed $P."
89 + ewarn "OpenRC: rc-service cupsd restart"
90 + ewarn "systemd: systemctl restart cups.service"
91 fi
92 }
93
94 diff --git a/net-print/hpuld/metadata.xml b/net-print/hpuld/metadata.xml
95 index 1871ee15e..d32bbab0a 100644
96 --- a/net-print/hpuld/metadata.xml
97 +++ b/net-print/hpuld/metadata.xml
98 @@ -1,5 +1,5 @@
99 <?xml version="1.0" encoding="UTF-8"?>
100 -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
101 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
102 <pkgmetadata>
103 <maintainer type="person">
104 <email>vowstar@×××××.com</email>