summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Kostecki <conikost@gentoo.org>2021-04-10 22:56:13 +0200
committerConrad Kostecki <conikost@gentoo.org>2021-04-10 22:57:09 +0200
commit59f54110b3883bd824216fe51ae73bd1b02afd4f (patch)
treef21970ab538c7f38df2c5eb86ed2b4946cd3e143 /sys-block
parentacct-group/scsi: add scsi (415) group (diff)
downloadgentoo-59f54110b3883bd824216fe51ae73bd1b02afd4f.tar.gz
gentoo-59f54110b3883bd824216fe51ae73bd1b02afd4f.tar.bz2
gentoo-59f54110b3883bd824216fe51ae73bd1b02afd4f.zip
sys-block/scsiadd: migrate to GLEP 81
Closes: https://bugs.gentoo.org/781587 Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
Diffstat (limited to 'sys-block')
-rw-r--r--sys-block/scsiadd/scsiadd-1.97-r2.ebuild65
1 files changed, 65 insertions, 0 deletions
diff --git a/sys-block/scsiadd/scsiadd-1.97-r2.ebuild b/sys-block/scsiadd/scsiadd-1.97-r2.ebuild
new file mode 100644
index 000000000000..112fdbce9ac4
--- /dev/null
+++ b/sys-block/scsiadd/scsiadd-1.97-r2.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Add and remove SCSI devices from your Linux system during runtime"
+HOMEPAGE="https://llg.cubic.org/tools/"
+SRC_URI="https://llg.cubic.org/tools/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="suid"
+
+RDEPEND="suid? ( acct-group/scsi )"
+BDEPEND="${RDEPEND}"
+
+src_prepare() {
+ default
+
+ # Remove 'strip' command, as portage handles this
+ sed -e "s:^\(.*strip.*\):#\1:g" -i Makefile.in || die
+
+ # Convert docs to UTF-8
+ if [ -x "$(type -p iconv)" ]; then
+ for X in NEWS README; do
+ iconv -f LATIN1 -t UTF8 -o "${X}~" "${X}" \
+ && mv -f "${X}~" "${X}" \
+ || rm -f "${X}~" || die
+ done
+ fi
+}
+
+src_compile() {
+ # Extra safety for suid
+ append-ldflags -Wl,-z,now
+
+ # Use system compiler
+ tc-export CC
+
+ default
+}
+
+src_install() {
+ dosbin scsiadd
+
+ if use suid; then
+ fowners root:scsi /usr/sbin/scsiadd
+ fperms 4710 /usr/sbin/scsiadd
+ fi
+
+ doman scsiadd.8
+
+ einstalldocs
+}
+
+pkg_postinst() {
+ if use suid; then
+ ewarn "You have chosen to install ${PN} with the binary setuid root. This"
+ ewarn "means that if there any undetected vulnerabilities in the binary,"
+ ewarn "then local users may be able to gain root access on your machine."
+ fi
+}