public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Rui Huang" <vowstar@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:dev commit in: net-print/hpuld/
Date: Fri, 24 Jun 2022 11:38:20 +0000 (UTC)	[thread overview]
Message-ID: <1656070682.1bee2aa4d91e033cc1d575822dbca7fe79bad3f2.vowstar@gentoo> (raw)

commit:     1bee2aa4d91e033cc1d575822dbca7fe79bad3f2
Author:     Huang Rui <vowstar <AT> gmail <DOT> com>
AuthorDate: Fri Jun 24 11:37:31 2022 +0000
Commit:     Rui Huang <vowstar <AT> gmail <DOT> com>
CommitDate: Fri Jun 24 11:38:02 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=1bee2aa4

net-print/hpuld: fix install error when have rpm

Signed-off-by: Huang Rui <vowstar <AT> gmail.com>

 net-print/hpuld/hpuld-1.00.39.15.00.23.ebuild | 37 ++++++++++-----------------
 net-print/hpuld/metadata.xml                  |  2 +-
 2 files changed, 15 insertions(+), 24 deletions(-)

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
index ead2296e6..1d31577a8 100644
--- a/net-print/hpuld/hpuld-1.00.39.15.00.23.ebuild
+++ b/net-print/hpuld/hpuld-1.00.39.15.00.23.ebuild
@@ -4,6 +4,7 @@
 EAPI="8"
 
 MY_PV="$(ver_rs 4 _)"
+SANE_CONF_DIR="/etc/sane.d"
 
 DESCRIPTION="HP Unified Linux Driver (for samsung hardware)"
 HOMEPAGE="https://support.hp.com"
@@ -63,6 +64,9 @@ src_install() {
 	sed -i "s#\"\$INSTDIR_CUPS_FILTERS\"#\"${D}/\$INSTDIR_CUPS_FILTERS\"#g" noarch/printer.pkg || die
 	sed -i "s#\"\$INSTDIR_CUPS_PPD\"#\"${D}/\$INSTDIR_CUPS_PPD\"#g" noarch/printer-script.pkg || die
 	sed -i "s#\"\$INSTDIR_LSB_PPD\"#\"${D}/\$INSTDIR_LSB_PPD\"#g" noarch/printer-script.pkg || die
+	# Not use rpm and dpkg
+	sed -i "s#which rpm#which not_found_command_${PN}#g" noarch/package_utils || die
+	sed -i "s#which dpkg#which not_found_command_${PN}#g" noarch/package_utils || die
 
 	# Fix scanner install path
 	sed -i "s#SANE_DIR=/usr/lib\${LIBSFX}/sane#SANE_DIR=${D}/usr/lib\${LIBSFX}/sane#g" noarch/scanner.pkg || die
@@ -76,25 +80,13 @@ src_install() {
 	mkdir -p "${D}"/etc/hotplug/usb || die
 
 	if use scanner ; then
-		local SCDIR="/etc/sane.d"
-
-		if [ -f ${SCDIR}/dll.conf ] ; then
-			mkdir -p ${D}/${SCDIR} || die
-			cat ${SCDIR}/dll.conf > ${D}/${SCDIR}/dll.conf || die
-			if ! grep -q '^smfp$' ${D}/${SCDIR}/dll.conf ; then
-				echo "# Add support for the HP-ULD specific backend.  Needs net-print/hpuld installed." >> ${D}/${SCDIR}/dll.conf || die
-				echo "smfp" >> ${D}/${SCDIR}/dll.conf || die
-			fi
-			if grep -q '^geniusvp2' ${D}/${SCDIR}/dll.conf ; then
-				# Comment out geniusvp2 backend
-				sed -i 's/geniusvp2/#geniusvp2/' > ${D}/${SCDIR}/dll.conf || die
-			fi
-		else
-			echo "smfp" >> ${D}/${SCDIR}/dll.conf || die
-		fi
-		chmod 664 ${D}/${SCDIR}/dll.conf
+		echo "# Add support for the HP-ULD specific backend.  Needs net-print/hpuld installed." > "${S}"/"${PN}".conf || die
+		echo "smfp" > "${S}"/"${PN}".conf || die
+		insinto ${SANE_CONF_DIR}/dll.d
+		doins "${S}"/"${PN}".conf
 
 		sh ./install.sh || die
+		fperms 644 /etc/sane.d/smfp-hewlett-packard.conf
 	else
 		sh ./install-printer.sh || die
 	fi
@@ -103,8 +95,8 @@ src_install() {
 pkg_postinst() {
 	if use scanner ; then
 		ewarn "If you want to use the scanner,"
-		ewarn "make sure the smfp is listed in /etc/sane.d/dll.conf."
-		ewarn "If the geniusvp2 is listed in /etc/sane.d/dll.conf,"
+		ewarn "make sure the smfp is listed in ${SANE_CONF_DIR}/dll.d/"${PN}".conf."
+		ewarn "If the geniusvp2 is listed in ${SANE_CONF_DIR}/dll.conf,"
 		ewarn "please comment out it."
 
 		ewarn "You should restart cupsd service after installed $P."
@@ -115,9 +107,8 @@ pkg_postinst() {
 
 pkg_postrm() {
 	if use scanner ; then
-		ewarn "After you removed $P,"
-		ewarn "if the smfp is listed in /etc/sane.d/dll.conf"
-		ewarn "you should remove it to keep clean."
-		ewarn "If you are just reinstalling, ignore this message."
+		ewarn "You should restart cupsd service after removed $P."
+		ewarn "OpenRC: rc-service cupsd restart"
+		ewarn "systemd: systemctl restart cups.service"
 	fi
 }

diff --git a/net-print/hpuld/metadata.xml b/net-print/hpuld/metadata.xml
index 1871ee15e..d32bbab0a 100644
--- a/net-print/hpuld/metadata.xml
+++ b/net-print/hpuld/metadata.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
 	<maintainer type="person">
 		<email>vowstar@gmail.com</email>


             reply	other threads:[~2022-06-24 11:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24 11:38 Rui Huang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-09-07  3:57 [gentoo-commits] repo/proj/guru:dev commit in: net-print/hpuld/ Rui Huang
2022-09-07  3:57 Rui Huang
2022-09-07  3:57 Rui Huang
2022-04-21 12:20 Rui Huang
2022-04-21 12:16 Rui Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1656070682.1bee2aa4d91e033cc1d575822dbca7fe79bad3f2.vowstar@gentoo \
    --to=vowstar@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox